PDA

View Full Version : Easy | Problem loading an MC from the Library into Movie



Obelisk
May 17th, 2003, 09:29 PM
I am trying to do something fairly simple. However right now it is not working for me.

I am trying to load and duplicate a movie contained in the Library. I would like to be able to do so without dragging an instance of it into the desktop. I have gone ahead and made the linkage to javascript under the properties.

Here is my code below:

duplicateMovieClip("menuInstance", n, n*10);

Any help is greatly appreciated

kode
May 17th, 2003, 10:12 PM
use attachMovie instead of duplicateMovieClip. ;)

Obelisk
May 17th, 2003, 11:05 PM
Woot it worked !!!

Thanks for the help... Been staring at my screen too long

kode
May 18th, 2003, 12:07 AM
you're welcome. =)

zephn
May 19th, 2003, 12:29 PM
what is the string to take a movieclip from the library and have it load and play at co-ordinates 0, 0?

Obelisk
May 19th, 2003, 12:33 PM
Here you go


attachMovie("libraryName", "newMC", 2);
setProperty("newMC", _y, 0);
setProperty("newMC", _x, 0);

HTH

zephn
May 19th, 2003, 12:34 PM
thanks

zephn
May 19th, 2003, 12:40 PM
I can't seem to make it work. Below is what I ahve on my button and nothing loads. I presume the 2 represents the layer it loads on?

on(release){
_parent.scaler.target_xscale = 200;
_parent.scaler.target_yscale = 200;

_parent.attachMovie("05-artistic", "newMC", 2);
_parent.setProperty("newMC", _y, 0);
_parent.setProperty("newMC", _x, 0);
}

Obelisk
May 19th, 2003, 12:47 PM
Originally posted by zephn
I can't seem to make it work. Below is what I ahve on my button and nothing loads. I presume the 2 represents the layer it loads on?

on(release){
_parent.scaler.target_xscale = 200;
_parent.scaler.target_yscale = 200;

_parent.attachMovie("05-artistic", "newMC", 2);
_parent.setProperty("newMC", _y, 0);
_parent.setProperty("newMC", _x, 0);
}

Make sure that the movie you are trying to attach has the correct properties ( i.e. has actionscript export enabled.)
To do so right click on the movie in your library, click on linkage, and select export for actionscript. REmember to give it an identifier. In this case it would be 05-artistic.

Also give it a higher depth number 10 instead of 2.

HTH