Hi there.
I am a newbie to this, but hope that someone can help.
In flash, I have the following script:
myrepeat = 20;
for (i=0; i<myrepeat; i++) {
duplicateMovieClip("blob", "blob"+i, i);
}
which gives me 20 copies of a movieclip called "blob0","blob1","blob2" etc etc.
This is fine.
Now, for example, if I want to tell "blob2" to gotoAndStop(3) i can do this:
_root.blob2.gotoAndStop(3);
which works fine.
My problem comes when I want to tell all of my movieclips to go to scene 3. I thought I could do it in a repeat statement as follows:
myrepeat = 20;
for (i=1; i<myrepeat; i++) {
myblob = ("blob"+i);
trace(myblob);
_root.myblob.gotoAndStop("3");
}
the trace(myblob) returns "blob0" through to "blob19" as I would expect so it's working. However, the movieclips wont change.
Like I say, If I manually type in _root.blob2.gotoAndStop(3); then it works.
How do I tell actionscript to gotoAndStop the movie myblob[number]?
Thanks for any help. Been pulling my hair out over this!
Flash and Dynamic movie name
Started by
tperry2x
, Apr 01 2010 05:11 AM
4 replies to this topic
#1
Posted 01 April 2010 - 05:11 AM
#2
Posted 17 April 2010 - 11:00 AM
*bump*
anybody have any ideas on this?
anybody have any ideas on this?
#3
Posted 09 July 2010 - 01:31 AM
Flash-5, vide0 clips can be manipulated as 0bjects, we learn in Chapter 12, the 0bjects and classes. We can get and set pr0perties 0f a clip, and y0u can call the meth0ds 0f measurement, 0r a clip. Unlike 0ther items
#4
Posted 31 July 2010 - 05:22 AM
Yes, you can set properties of a clip, but it seems flash can't handle referencing an object with a name which dynamically increases by an integer. Anyone else have any workarounds to this or is this a limitation of flash?
#5
Posted 21 September 2010 - 02:30 PM
Bump!
Anybody............... Nobody huh?
Anybody............... Nobody huh?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users