开发者

Set flashvars of a SWF in Flex before loadComplete

I have a Flash applet which I want to embed in a Flex file this loads a panorama file inside a SWF player (Immervision's PurePlayer)- I am using the following code:

<mx:SWFLoader id="mapLoader" 
    width="740" 
    height="588" 
    source="../bin-debug/PurePlayer.swf?flashvars='panorama=../bin-debug/untitled.ivp'" />

The applet loads fine but it is does not execute the file...

The PurePlaye开发者_运维知识库r documentation uses the following var: panorama=myPano.ivp"

If I load the same SWF via a browser window it works fine with the following URL: http://localhost/pureplayer/PurePlayer.swf?panorama=untitled.ivp


Have you tried playing the movie after in your complete handler

// Play it
Object(mapLoader.content).play();

You also might also consider listening for an event once your movie has completed playing or when based user interaction takes place in your Flash app by adding adding an event handler in your Flex application in the complete handler before you play it. You obviously will need to know the type of the event the Flash App is going to dispatch but if bot applications are yours that should be no problem.

mapLoader.content.addEventListener( "yourFlashEvent", handleYourFlashEvent )


You can provide the panorama parameter in the URL to swf file, instead of as a flashvar, like this:

<mx:SWFLoader id="swfLoaderPure"
  width="100%" height="100%"
  source="../bin-debug/PurePlayer.swf?panorama=myPano.ivp" 
  complete="onLoadComplete(event)" 
  />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜