RE: [Flashcoders] DK - destroying objects from a class using arraynotation
Have you tried... this._targetMc.destroyObject(eval("slidemenu.theThumb" + i)); Sometimes I find eval works when [] doesn't. -Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of dnk Sent: Thursday, August 10, 2006 3:07 AM To: Flashcoders mailing list Subject: [Flashcoders] DK - destroying objects from a class using arraynotation Hi there! I have a class in which a few objects are created from my library (loader component instances and a button instance). They were created sequenciually (IE hit0, hit1, hit2, etc) At any rate - I need to destroy them abd then recreate them. I am having some issues finding the proper syntax to use destroyObject For example I tried. (from within my class) function killElements() { for (var i:Number = 0; i < 35; i++) { this._targetMc.destroyObject(slidemenu["theThumb" + i]); this._targetMc.destroyObject(slidemenu["theHit" + i]); } } this obviously does not work My target hierarchy is _root._targetMc.slidemenu (with the button and loader objects created in here). Ideas? Thanks! ___ 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] DK - destroying objects from a class using arraynotation
Andy Stone wrote: Have you tried... this._targetMc.destroyObject(eval("slidemenu.theThumb" + i)); Sometimes I find eval works when [] doesn't. -Andy I have not tried that - I will give it a go in a few hours. Thanks! d ___ 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] DK - destroying objects from a class using arraynotation
If its mx.core.UIObject's destroyObject that you are talking about, destroyObject takes the instanceName of the object, not the instance reference. you'll just have to pass the instance name as a string. So, your code should look somethng like: function killElements() { for (var i:Number = 0; i < 35; i++) { this._targetMc.slidemenu.destroyObject("theThumb" + i); this._targetMc.slidemenu.destroyObject("theHit" + i); } } Hope that helps! ~Arul Prasad http://arulprasad.blogspot.com On 8/10/06, dnk <[EMAIL PROTECTED]> wrote: Andy Stone wrote: > Have you tried... > > this._targetMc.destroyObject(eval("slidemenu.theThumb" + i)); > > > Sometimes I find eval works when [] doesn't. -Andy > > I have not tried that - I will give it a go in a few hours. Thanks! d ___ 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] DK - destroying objects from a class using arraynotation
Arul Prasad M L wrote: If its mx.core.UIObject's destroyObject that you are talking about, destroyObject takes the instanceName of the object, not the instance reference. you'll just have to pass the instance name as a string. I did in fact realize that this morning once I read up more on the destroyObject function. I did get it working (to a point). Now for some reason the command is working to remove my component loader instances, but not my buttons. I think it would be important to mention that my button instances are NOT a component button. They are simply a regular button (transparent) that is attached from the library with a linkage identifiers. So I just need to get them destroyed as well. I suspect there is a different command to do that since they are not components I am searching, but have not yet found out how to... so if anyone knows - it would be appreciated. Thanks in advance! d ___ 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