PDA

View Full Version : swapDepths


ssjogus
12-05-2002, 07:24 AM
i have gone through tutorials of swaping depths. I understood the command swap depth, but i have some doubts:

on (press) { this.swapDepths ("_level0:window"+_level0:highest);
_level0:highest = substring(_name, 7, 1); startDrag (this);}

on (release) { stopDrag ();}

this is what the tutorial displays. but i have not understood the line -

_level0:highest = substring(_name, 7, 1);

when, why do we use substring, name?

ssjogus.

Billy T
12-05-2002, 09:39 PM
_name returns the instance name of the mc that the action is on

substring extracts a portion of a string - in this case the instance name of the mc

so if your instance name was tester5 then that line of code would assign 5 to the variable on _level0

cheers