I recommend using the Event.INIT instead of the Event.COMPLETE. INIT gets trigger after the load is COMPLETE and the all the classes/instances in the loaded swf are initialized and ready to use.
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, handleInit);
addChild(loader);
function handleInit(e:Event):void{
var as2Movie:AVM1Movie = e.target.content as AVM1Movie;
}
You can access the loaded content through the content property of the Loader class.
Not that since you're loading an as2 movie into an as3 movie, some restrictions apply:
"AVM1Movie is a simple class that represents AVM1 movie clips, which use ActionScript 1.0 or 2.0. (AVM1 is the ActionScript virtual machine used to run ActionScript 1.0 and 2.0. AVM2 is the ActionScript virtual machine used to run ActionScript 3.0.) When a Flash Player 8, or older, SWF file is loaded by a Loader object, an AVM1Movie object is created. The AVM1Movie object can use methods and properties inherited from the DisplayObject class (such as x, y, width, and so on). However, no interoperability (such as calling methods or using parameters) between the AVM1Movie object and AVM2 objects is allowed.
There are several restrictions on an AVM1 SWF file loaded by an AVM2 SWF file:
The loaded AVM1Movie object operates as a psuedo-root object for the AVM1 SWF file and all AVM1 SWF files loaded by it (as if the ActionScript 1.0 lockroot property were set to true). The AVM1 movie is always the top of any ActionScript 1.0 or 2.0 code execution in any children. The _root property for loaded children is always this AVM1 SWF file, unless the lockroot property is set in a loaded AVM1 SWF file.
The AVM1 content cannot load files into levels. For example, it cannot load files by calling loadMovieNum("url", levelNum).
The AVM1 SWF file that is loaded by an AVM2 SWF file cannot load another SWF file into this. That is, it cannot load another SWF file over itself. However, child Sprite objects, MovieClip objects, or other AVM1 SWF files loaded by this SWF file can load into this."From as3 docs.
For more info see the AMV1Movie Reference.
If you want to call as2 movies from as3 you will need to use Local Connection to establish communcation between the 2 swfs.
Grant Skinner wrote a handy thing called SWF Bridge for this kind of situation(easy as2 to as3 communication). It's worth a try.
Goodluck!
Assuming you're creating a button in the IDE:
Because the button "down" state is only registered while its actually "down", you'd need to associate a movieclip outside of the button that is triggered on mouse down.
someButton.addEventListener(MouseEvent.MOUSE_DOWN, runClip);
private function runClip(e:MouseEvent):void
{
_downClip.play();
}
You'd need to position it accurately, or wrap it up in another symbol.
...
Or better yet, program the whole thing in AS3 and get away from timeline development...
update -
I don't have any preferred tutorials or sites for this, in particular. But just google "as3 button tutorial" and you should get a lot of hits... this one looks pretty complete.
Oh, wait - I think I posted a class for a basic image button that could be easily altered to function with movieclips from the library... yep, its right here. The basic idea should be fairly clear if you have any experience with as3 / object oriented programming. And if its not - google away ;)
Cheers
Best Answer
There are several reasons why this won't work, but the essential one is that frames don't exist at runtime the way you're trying to access them. Frames are an author-time concept - when you put certain contents on frame 1 and different contents on frame 2, at runtime Flash does not keep track of different sets of children for each frame. What's compiled into the SWF is merely instructions that certain children should be automatically added or removed when traversing from frame 1 to 2, or vice versa.
If you simply want a second copy of a given MC, that plays through the same animations as the first, what you rather need to do is to duplicate the object itself. In AS2 you could have done with with the duplicateMovieClip() API, but unfortunately AS3 has no equivalent command. Instead, you have to create a new instance of the clip you want to duplicate, with code of this form:
Note that this will not work unless the object you're trying to duplicate (this.content.swf) was attached to a class (i.e. the "export for ActionScript" check box was selected) when it was published. If it wasn't, then so far as I know there is no way to duplicate it in AS3. If this is the case, I think the best you can do is a workaround - for example, instead of creating a duplicate of the clip, you could create a Bitmap, and every frame simply render the appearance of the original clip into a BitmapData, and paint that data into the "duplicate" Bitmap.