views:

231

answers:

2

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 PurePlayer 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

A: 

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)" 
  />
Lars
Sorry I am new to StackOverFlow - now I think I shouldn't have edited it...I tried this approach as well but did not work...
sami
The code is now as follows: <mx:SWFLoader id="mapLoader" width="100%" height="100%" source="../bin-debug/PurePlayer.swf?panorama=../bin-debug/untitled.ivp" />Still no luck... I don't get a "File not found" error from the SWF applet but only a blank screen - I think the last poster here had the same prob:http://www.actionscript.org/forums/showthread.php3?t=175951
sami
You may need to encode the URL for the panorama parameter. Heres an example that works, having encoded the URL http://www.husar.us/blog/panos/statueBig.ivp with encodeURIComponent("http://www.husar.us/blog/panos/statueBig.ivp"):http://www.husar.us/blog/panos/PurePlayer.swf?panorama=http%3A%2F%2Fwww.husar.us%2Fblog%2Fpanos%2FstatueBig.ivp
Lars
A: 

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 )

joker
thanks, will try this out
sami