I just have one quick question. As I have been going through the new flash mx book advanced actionscript from the source I have noticed instances where instead of using the regular “=” sign they use the “==” sign but, they negate mentioning why or when to use each particular instance. (example below)
Can someone elaborate on this?
thanks ahead of time!
-z
ex:
MovieClip.prototype.flip = function(mode){
if (mode.toLowerCase() == “h”){
this._xscale = -this._xscale;
}else if (mode.toLowerCase() == “v”){
this._yscale = -this._yscale;
}
}
= assigns value to something. For example age=23. If you Trace(age);
The result would be 23.
== compares values (as in Boolean operation) and returns True or false. If you trace(age==23); It would return true or flase, depending on the value of age.
Odd it wasn’t explained in the book, guess it was implied. Anyway thanks again.
-z
I said that the operator == had not been explained in the book but, actually it is explained along with the other operators used in conditional logic. Its just later in the book. I guess they figured it wasn’t necessary to know until half-way through.
anyway just thought I’d give the authors credit.
Creating engaging and entertaining content for designers and developers since 1998.