0

I am trying to use the mxml swfloader component to load the external flash from the following url, but it doesn't load anything. I'm using FlashBuilder 4.5.

http://somesite.com/en/interface.swf?token=123

I have no idea why it isn't working.

chobo
  • 31,561
  • 38
  • 123
  • 191

3 Answers3

2

My guess is that you have a Sandbox Security violation. You can't load a swf from another domain/port without having a crossdomain xml.

J_A_X
  • 12,857
  • 1
  • 25
  • 31
  • Is there no error saying that a violation took place? I just see a blank browser window. – chobo Jul 06 '11 at 22:07
  • I believe it should tell you, but you need to have Flash Player Debug installed. Might be why you saw a white screen because the error could stop anything else from running. – J_A_X Jul 07 '11 at 13:18
  • I have the debug player and see those error screens in other instances. Still having issues with this. I tried the suggestion below to use the allowDomain and still nothing. – chobo Jul 07 '11 at 16:49
  • Do you have a crossdomain.xml on the domain you're trying to access? In this case, you should have a crossdomain at http://chp.utv.x18.devtstsite.com:13000/crossdomain.xml – J_A_X Jul 07 '11 at 16:54
  • They claim to have one setup with wildcard mapping as well – chobo Jul 07 '11 at 19:42
  • 1
    I just tried it myself. Used SWFLoader to load that url exactly and specified `Security.allowDomain('*')` in the preinitialize. It does it load, however, it's not being displayed because the SWF you're trying to load was created using AS1 or AS2 code and returns an [AVM1Movie](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/AVM1Movie.html) which doesn't let Flex talk to it (because Flex is AVM2) and Flex isn't frame based and this definitely is. Essentially, the SWF they've provided is utter crap, and old as all hell. They need an update. – J_A_X Jul 07 '11 at 20:08
  • You in fact can load and display AVM1 movies using the flex swf loader control, or loader class, but their are two problems with the file I am trying to load. The first is that it is modular, so when I try and load it, it loads additional swf's into it, and those ones load a few in them. The second problem is I am using a link that redirects to the swf I am supposed to load. – chobo Jul 22 '11 at 23:24
  • Yes, you can load AVM1Movies, as mentioned above since it *did* load using SWFLoader. However, this is not 'modular', at least not in the Flex sense of modules since modules don't exist in Actionscript per say. It could be that your 'module' isn't loading the other ones because the code within it is flawed or trying to access it through another domain or port causing a sandbox issue. – J_A_X Jul 24 '11 at 12:34
  • I meant modular design i.e they broke up their swf into separate swf's or whatever you want to call them for easier code reuse and maintainability. – chobo Jul 24 '11 at 23:19
1

if swf is from another domain, u should probably add into your code

System.security.allowDomain("domain");

Senad Meškin
  • 13,597
  • 4
  • 37
  • 55
0

The flash being loaded loads additional flash files into it using relative paths. A change to absolute paths should fix this

chobo
  • 31,561
  • 38
  • 123
  • 191