AttachMovie question

ok…let’s see if I can explain this…
I’m making a game…and I want to change my background image depending on where the character is.

I thought I would make a MovieClip…with all the different background images on different keyframes.

My question is…can I use AttachMovie, and if so…how do I reference the particular frame that I want to…?

I’ve never used AttachMovie before, and wasn’t sure of the syntax…and how to reference it…to go to a particular frame.

Suggestions?

Thanks

Attach movie is used to place objects in the library onto the stage during run time. To use attachMovie with a movie clip you first need to export the movie clip for actionscript. Do this by right clicking the clip in the library and selecting ‘Linkage’ then tick the ‘export for actionscript’ give the clip an id name and click okay.

You can now place that clip on the stage during runtime by putting:


this.attachMovie(IDName, NewName, Depth);

‘this’ is where you are attaching the clip, IDName is the export name you gave the clip and Depth is the level at which the clip is placed. So you might have something like this:


this.attachMovie("BG", "BG", 1);

then to tell it to goto a specific frame:


BG.gotoAndStop(n);

hope this helps (-: