Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>you can instantiate objects without assigning them to a variable ... instead of storing a reference to an object in a variable, you can directly pass it to a function, as argument, or you can pass some other object as a parameter to the constructor, that'll allow the object to register it self elsewhere ... for example, this code will work perfectly:</p> <pre><code>(new URLLoader(new URLRequest("someURL"))).addEventListener(Event.COMPLETE, someEventHandler); </code></pre> <p>this code instantiates 2 objects, none of which is stored into a variable ...</p> <p>so instantiation has nothing to do with variables at all, which is, why the "first step" is not a part of an instantiation process ... instantiation of an object is <code>new SomeClass(someParam_1,...someParam_n)</code> ...</p> <p>and as Epskampie pointed out, the "third step" is also not a part of instantiation, because it only works with <code>DisplayObject</code>s ... it is not "instantiating on the stage", it is "putting them on the display list" ... also, most of the time, you put them into (grand)children of the stage, rather than the stage itself ... you may also simply decide not to put a <code>DisplayObject</code> on the display list (there are several scenarios, where that makes sense) ...</p> <p>so yeah, i would not talk about "layers" ... what you describe is a possible approach of creating a <code>DisplayObject</code> on the display list, that consists of 3 "steps" (the first being optional), but not "layers" ... and there is no analogy to MVC ... flash <code>DisplayObject</code>s are the base for creating a view ... MVC in ActionScript works pretty much as in any other language ... you create model, controller and view objects as you would in any other language ... instantiation is the same for all, but for the latter, it requires an extra step, to display them ...</p> <p>hope that helps ...</p> <p>greetz</p> <p>back2dos</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload