kupreg
June 12th, 2003, 01:23 PM
ok this is just kind of a general question, there are still somethings that confuse me about some actionscripting syntax. i've never been able to get a simple reason for syntax besides "JUST BECAUSE"
FIRST off this:
Width=30;
this._x = (this._x < 0) ? Width : (this._x > Width) ? 0 : this._x;
i understand this is using the tertiary operator, but i can't wrap my finger around what it's doing. is it kind of an if - else if - else?
SECOND:
myClip.onEnterFrame=function(){goRight(1,3);}
why does it look like this? is this the same as writing it like this
myClip.onEnterFrame=function(){
goRight(1,3);
}
THIRD: i almost always seem to have trouble with [ ]'s i know they work similar to the eval function used to but when i'm using them to call dynamic clips i always have to put this[] in front of them or the target, i can't just start out with ["myclip" add i]._y instead this["myclip" add i]._y
also with don't you put a dot after this?
if anyone has any insights i would be most thankful
FIRST off this:
Width=30;
this._x = (this._x < 0) ? Width : (this._x > Width) ? 0 : this._x;
i understand this is using the tertiary operator, but i can't wrap my finger around what it's doing. is it kind of an if - else if - else?
SECOND:
myClip.onEnterFrame=function(){goRight(1,3);}
why does it look like this? is this the same as writing it like this
myClip.onEnterFrame=function(){
goRight(1,3);
}
THIRD: i almost always seem to have trouble with [ ]'s i know they work similar to the eval function used to but when i'm using them to call dynamic clips i always have to put this[] in front of them or the target, i can't just start out with ["myclip" add i]._y instead this["myclip" add i]._y
also with don't you put a dot after this?
if anyone has any insights i would be most thankful