puremvc
|
 |
« Reply #1 on: November 13, 2007, 07:57:38 » |
|
Sounds like you just need to be able to specify the completion notification to be sent at runtime. Also, I'm assuming BasicLoader extends Proxy or Notifier since it sends notifications. Try this:
Give the BasicLoader a private property called completeNotification:String, inherited by XMLLoader and SWFLoader.
Also add a constructor parameter to BasicLoader of the same name and type.
When the XMLLoader or SWFLoader are constructed, pass in the unique notification name you wish that class to send when its onLoadComplete method is called.
var xmlLoader:XMLLoader = new XMLLoader(..., ApplicationFacade.MY_COMPLETE_NOTE);
Inside the BasicLoader constructor:
... this.completionNotification = completionNotification; ...
Then inside onLoadComplete of the BasicLoader, simply send the completeNotification instead of a literal string.
... sendNotification(this.completionNotification); ...
If sending the notification was all the onLoadComplete methods did, then remove them from the subclasses, as they are no longer needed.
Otherwise call super.onLoadComplete(event) at the end of your subclass onLoadComplete method to be sure the notification is sent.
-=Cliff>
|