Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-14-2012, 09:24 AM   #1
wyy
Registered User
 
Join Date: Mar 2012
Posts: 4
Default Dynamic variable

Hello,
Need some help Got problem with loading image to movieclip witch is in movieclip. Searched for solutions, but it doesnt worked.

Need something like this:
ActionScript Code:
_root.mc.mcImg.loadMovie("image.jpg", 10);

But the problem it's need to be loaded in dynamical movieclips.
ActionScript Code:
for (i = 0; i < 5; i++){     duplicateMovieClip (_root.mc.mcImg, "mcImg" + i, i);     setProperty ("_root.mc.mcImg" + i, _x, "150"*i) ;     //And this line doesn't work     this["mc.mcImg" + i].loadMovie("image.jpg", 50); }
wyy is offline   Reply With Quote
Old 04-14-2012, 11:23 AM   #2
Prid
Prid - Outing
 
Prid's Avatar
 
Join Date: Oct 2009
Location: Halden, Norway
Posts: 1,191
Send a message via MSN to Prid Send a message via Skype™ to Prid
Default

You can't duplicate a movieclip which is in another movieclip, only movieclips that are on the same timeline as where you run the code from, and besides, anything inside the brackets will be recognized as ONE object, not two, even if you have a dot, because it's a string, and all codes will be ignored in there. To give you an idea of how you could've done it if your movieclip was duplicated:

ActionScript Code:
_root.mc["mcImg"+i].loadMovie("image.jpg", 50);

btw, why not just execute the above code inside the movieclip, mc, and instead use this duplicate code:

ActionScript Code:
duplicateMovieClip (mcImg, "mcImg" + i, i);

?
__________________
I have returned, and am now 18
Prid is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:20 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.