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!]