Re: [Flashcoders] Singleton class inside SWC components?
I'm confused. You said: However as soon as I compile them into an SWC and add more than one of the same component onto the stage they all end up using the same instance of that class. Isn't that the definition of a Singleton? Something where only a single instance ever exists (so they'd all use the same instance). I don't really understand what you're trying to do. -Andy On 1/19/07, Wade Arnold [EMAIL PROTECTED] wrote: I am working on a Flash 8 project that has several components. Each of the components has a reference to a singleton class that it uses for passing messages between each other. Before I compile the components into SWC files I can use SingltonClass.getInstance().getMyInformation(). This works great and I can copy as many instances from the library I want and get the desired result However as soon as I compile them into an SWC and add more than one of the same component onto the stage they all end up using the same instance of that class. Has anyone seen this? Can anyone explain how I can have my compiled SWC components work like they do when they are just fla's in the library? Is there a special way to build swc components other than right click and export to SWC from the library in order to get this to work properly amongst several components? Thanks for your help! Wade ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
Re: [Flashcoders] Singleton class inside SWC components?
Each of the components has a reference to a singleton class that it uses for passing messages between each other. Thats exactly what is happening, correct - what you intended. If each instance component used a different instance of your singleton - how would they communicate to one another? ? ___ Flashcoders@chattyfig.figleaf.com 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
RE: [Flashcoders] Singleton class inside SWC components?
I tried to recreate my problem in a simple example. Unfortunitly/Fortunitly the problem only exists in my project and not a simple singleton counter with EventDispatcher. So time to go back to my code. Thanks for the help. Wade -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of eric dolecki Sent: Friday, January 19, 2007 10:16 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Singleton class inside SWC components? Each of the components has a reference to a singleton class that it uses for passing messages between each other. Thats exactly what is happening, correct - what you intended. If each instance component used a different instance of your singleton - how would they communicate to one another? ? ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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