Stefan Yotov
unread,Apr 24, 2007, 2:45:12 PM4/24/07Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gug...@googlegroups.com
Hi Koojav,
Here is some sample code for registering lazy attach sections from the scope of SectionsController:
var mc : MovieClip = mSectionsContainer.attachMovie("SectionAttacher", aInstanceName, mSectionsContainer.getNextHighestDepth
());
var sectionAttacher : SectionAttacher = SectionAttacher(mc);
registerLazyAttachSection(sectionAttacher, "[section symbol id in the library]", "[section id]", true);
The mSectionsContainer can be a movie clip from the SectionsController or the controller itself.
SectionAttacher is an ITask which attaches a section from the library on the stage and then
starts its initialization. When the section is initialized the SectionAttacher completes.
The purpose of SectionAttacher is to provide ISectionLoader implementation for attaching lazy sections. We were motivated to create ISectionLoader in order to load different lazy sections in a similar fashion.
To allow that the ISectionLoader defines events "sectionAvailable", "sectionUIInitialized", "sectionInitialized" and method unloadData.
An example of such a polymorphic usage exists in the SectionsTransition. When the SectionsTransition has to open a lazy section it uses ISectionLoader. When the ISectionLoader dispatches "sectionUIInitialized" the SectionsTransitions starts to monitor initialization progress of the Section no matter if it is an external swf or just a library symbol. In fact during most of the time the SectionsTransition doesn't know the class of the section loader, which resulted in easier implementation and flexible transition.
We hope that the sample code helps and stay open for any other questions.
Sincerely,
Gugga Team