Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

If then logic from a text file!

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
UberFreak
Asked:
UberFreak
  • 3
1 Solution
 
stef4sCommented:
ok write your textfile like this

&myvar=1


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

gotoAndPlay(2);
}


0
 
stef4sCommented:
to make sure that your syntax is correct use the help file bundled with flash. to vrify command etc.
0
 
stef4sCommented:
also remember that on the internet you might need to give the loadvariables command some time to download the file.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now