Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
| Subject: | Re: FLASH: Evaluate a variable in a loop... |
| From: | Nathan Dicken |
| Date: | Tue, 21 Sep 1999 13:50:11 +0100 |
Miles,
You'll want to use the "eq" and "ne" instead of using an equals sign when a
variable equals a string instead of an expression. You shouldn't need the
"Eval" statements too. You could change that to:
If (status eq "ok")
Go to and Stop ("OK")
Comment: Handle not_ok result
Else If (status eq "not_ok")
Go to and Stop ("Not_OK")
Comment: Handle bad_data result
Else If (status eq "bad_data")
Go to and Stop ("Bad_Data")
End If
One other thing I've found out is that there might be a small delay in
importing the variables from the text file. After the button is pressed,
you might consider sending the playhead to a loop sequence that checks this:
If (status ne "")
Go to and Play ("Do the Rest")
Else
Go to Next Frame
End If
The first frame of your loop could just have a "Play" action, the second
could have the above actionscript, and the third could have a "Go to and
Play" command that sends the playhead back to the first frame of the loop.
I hope this helps.
Nathan
--------------------------------------
Nathan Dicken
Fusionary Media
http://www.fusionary.com
>I've checked the docs, MACR's site, and the other usual suspects to no
>avail so here it goes.
>
>What is the best way to test a variable in a looping segment of a timeline?
>
>For example I have this action attached to a button:
>
>On Release
> Comment: read in status.txt; typical contents: status=ok
> Load Variables("status.txt",0)
> Go To and Play("Submit_Loop")
>end release
>
>The contents of status.txt file is "status=ok", so ok appears on stage in
>the status field variable. This field is visible in all frames of the movie.
>
>I have a label called "Submit_Loop", that contains this frame action:
>
>Comment: Handle ok result
>If (Eval(status) = ok)
> Go to and Stop ("OK")
>Comment: Handle not_ok result
>Else If (Eval(status) = not_ok)
> Go to and Stop ("Not_OK")
>Comment: Handle bad_data result
>Else If (Eval(status) = bad_data)
> Go to and Stop ("Bad_Data")
>End If
>
>Three frames later I have another frame with this frame action that creates
>the loop:
>
>Go to and Play("Submit_Loop")
>
>Regardless of the value of status, the movie goes to "Bad_Data". How do I
>modify
>the above to have status evaluated correctly? It's probably an easy fix but
>I've been unable to figure it out.
>
>All of the above is in one bare-bones test movie with 1 main timeline and
>no movie clips.
>
>And on a side note, is there a more comprehensive resource for the syntax
>of actions? The docs leave many questions unanswered.
>
>TIA for any assistance.
>
>Ciao,
>
>m i l e s
>_______________________________________________________________________
>
>m i l e s l i G h T w O o d
>_______________________________________________________________________
> m i l e s G T O @ p o b o x . c o m
>_______________________________________________________________________
>multimedia development: director lingo shockwave java +1 213.353.9850
>
>
>
>------------------------------------------------------------------------
>To UNSUBSCRIBE send: unsubscribe flasher in the body of an
>email to list-manager
>N.B. Email address must be the same as the one you used to subscribe.
>For info on digest mode send: info flasher to list-manager
------------------------------------------------------------------------
To UNSUBSCRIBE send: unsubscribe flasher in the body of an
email to list-manager
N.B. Email address must be the same as the one you used to subscribe.
For info on digest mode send: info flasher to list-manager
Replies
FLASH: Evaluate a variable in a loop..., m i l e s l i g h t w o
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]

