PDA

View Full Version : (FMX) variable pb



Uli
February 20th, 2004, 02:42 PM
Hello,

I'm checking for the name of the parent movie clip which is something like MyClip2 or MyClip3 ...
when i trace the variable MyID, it displays the right number but
when i try to do basic operation on it, it acts like a string not a number.. how can i solve this pb?



on (press) {
if (this._name.substr(0, 6) == "MyClip") {
MyID = this._name.substr(6, 6);
trace(MyID+10);
//result with MyClip5 : 510 }

claudio
February 20th, 2004, 02:47 PM
Convert MyID to a number then do the operation.

Uli
February 20th, 2004, 02:50 PM
how do i do that :blush:

claudio
February 20th, 2004, 02:53 PM
MyID = Number(this._name.substr(6, 6));
trace(MyID+10);

Uli
February 20th, 2004, 03:01 PM
thank you very much sir :beam:

claudio
February 20th, 2004, 03:02 PM
welcome sir :beam: