On 09/06/04 7:12 pm, in article ca7jv1$5o9$1@forums.macromedia.com, "Lumber
[quoted text, click to view] Jack" <webforumsuser@macromedia.com> wrote:
> Cannot get AttachMovie to work
>
> Can somone supply or point me to a BASIC code example of how to implement
> AttachMovie command.
>
> I tried the Flash reference example without success.
Draw a shape on stage. Make it into a new movieclip (Modify > Convert to
symbol).
Delete it from the stage.
Find the new clip in the Library, right-click it (or ctrl-click if you're on
a Mac) and select 'Linkage' from the context menu.
Check 'Export for ActionScript' and 'Export in first frame', and enter a
name in the 'Identifier' field. Let's say you call it 'myThingID'.
Click on an empty frame on the main timeline, then write the following in
the Actions panel:
_root.attachMovie("myThingID","myNewThing",1);
The first word (_root) means that the movieclip wil be attached to the root
timeline. If you want it attached to another instance of a movieclip, then
use that name here.
The first string inside parentheses (myThingID) is a referene to the linkage
name of the movieclip you want to attach. The second is the new name for the
instance you're creating with attachMovie. The number at the end is the
level at which the new instance will be created.
Once you've created it you can start manipulating its properties:
myNewThing._x = 100;
myNewThing._y = 150; // etc.
--
Robin Nicholl
studioalias