Normally, you would keep the RMCSymbol in your library with the linkage and
class association and not use Object.registerClass. 

If you want to associated your symbol dynamically to a class at run-time you
can use Objec.registerClass("RMCSymbol", RMC); for example. This function
can only set your class association.... It doesn't create a fake symbol in
your run-time library for Flash to instantiate when you do
attachMovie("RMCSymbol", ...).

Creating a fake named linkage'd run-time symbol is done another way. 
But I don't remember it by hearth. Maybe someone else can feed on this one.

Basically, Object.registerClass associates a class (RMC) to a linkage'd
symbol ("RMCSymbol") that "must" exist. 

Hope that helps!
Fredz./

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of de-hack SWF
Sent: November 29, 2005 1:01 AM
To: Flashcoders mailing list
Subject: [Flashcoders] Load/export Symbol in ActionScript

Dear all,

I am new to flash programming, so my question may be silly.

In the first frame of new flash document, I have the code like this.

trace("hello");
var rmc = _root.attachMovie("RMCSymbol", "rmc_1", 2);
trace(rmc);
RMC(rmc).init(100, 200);

Where RMC is a subclass of MovieClip. I created an empty RMCSymbol symbol
make the linkage between RMCSymbol and RMC class in Symbol Properties
dialog, and the swf works. Now, I delete RMCSymbol and try to add the
registration code like


var tmp:RMC;
Object.registerClass("RMCSymbol", RMC);

before the previous code. It does not work as what I had previously and
trace(rmc) prints undefined. Did I miss something here?

Many thanks!

Juguang

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to