-- marissaj ... baby ... this one is for you :-)
-- mailto: shehal@europa.unixville.com
-- Visit my shockwave site: http://www.unixville.com/~shehal
-- Visit marissaj's site: http://www.geocities.com/~marissaj
-- PLEASE NOTE:
-- on beginSprite me
-- put the labelList into member sprite(me.spriteNum).member
-- end
-- add the above script to a text field member to create a field member with ALL markers in your movie
-- you can then delete unwanted markers off and use this script
on getBehaviorDescription me
return "¬
Visted Sections"&RETURN&RETURN&"¬
Apply this behavior on a Field Member to create a drop-down list of the sections in your present movie."&RETURN&RETURN&"¬
ALL markers in your present movie will be included in the applied Field Member."&RETURN&"¬
You can later delete unwanted markers from the Field Member."&RETURN&"¬
Sections visited by the user will be indicated in italics"&RETURN&RETURN&"¬
PLEASE NOTE:"&RETURN&RETURN&"¬
on beginSprite me"&RETURN&"¬
put the labelList into member sprite(me.spriteNum).member"&RETURN&"¬
end"&RETURN&"¬
Add the above script to a text field member to create a field member with ALL markers in your movie and you can then delete unwanted markers off and use this script"&RETURN
end getBehaviorDescription
property memberTextField
property spriteTextField
property clickedStatus
property rL, rT, rR, rB
-- rect parameters
property lH
-- Line hight of text field
property nL
-- Number of lines to display in drop-down list
clickStatus = FALSE
-- FALSE = clicked to drop down
-- TRUE = clicked to select Section
-- create the Visited Sections text file
if statusFileUpdate = TRUE then
if objectP(fileVisitedSections) then set fileVisitedSections = 0
set fileVisitedSections = new(xtra "fileio")
createFile(fileVisitedSections, pathTextFile&nameTextFile&".txt")
closeFile(fileVisitedSections)
set fileVisitedSections = 0
end if
-- read the Visited Sections text file
if objectP(fileVisitedSections) then set fileVisitedSections = 0
set fileVisitedSections = new(xtra "fileio")
set fileName = pathTextFile&nameTextFile&".txt"
if not voidP(filename) and not (filename = EMPTY) then
openFile(fileVisitedSections, filename, 1)
if status(fileVisitedSections) = 0 then
set visitedSections = readFile(fileVisitedSections)
closeFile(fileVisitedSections)
set fileVisitedSections = 0
end if
end if
-- check if visitedSections is valid (suggested by Chuck)
if voidP(visitedSections) = TRUE then
set visitedSections = ""
end if
-- update Sections
allSections = the text of member memberTextField
set nSectionsList = the number of lines in allSections
set nVisitedSections = the number of lines in visitedSections
repeat with n = 1 to nSectionsList
repeat with m = 1 to nVisitedSections
if line (n) of allSections = line (m) of visitedSections then
set the fontStyle of line (n) of member (memberTextField) to "italic"
delete line (m) of visitedSections
end if
end repeat
end repeat
end beginSprite
on mouseUp me
-- drop the Sections list down
member(memberTextField).boxType = #scroll
rB = lH*nL
member(memberTextField).rect = rect(rL, rT, rR, rB)
updateStage
-- set the selected Section as VISITED
lineNo = the mouseLine
if clickStatus = TRUE then
currentVisitedSection = allSections.line[lineNo]
-- change font style of current visited section
set the fontStyle of line (lineNo) of member (memberTextField) to "italic"
-- update the Visited Sections text file
if statusFileUpdate = TRUE then
if objectP(fileVisitedSections) then set fileVisitedSections = 0
set theFile = currentVisitedSection&RETURN
set fileVisitedSections = new(xtra "fileio")
createFile(fileVisitedSections, pathTextFile&nameTextFile&".txt")
openFile(fileVisitedSections, pathTextFile&nameTextFile&".txt",0)
setPosition(fileVisitedSections,getLength(fileVisitedSections))
writeString(fileVisitedSections, theFile)
closeFile(fileVisitedSections)
set fileVisitedSections = 0
end if
-- go to current visited section
go to frame currentVisitedSection
else
clickStatus = TRUE
end if
end mouseUp
on prepareFrame me
-- hilite the pointed section
if the mouseLine > 0 then
hilite line the mouseLine of field memberTextField
updateStage
else
-- close drop down list if outside
rB = lH
member(memberTextField).boxType = #fixed
member(memberTextField).rect = rect(rL, rT, rR, rB)
updateStage
end if
end prepareFrame
on getPropertyDescriptionList
set description = [:]
addProp description, #nL, [#default: 10, #format: #integer, #comment: "Number of lines to display in drop-down list:"]
addProp description, #pathTextFile, [ #default: the moviePath, #format: #string, #comment: "Path of Text File:"]
addProp description, #nameTextFile, [ #default: "boohaha", #format: #string, #comment: "Name of Text File:"]
addProp description, #statusFileUpdate, [ #default: TRUE, #format: #boolean, #comment: "Update to text file? (Y/N):"]
return description
end getPropertyDescriptionList
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA