Re: [Flashcoders] removeChild Question

2010-02-25 Thread John McCormack
Susan, have a look at these examples: http://www.actionscript.org/resources/categories/Tutorials/ http://www.kirupa.com/developer/flash/index.htm http://www.flashandmath.com/ http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/#contents John Susan Day wrote: There is

Re: [Flashcoders] removeChild Question

2010-02-25 Thread Susan Day
Thank you everyone for your replies. Turns out the culprit was that I called a certain function iteratively and I had placed those children in that fn. Therefore, when I removed the children, I presumably only removed the final iteration. So, I took the children out of that loop and they were

Re: [Flashcoders] removeChild Question

2010-02-24 Thread Susan Day
On Tue, Feb 23, 2010 at 2:14 PM, Henrik Andersson he...@henke37.cjb.netwrote: Susan Day wrote: Hi; How do I determine what the parent object is of a child I have added and want to remove? Usually, there is only one possible candidate and you know what that one is ahead of time. But

Re: [Flashcoders] removeChild Question

2010-02-24 Thread Henrik Andersson
Susan Day wrote: Ok, I'm embarrassed, but the following doesn't work: addChild(my_obj); trace(my_obj(parent)); Ok, sounds like you need to learn what a property is. I will leave it up to other people to explain such a fundamental thing. Your error is treating my_obj as a Function. It

Re: [Flashcoders] removeChild Question

2010-02-24 Thread Geografiek
Well, You could at least give a hint as to what _does_ work: trace(my_obj.parent); HTH, Willem On 24-feb-2010, at 13:28, Henrik Andersson wrote: Susan Day wrote: Ok, I'm embarrassed, but the following doesn't work: addChild(my_obj); trace(my_obj(parent)); Ok, sounds like you need to learn

Re: [Flashcoders] removeChild Question

2010-02-24 Thread Susan Day
On Wed, Feb 24, 2010 at 8:28 AM, Henrik Andersson he...@henke37.cjb.netwrote: Susan Day wrote: Ok, I'm embarrassed, but the following doesn't work: addChild(my_obj); trace(my_obj(parent)); Ok, sounds like you need to learn what a property is. I will leave it up to other people to

Re: [Flashcoders] removeChild Question

2010-02-24 Thread Geografiek
Susan, Coming from a non-coders background I learned a lot from Colin Moocks books. Essential ActionScript 3 and Actionscript for Flash MX. (the last one is AS2 but very readable if you want an understanding of concepts like variables, properties, methods, functions, arrays etc.) Also

Re: [Flashcoders] removeChild Question

2010-02-24 Thread Susan Day
On Wed, Feb 24, 2010 at 9:44 AM, Geografiek geograf...@geografiek.nlwrote: Well, You could at least give a hint as to what _does_ work: trace(my_obj.parent); Thanks. That traced out the name of the class/*.as file, but when I put that value in, as in: MyClass.removeChild(my_obj); it throws

Re: [Flashcoders] removeChild Question

2010-02-24 Thread Geografiek
I don't think a class can have children, only instances of classes can. (skating on thin ice now ;-)) Also I don't know by heart all the error codes. So please, if you refer to an error code give the full text. I bet your trace resulted in something like [object, MyClass], litteraly

Re: [Flashcoders] removeChild Question

2010-02-24 Thread John McCormack
Susan, A class is a template - usually written with a capital letter at the start. A class doesn't exist in the memory of the program. It's something you use to define the 'type' of objects you want. Other 'types' might be: int, Number, MyClass, etc. An instance is an object based on that

Re: [Flashcoders] removeChild Question

2010-02-24 Thread Jared
And you wrote addchild(mc) - that's like writing this.addchild(mc). Also parent is a property so mc.parent should always trace, like mc.alpha etc... Hth Sent from my iPhone On Feb 24, 2010, at 8:08 AM, Geografiek geograf...@geografiek.nl wrote: I don't think a class can have children,

Re: [Flashcoders] removeChild Question

2010-02-24 Thread Henrik Andersson
John McCormack wrote: A class is a template - usually written with a capital letter at the start. A class doesn't exist in the memory of the program. If you use addChild(my_obj); you add it to the stage (this is the main program's instance). There are two things here that I have to disagree

Re: [Flashcoders] removeChild Question

2010-02-24 Thread Paul Andrews
Susan Day wrote: On Wed, Feb 24, 2010 at 9:44 AM, Geografiek geograf...@geografiek.nlwrote: Well, You could at least give a hint as to what _does_ work: trace(my_obj.parent); Thanks. That traced out the name of the class/*.as file, but when I put that value in, as in:

Re: [Flashcoders] removeChild Question

2010-02-24 Thread John McCormack
Henrik, I was careless. The code and properties of a class, such as Math and Math.PI, are accessible and you can pass objects, such as the number 0.1 into the class methods, as in Math.sin(0.1), and so there is memory associated with them. It's worth noting that a static property for a class

Re: [Flashcoders] removeChild Question

2010-02-24 Thread Henrik Andersson
John McCormack wrote: I was careless. I am not sure about your objection about the stage. I never mentioned time lines, I assumed Susan was adding to the stage at the start of her program. Can you have a main SWF without a timeline (single frame)? Can you have a program without a stage? What

[Flashcoders] removeChild Question

2010-02-23 Thread Susan Day
Hi; How do I determine what the parent object is of a child I have added and want to remove? TIA, Susan ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] removeChild Question

2010-02-23 Thread Henrik Andersson
Susan Day wrote: Hi; How do I determine what the parent object is of a child I have added and want to remove? Usually, there is only one possible candidate and you know what that one is ahead of time. But there is an embarrassingly simple way: the parent property.