Insert symbol

for example:

I have a MC named “ab1” in my library. I want to insert that MC into a target named “hole” on release of a button…

In Generator, I would code to insert symbol “ab1” into target “hole”. No problem.

How would I do this in MX syntax?

thanks in advance,

Rev

Make sure your “ab1” in the library is also linked for actionscript if it isnt already (select the clip ion the library and chose ‘linkage’ from the library menu - export to actionscript with an ID name that can just as well be (and is easiest as) its name “ab1”).

Once thats done, you use AttachMovie to actually get it into hole. This is done through the hole clip like so:

hole.attachMovie(ID name, new clip name, depth);

The ID name is the linkage name given to the clip from the library. The new clip name is the instance name that you will use to reference this clip once its been attached and put in hole, and the depth is a number representing its arrangement order on the screen. So if your button is in the same timeline as the hole clip (which I assume it is) you can use

on(release){
hole.attachMovie(“ab1”, “attachedab”, 1);
}

note this will attach the clip at _x =0 and _y = 0. But you can change that immediately after attaching to move it somewhere else…

on(release){
hole.attachMovie(“ab1”, “attachedab”, 1);
hole.attachedab._x = 100;
hole.attachedab._y = 50;
}

as well as any other properties youd want to change.

  • and that face isnt any less creepy :beam:

Thanks a ton Sen…

I think I understand what you have here (I kinda figgerd it was attachmovie, the syntax was giving me fits, as usual), I’ll let you know how I do later on…

In some ways, Gen2 was a lot easier… plus it allowed me to use .png and .gif dynamically (that alone would save me over 8 hours work)…

But I digress, MX is here to stay, Gen2 is gone(-:

AND:

I think he’s kinda cute… poor kid…

Rev

Thanks Sen!

I brought you a gift…

click here if you want to see it in action (custom art) …

thanks again,

Rev