-
referencing duplicated movie clip
I'm trying to get the height of a duplicated movie clip that was created as: -
duplicateMovieClip (_root.my_movie, "my_movie"+i, i);
Where i is a number incrementing from 0 to whatever. How do I reference the movie I just created? Having troubles with syntax, currently using: -
getProperty(_root.my_movie+i, _y)
but doesn't seem to work, I'm guessing its the +i that is inncorrect?
Help much appreciated, thanks
-
Flash Initiate
You should use (in F5 / MX)
Code:
_root["my_movie" + i]
// so if we want to get _y, we'd write
y = _root["my_movie" + i]._y
Hope that helps,
Stu
-
Flash Initiate
Hold on a second - what is 'i', have you said something like:
Code:
for (i=1;i<=2;i++) {
duplicateMovieClip (_root.my_movie, "my_movie"+i, i);
}
Where we use i to give each instance of the copies a different name and level. So the first instance id my_movie1 and the second my_movie2, etc.
Or is i not defined?
In which case you need to use:
Code:
duplicateMovieClip (_root.my_movie, "my_movie_new", 1);
Then reference it by:
Code:
y = my_movie_new._y;
Is that clearer?
Stu
-
No your first assumption is right, "i" is used to specify each movie as an incrementally new name. Thanks alot for the help mate!
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
|