Skip to main content
February 11, 2010
Answered

Using one instance of a Movie Clip to load Graphics from library

  • February 11, 2010
  • 1 reply
  • 1285 views

Hi all,

another question... How would i go about loading a variable into a movie clip and have it pull different graphics from my library at different spots in the main timeline???

thanks!

Patrick

This topic has been closed for replies.
Correct answer Ned Murphy

Hi Ned... sorry to keep bothering you...

i still cannot get it to work.. does it only work in AS3??

I attached the file

thanks,.

Pat


attachMovie is AS2 code, it does not exist in AS3.  Below is a link to a sample I made for you with the code from ealrier, dig in and see what you missed.  I cannot open your file which means you are probably using CS4.

http://www.nedwebs.com/Flash/AS2_attach.fla

1 reply

Ned Murphy
Legend
February 11, 2010

You may need to explain this with more detail.  What do you mean by "loading a variable into a movie clip"?  You cannot load graphic symbols from the library, only objects that can have linkage ID's assigned, such as movieclip symbols.

To load anything from the library in AS2 you use the attachMovie() method and assign linkage ID's to the objects in the library.  If you look that up you may get some idea on where to start.

February 11, 2010

Hi Ned. i tried this:

on Load

{

mc_LCD.attachMovie("graphic", "g", 1);
g._x = 200;
g._y = 200;

}

where "graphic" is the linkage name of mc_LCD and "g" is the name of the graphic that i want to load into the clip... not sure i am doing this right...

Ned Murphy
Legend
February 11, 2010

First, get rid of the onLoad elements for now, and just try...

mc_LCD.attachMovie("graphic", "g", 1);
mc_LCD.g._x = 200;
mc_LCD.g._y = 200;

When you add g into the movieclip, you need to target it via the movieclip