Reply
Visitor
Alex
Posts: 5
Registered: ‎01-23-2009
0 Kudos
Accepted Solution

SWL Loader / Templates ready

I have some problems to get access to the modules after i load my swf with the BEML Swf loader.

 

I used the setInterface function as described in your online documentation and add die LIsteners  "templateready" for the player and the experience module. But sometimes the Events will be fired but sometimes not, that means my further code will be executed irregulary. 

 

Is there any workaround for this?

 

Alex

Brightcove Team
BC-Ashley
Posts: 84
Registered: ‎12-06-2008

Re: SWL Loader / Templates ready

[ Edited ]

Hi --

 

Can you let me know what your setInterface() function looks like?  It sounds like you might need to check to see if the 'templateReady' event has already been fired or not.  Your method body should look like:

 

 

public function setInterface(player:Object):void { mPlayer = player; var exp:Object = mPlayer.getModule("experience"); var module:Object = mPlayer.getModule("experience"); if (module.getReady()) { init(); } else { module.addEventListener("templateReady", onTemplateReady); } } private function onTemplateReady(event:Event):void { var module:Object = mPlayer.getModule("experience"); module.removeEventListener("templateReady", onTemplateReady); init(); }

 


 

 

 

Where init() is the main method to begin interacting with the player.

 

 

HTH.

 

ashley

Message Edited by BC-Ashley on 01-23-2009 01:16 PM