-
loading var from text file
Hello,
I need to load a var (number) from a text file
in the following way:
in the text file I write:
product=1
the flash reads this txt file and goes to frame
number 3 (for example) - because product=1.
if the number written is 2 - so flash goes
to frame number 4 (for example).
any help is needed
-
Code:
onClipEvent (load) {
loadVariables("filename.txt",_root.myLoadVar);
function checkParamsLoaded() {
if (_root.myLoadVar.product== undefined) {
trace("not yet.");
} else {
if (_root.myLoadVar.product ==1) {
_root.gotoAndStop(3);
}
if (_root.myLoadVar.product ==2) {
_root.gotoAndStop(4);
}
}
}
}
-
hello again
can you send an example
cause I can't make it to work.
thanks a lot
-
Sorry, I didn't give you a step by step, but don't forget to make an empty mc called myLoadVar.
http://www.cowfly.com/misc/loadVar.zip
-
-
Yes it worked
Thank you so much
Have a great day
elad
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|