the code is in the movie clip
this doesnt actually work but how can i get something like it to workCode:_root.hitPlace.gotoAndPlay(_root[this]);
_root.backGround.gotoAndPlay(_root[this]);
Printable View
the code is in the movie clip
this doesnt actually work but how can i get something like it to workCode:_root.hitPlace.gotoAndPlay(_root[this]);
_root.backGround.gotoAndPlay(_root[this]);
Confusing question. Please explain better.
Yeah, need more info to help yea out.
I think he means that if he has, lets say ten MCs named
hitPlace1
hitPlace2
hitPlace3
hitPlace4
hitPlace5
hitPlace6
hitPlace7
hitPlace8
hitPlace9
hitPlace10
that he could check them all with one line of code. coincidentally I, just this moring, realised i need this feature.:)
In that case I suggest saving variable inside each of the mcs which will have the same value as the number in the end of its name. Basically it is also possible to strip the name so only number remains, but it requires using substring and is not easiest way.
for (a=1; a<10; a++){
_root.myMovie["hitPlace"+a].gotoAndStop(2);
}
not sure if thats what you mean but using ["name"+var containing num for each MC] is very usful in this regard.
Ely
I think what he means is that if you have a mc with a name consisting only of a number, is it possible to tell the movie (or a MC) to gotoAndPlay(myInstanceName).
Yeah, it can be done this way:
_root.hitPlace.gotoAndPlay(this._name);
_root.backGround.gotoAndPlay(this._name);
Or to be more precise _root.hitPlace.gotoAndPlay(Number(this._name));
thanks! and sorry to for the vague questionQuote:
Originally Posted by PhobiK