[osflash] Q:Basic AS3 MVC question

moveup at mac.com moveup at mac.com
Fri Oct 17 04:56:45 PDT 2008



Most examples of MVC I've seen assume you first instantiate your view passing the model as a reference and then add the view to the display list. This is usually done in Main or the document class for the application.

But what's the best way of setting up your initial dispatcher-listener relationship between your model and views if the view(say a MovieClip)  is ALREADY on the stage(been manually authored), or is actually contained in a swf that you are loading at runtime?

In AS2 my experience has been that it was necessary to set up a 'polling' function in your view class constructor, that ensured the view class and any of it's children were fully instantiated BEFORE you could successfully set up the dispatcher listener relationship with the model. 





[f] www.flickr.com/photos/bitstream
[c] 416.668.0034
[w] www.bitstream.ca
--------------------------------------------
"...all improvisation is life in search of a style."
             - Bruce Mau,'LifeStyle'



More information about the osflash mailing list