Why don't you just attach the class to your movieclip in the library ?
Right-click on the movieclip in the library, click on "linkage",
write a linkage id in the "class" field and write the path to your class in the
"base class" field.
Example
Class : BlueCircle
BaseClass : project.shapes.Circle
You can create an instance of the Blue circle by doing
var blueCircle:BlueCircle = new BlueCircle();
addChild(blueCircle);
your class should look like this
package project.shapes{
import flash.display.MovieClip;
public class Circle extends MovieClip {
public function Circle(){
trace(this);
}
}
}
BLITZ | Patrick Matte - 310-551-0200 x214
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Tremblay
Sent: Wednesday, August 08, 2007 10:22 AM
To: [email protected]
Subject: [Flashcoders] AS3 how to link movieclip manually put on the stage to
class member
Hello group !
Just trying to find the best way to link a movieclip manually put on the
stage to a class member.
Right now this is what I'm doing.
public class A extends MovieClip
{
private var m_mcOnTheStage:MovieClip;
public function A ():void
{
//onthestage_mc is a movieclip manually put in the .fla
m_mcOnTheStage = onthestage_mc;
}
}
Is there a better way?
Martin Tremblay
LVL Studio
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com