mardi 14 juin 2016

How does AS3's addChild works?

I'm aware that addChild (1) adds the object into a display container object, and (2) shows the object in the DisplayObjectContainer. What I want to know is what happens when an object is added into a DisplayObjectContainer?

To summarize my question is (are),

  1. Is there any magic happens when addChild invoked? i.e. Something is happening in, for example, DisplayObjectContainer.
  2. Let's say, I have MovieClip A and B. B has A as part of it. I called addChild (A) in B. In MainTimeline and Stage, I don't call addChild (B). Visually, since B hasn't been added, A won't be there too. However, does A is exist (e.g. the memory allocated), even though it's not on the Stage?

I have searched here and there in SO, but humongous amount of the questions asked related to mine are technical. I greatly appreciate any answer or pointer regarding my questions

Aucun commentaire:

Enregistrer un commentaire