all groups > flash actionscript > january 2004 >
You're in the

flash actionscript

group:

Attachmovie stumbling block



Attachmovie stumbling block jarvphot
1/31/2004 9:02:22 AM
flash actionscript: Thank you for taking the time to help.

I am using attachmovie to load a clip onto the stage and am having problems executing.

This code works fine, where "Image05_mc" is a simple mc where a JPG has been converted to a symbol :

_root.onEnterFrame = function() {
_root.attachMovie("Image05_mc", "Image05_mc1", 2);
this.Image05_mc1._x = 100;
this.Image05_mc1._y = 100;
};

The same code fails, however, when the mc being called has other movie clips nested within it (ie the mc is comprise of a JPG, a button, and two movie clips):

_root.onEnterFrame = function() {
_root.attachMovie("Comp05_mc", "Comp05_mc1", 3);
this.Comp05_mc1._x = 100;
this.Comp05_mc1._y = 100;
};

In testing, I have set ALL of the elements linkage to export into the first frame. Anyone see an error that they can help me with? Thanks!!!

Eric

Re: Attachmovie stumbling block kglad
1/31/2004 3:13:27 PM
is Comp05_mc1 on the _root timeline or is it a child of a movieclip (like Image05_mc1)? and why are you trying to execute this attachMovie() repeatedly?

Re: Attachmovie stumbling block jarvphot
1/31/2004 5:18:47 PM
Thanks for your help!

The mc is being called from the main timeline. I have no need to call it repeatedly, but I do need to load it into its own level so that when the user clicks on the page it will come to the top for viewing.

Essentially there is a five page menu that displays stacked. When the user clicks to view a page, it should cycle to the top of the stack. I'm just having a difficult time getting the pages loaded initially.

In my first post, I was trying to demonstrate that when I use loadmovie with a simple mc it works; when I use it with a mc that nested mcs in it, it no longer loads.

A stripped down FLA is attached.

Again, thank you.

Eric

http://webforums.macromedia.com/attachments/foodbev1.zip

Re: Attachmovie stumbling block kglad
1/31/2004 6:35:52 PM
you need to instantiate a target movieclip to attach your library movieclip. you didn't do that. you're also using your library/linkage name as an instance name (and as the target movieclip name which doesn't really exist) and so appear confused about these different objects.
anyway, here's a corrected file.

http://webforums.macromedia.com/attachments/foodbev01.zip

Re: Attachmovie stumbling block jarvphot
2/1/2004 4:31:48 AM
Thank you for your effort and for solving my problem. Now I am on to my next learn-as-you-go phase of the project.

Eric

Re: Attachmovie stumbling block kglad
2/1/2004 7:08:02 AM
you're welcome. and good luck!

AddThis Social Bookmark Button