use attachMovie with clip created with createEmptyMC

  • posidan
  • Newbie
  • Newbie
  • posidan
  • Posts: 11

Post 3+ Months Ago

Hi again!

Id like to know if it is possible and if so, why i cant make mine work...

Code: [ Select ]
createEmptyMovieClip("test", 1);
createEmptyMovieClip("test2", 2);

test.attachMovie("test2", "attachedtest", 1);
  1. createEmptyMovieClip("test", 1);
  2. createEmptyMovieClip("test2", 2);
  3. test.attachMovie("test2", "attachedtest", 1);


Put simply, id like to attach (or its equivalent) a clip created with createEmptyMovieClip to another clip.

Another way to see my problem is this:

I have a clip on my timeline that contains many functions. One is requiring content to be loaded dynamically (a jpeg in fact) in a clip created with createEmptyMC. But if i use loadMovie in the function every time its created it reloads the jpeg which is annoying. So id like to use attachMovie to preloads all jpeg once before on the main timeline.

When i do that, i cant use attachMovie, or if i do the following in my MC function to replace the loadMovie:

Code: [ Select ]
curMC.image = _level0.image; // _level0.image created on the main timeline.


and then trace(curMC.image) i get the following:

_level0.image instead of _level0.curMC.image

I know that this is normal because my affectation gave curMC.image a reference to the one on the timeline, but now im stuck on how to have a duplicate or the MC itself in curMC.

Any help would be greatly appreciated.
Thanks a lot
Dan
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Natal
  • Beginner
  • Beginner
  • Natal
  • Posts: 49
  • Loc: Transylvania

Post 3+ Months Ago

Hi
your code is not working because the attachMovie() function attaches only movie clips exported from the library. The first parameter of the function must be the linkage identifier of the exported movie clip. You can set the linkage id. of a mc in the library by right clicking/linkage.../export for Actionscript. I don't know of a way to set a linkage identifier for a movie clip via actionscript.
I'm not sure if I get the point, but couldn't you just create the second mc directly in the first one? Like:

Code: [ Select ]
test.createEmptyMovieClip("test2", 2);

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 12 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.