Sounds like a job for score recording.  I would build an author-time 
utility that builds your list.  I had forgotten about "the 
frameScript" but you could easily use that to get the name of the 
behavior. Something like this (untested):


on BuildListOfKeyFrames
   beginrecording
     MyStack = []
     listOfLabels = the labelList
     delete the last char of listOfLabels -- eliminate trailing carriage return
     nLabels = the number of lines in listOfLabels
     repeat with i = 1 to nLabels
        thisLabel = line i of listOfLabels
        go thisLabel
        -- I believe that this will update the playhead to that frame
        nmFrameScript  = the frameScript -- returns a number of member
        thisName = member(nmFrameScript).name
        if thisName = "Go to the frame" then
            MyStack.append(thisLabel)
        end if
      end repeat
    endrecording
    -- Now save the MyStack into a data cast member for use at run time
end

See my article on DOUG at 
http://www.director-online.com/accessArticle2.cfm?id=442 for details 
on how to use data cast members.  Basic idea is that you create a 
cast member on the fly that saves this list.  Then at run time you 
read it back and use it.

Or use the new vlist XTRA that Al wrote about today.

Irv


At 7:45 PM -0400 7/20/01, Slava Paperno wrote:
>Thanks, Irv! I didn't know that the frame script channel was channel 
>0, that really helps. However, if I only wanted to learn the text of 
>the script of the current frame, I could use "the frameScript." But 
>I need a way to get the text of the script of frame "MyFrame," not 
>just the current frame.
>
>As to why I would want to do this, here it is:
>
>Some of my frames are redirectors; the frame script forwards the 
>playhead somewhere else. Other frames (those whose scripts have the 
>"go to the frame" line) are valid in themselves as parts of the app. 
>I want to make a stack of frame numbers or labels that would include 
>the looping frames, but exclude the redirectors. Then I can give the 
>user Next and Prev buttons for paging through this stack, i.e. 
>through the "real" content frames. What better way to do that than 
>by testing the frame script for the presence of "go to the frame"? 
>But for that, I need to be able to say:
>
>MyStack = []
>repeat with i = (the labelList).line.count down to 1
>    if "the script of frame i" contains "go to the frame" then
>    MyStack.append((the labelList).line[i])
>end repeat
>
>My probelm is how to say "the script of frame i."
>
>Slava
>
>At 03:58 PM 7/20/2001 -0700, you wrote:
>>I can't imagine why you would want this.  But assuming that you 
>>have a good reason - here's an untested approach ...
>>
>>The frame script channel is zero.  So first you get the 
>>scriptInstanceList of sprite 0
>>
>>    lBehaviors = sprite(0)scriptInstanceList
>>
>>This returns a list, but frame scripts only have one element so
>>
>>    thisBehaviorInstance = lBehavior[1]
>>
>>This is a behavior reference like <offspring "Go to the frame" 1 
>>5c77710> so, get the second item
>>(You might have to fiddle with the itemdelimiter here or parse out 
>>the thing inside quotes)
>>
>>   thisBehaviorName = item 2 of string(thisBehaviorInstance)
>>
>>Now get the text of that member
>>
>>   theText = member(thisBehaviorName).scriptText
>>
>>What you do with that is beyond my imagination.
>>
>>There is probably an easier way to do what you really want to do 
>>than this.  For example, setting some property variable which could 
>>be queried later via:
>>
>>     sendSprite (sendSprite, 0, #mGetSomePropertyVariable)
>>
>>And have the frame have an mGetSomePropertyVariable to return 
>>whatever it is that you are looking for.
>>
>>Irv
>>
>>At 6:19 PM -0400 7/20/01, Slava Paperno wrote:
>>>I can't find out how to refer to the text of the frame script. 
>>>script(frameLabel).scriptText?? Help, anyone? Thanks!
>>>Slava
>
>
>[To remove yourself from this list, or to change to digest mode, go to
>http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
>email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
>Lingo-L is for learning and helping with programming Lingo.  Thanks!]


-- 

Lingo / Director / Shockwave development for all occasions. 
          
   (Home-made Lingo cooked up fresh every day just for you.)

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to