Haikal Saadh wrote:
Yes, they are different.r

Actionscript dictionary says 'eq' is deprecated. It just compares string representations, so what you might be doing is comparing a number to it's string representation (User input, perhaps?): http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary198.html


What == does depends on what sort of data you're comparing. Again, from the dictionary:

The definition of equal depends on the data type of the parameter:

Numbers and Boolean values are compared by value, and are considered equal if they have the same value. String expressions are equal if they have the same number of characters and the characters are identical. Variables, objects, arrays, and functions are compared by reference. Two variables are equal if they refer to the same object, array, or function. Two separate arrays are never considered equal, even if they have the same number of elements.

Well here is a sample of what I was trying to compare...


var myLink:String = this._targetMc._DB.getItemAt(0).link01;

if (myLink == "") {
trace("it was empty");
} else {
trace("It had the result: " + myLink);
}

And I was just getting hte else returned with no myLink var shown (when the loop had the record empty). Then I switched to:


if (myLink eq "") {
trace("it was empty");
} else {
trace("It had the result: " + myLink);
}

And it worked as expected.


That is what confused me. And I really do not want to use the "eq" as it is depreciated.

d
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to