-
Flash Initiate
eval script in MX
Hello,
I'm just moving from Flash 5 to MX and I'm having some trouble with some code that worked fine in F5 but doesn't want to work in MX.
Could someone point me in the right direction?
This script is on a button. As you can see it's targetting a MC which is part of an array. It's generating the things to link to and move on the fly. This all worked fine in F5, but FMX does not like my eval statement being on the left side in this line: eval("_root.text" +n+ ".xend") = 10;
Full script:
on (rollOver) {
n = 1;
link[n] = eval("_root.link"+n);
link[n].fade = 100;
eval("_root.text" +n+ ".xend") = 10;
}
on (rollOut) {
link[n].fade = 20;
eval("_root.text"+n+".xend") = -200;
}
Any ideas?
Thanks in advance.
Kindest Regards,
Stu
-
Code:
on (rollOver) {
n = 1;
link[n] = _root["link" + n];
link[n].fade = 100;
_root["text" + n + ".xend"] = 10;
}
on (rollOut) {
link[n].fade = 20;
_root["text" + n + ".xend"] = -200;
}
-
The world goes - hm..
I'm just curious: why do you use eval? What do you want it to do?
-
Flash Initiate
Cheers people...
I just tried that and it should work - but it doesn't, only this time it throws up no errors? (it also works in F5 but not MX!!!!)
I think something strange is afoot.
Thank you anyway, if you think of anything else it would be much appreciated.
Stu
P.S. In answer to The Caramella, I was previously using eval in this line:
eval("_root.text" +n+ ".xend") = 10;
to get flash to see it as
_root.text1.xend = 10;
As I have many instances of this I use the code as a function and just change the value of n to target different movieclips.
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
|