Solved

If then logic from a text file!

Posted on 2002-05-17
3
171 Views
Last Modified: 2010-04-03
Ok this may be an easy one but I havent learnt actionscript in flash as yet so here goes:

I have a text file that may contaion a var thats 1 or 0

I want to load the text file var and then if the var is one go to the next frame if the var is 0 then just stay on teh frame.
I figured I do something like

loadvariable ("text.txt")
if "thevariablinthetextfile" = 1
then goto frame 2

Can you give me your help?

And also if you can recomend any books on actionscripting please

Regards
0
Comment
Question by:UberFreak
  • 3
3 Comments
 
LVL 5

Expert Comment

by:stef4s
ID: 7023359
ok write your textfile like this

&myvar=1


loadvariables ("text.txt")
if (myvar==1){

gotoAndPlay(2);
}


0
 
LVL 5

Accepted Solution

by:
stef4s earned 135 total points
ID: 7023362
to make sure that your syntax is correct use the help file bundled with flash. to vrify command etc.
0
 
LVL 5

Expert Comment

by:stef4s
ID: 7023580
also remember that on the internet you might need to give the loadvariables command some time to download the file.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
WMV file has abnormal script stream which may cause production problems. 7 751
Array is not working ( AS2 ) 4 158
video live streaming 1 125
PDF: Display my cards game? 8 124
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question