It's a trick that you can find at the osflash.org web site. Here is the link
: 
http://www.osflash.org/flashcoders/as2#creating_a_class_instance_based_on_mo
vieclip_without_a_symbol_in_the_library

Used it a few times and it's a charm ! :)

HTH

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael
Bedar
Sent: 30 octobre 2006 12:52
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Q:register a movieclip with a class dynamically

I forget who posted this originally, but here's how to create a class that
extends MovieClip without a symbol in the library.

Then you can use attachMovie to create an instance.

> class net.something.MyButton extends MovieClip {
>     public static var symbolName:String 
> ="__Packages.net.something.MyButton";
>     private static var symbolLinked=Object.registerClass (symbolName, 
> MyButton);
>
>     public function MyButton()
>     {
>     }
>
>     // Other implementation goes here...
> }



On Oct 30, 2006, at 12:41 PM, [EMAIL PROTECTED] wrote:

>
> Hi
> I have a pretty basic question concerning registering Movieclips that 
> are created dynamically.
>
> //CODE START
> import com.mydomain.util.MyClass;
> var holder=this.createEmptyMovieClip
> ("_mcRef"+_xPos,this.getNextHighestDepth());
> //CODE END
>
> How do I register 'holder' with MyClass?
>
> Thanks in advance
> Jim Bachalo
>
>
> [e] jbach at bitstream.ca
> [c] 416.668.0034
> [w] www.bitstream.ca
> --------------------------------------------
> "...all improvisation is life in search of a style."
>              - Bruce Mau,'LifeStyle'
> _______________________________________________
> [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


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.17/505 - Release Date: 2006-10-27
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.17/505 - Release Date: 2006-10-27
 

_______________________________________________
[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

Reply via email to