[thelist] Flash: Path issues, number as instance name

Benjer futureweb at macmail.com
Thu Dec 19 04:16:01 CST 2002


>The correct syntax to use when
> an instance's name is a number is such:

I wouldnt recommend using numbers as an instance name, here is a method to
get the required number from the end of a string:

On (release){
_root.textUpdate("bar1");
}
On (release){
_root.textUpdate("bar11");
}

function textUpdate(bar){
    if(bar.length=5){
    foo=bar.length-2;
    }else if(bar.length=4){
    foo=bar.length-1;
    }
_root.myTextField="button "+foo+" was pressed";
}

So basically in your function, if the value of bar is equal to 5 chars it
will get the required 2 digit number, if its equal to 4 chars it will get
the required 1 digit number.

Benjer





More information about the thelist mailing list