Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: How do I read the value of a variable?
From: Muzak
Date: Thu, 14 Dec 2000 01:45:07 GMT

I got this working, but you'll have to settle with an update every 30 seconds (or whatever you desire/suits your needs).
Using variable getTimer() and GET to trick the browser to not load from cache.

onClipEvent (load) {
loadVariables ("alert_status.txt", this);
t = getTimer()/1000;
}
onClipEvent (enterFrame) {
//loads textfile every 30 seconds
//change t+30 for different timing
if (getTimer()/1000 >= t+30) {
t = getTimer()/1000;
loadVariables ("alert_status.txt", this, "GET");
}
if (txtStatus != null) {
_root.gotoAndStop(txtStatus);
}
}

HTH,
Muzak
----- Original Message -----
From: "Colleen Appleton" <listatgoldlink [dot] com>
To: <flasheratchinwag [dot] com>
Sent: Thursday, December 14, 2000 12:32 AM
Subject: FLASH: How do I read the value of a variable?


> Hello Flashers,
>
> I'm stumped on this and have tried every possible combo I can but it's not
> working. I have a movie clip called getStatus with a dynamic field called
> txtStatus.
>
> The actions for getStatus are:
>
> // reads the text file.
> onClipEvent (load) {
> loadVariables ("alert_status.txt", "");
> }
> // Dynamically updates the results if the text file changes.
> onClipEvent (enterFrame) {
> loadVariables ("alert_status.txt", "");
> // If the results is normal, then send the playhead to frame label normal.
> If it reads HIGH, send it to label high.
> // If it reads low, send to label low.
> if (txtStatus == "NORMAL") {
> tellTarget ("_root") {
> gotoAndStop ("normal");
> }
> }
> }
>
> The question is, how do we get the result of alert_status.txt to use in our
> if.. script? The value will be either: NORMAL, HIGH, or LOW. If it sees
> the word normal, the playhead needs to jump to the main timeline called
> "normal". etc. The text file is updated constantly but will only display
> one of those values. If say the value changes from NORMAL, to HIGH, then
> the playhead has to jump to the label "high" and the script loops there
> until the status changes again.
>
> The text displays dynamically as planned, but I can't grab the results and
> direct the script in an if statement.
>
> Any help would be appreciated!
>
> Colleen



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
November 27-29, 2000, LONDON, National Film Theatre

Produced by United Digital Artists and lynda.com
-Sponsored by Macromedia, Adobe Systems and Apple Computer
-http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
Register before November 10 and save �200
http:// www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  FLASH: getURL from Flash as QTMovie in D, Stephen Recker
  FLASH: How do I read the value of a vari, Colleen Appleton

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]