Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | Re: FLASH: Evaluate a variable in a loop... |
From: | John Croteau |
Date: | Thu, 16 Sep 1999 07:35:08 +0100 |
Hi miles,
> And on a side note, is there a more comprehensive resource for the syntax
> of actions? The docs leave many questions unanswered.
Though I just started the series even Variables 1 should help, other
tutorials here treat this subject by example. -->
http://www.FlashBible.com/members/
> I've checked the docs, MACR's site, and the other usual suspects to no
> avail so here it goes.
The first usual suspect is --> http://www.FlashCentral.com/Tech/
And I found the answer there easily.
> 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
You are checking for variables and not literal strings, also I see no
need for eval here.
You need to preset the variable status before the loop:
Set Variable: "status" = "not_ok"
The not received yet is Not_OK which should restart the loop.
If you receive any string except "OK" then you have Bad Data.
If (status) = "ok"
Go to and Stop ("OK")
Else If (status) = "not_ok"
Go to and Stop ("Not_OK")
Else
Go to and Stop ("Bad_Data")
End If
----------- -----------------------
John Croteau croteauerols [dot] com (mailto:croteauerols [dot] com)
------------- -------------------------
FlashTek (Advanced Websites with Flash) http://www.FlashTek.com/
Flash Bible (Fast track to good Flash) http://www.FlashBible.com/
Flash Central(The Universe Starts Here) http://www.FlashCentral.com/
The Flash Tech Resource (Tech Notes) http://www.FlashCentral.com/tech/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------------------------------------------------
To UNSUBSCRIBE send: unsubscribe flasher in the body of an
email to list-managerchinwag [dot] com. Problems to: helpchinwag [dot] com
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-managerchinwag [dot] com
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]