|
-
if i name a movie clip with a number then can i do this?
the code is in the movie clip
Code:
_root.hitPlace.gotoAndPlay(_root[this]);
_root.backGround.gotoAndPlay(_root[this]);
this doesnt actually work but how can i get something like it to work
Last edited by helpmeplz; 12-21-2005 at 09:09 PM.
-
Senior Member
Confusing question. Please explain better.
-
Hey Timmy!!!
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.
-
Senior Member
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
-
President
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));
 This is MC. His _parents sent him to stop() by the super market to buy some _root beer if he wanted to gotoAndPlay() with his friends at the park later.
This is my Blog!... The gaming Process
Please check out my site: Giddel Creations
-
 Originally Posted by PhobiK
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 question
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|