I think it's a actionscript version syntax type thing...
I'm pretty sure Flash 4's actionscript has to have == to mean equals, and Flash 5's actionscript uses = only. ----------------------------------------
The Learning process is just a way to get rid of all the stupids in your head.
OK. But when I deconstruct a script, and found the following code:
on (release) {
if (this.pressed==0) {
tellTarget ("cross" {
gotoAndStop ("pressedup"
this.pressed = 1;
}
Jenny...
You would assign a value to a variable with "=" only as /:variable = 1;, or /:variable = "Jenny";, but in an if statement, you would use "==": if (/:variable == 1) { do something... } or this if (/:variable <= 1) { do something... } meaning if the variable is equal or smaller than 1, do something...
Well you can write it that way... But it won't work!
To test this try a trace statement after your if statement, you'll see what I mean.
/:variable = 1;
if (/:variable == 1) {
trace (" Variable equals 1"
}
The above will open the output window and print "Variable equals 1". If you remove one of the "=" in the if statement, it won't!
Cool...I gotta go back and look at the code...weird. ----------------------------------------
The Learning process is just a way to get rid of all the stupids in your head.
ok, so basically one is set, the other is check...right?
Set variable = bla (just sets the variable)
Check variable == bla (if it's bla, it returns true)
Regards,
AnthLOLny
----------------------------------------
The Learning process is just a way to get rid of all the stupids in your head.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.