Skip to main content
June 10, 2013
Answered

Flash as2 cross domain issue to access the swf file from another server

  • June 10, 2013
  • 1 reply
  • 608 views

I have cross domain issue, How can I access the .swf file from another swf without using System.Security.allowdomain() in the swf which we are called.

I'm using 2 domains and I have 2 swf files one is from a.com(a.swf) and another one is from b.com(b.swf) I want to access the frames of the b.swf file from the a.swf, If I'm using the System.Security.allowdomain() in the b.swf file I can access the frames. But without using this How can I access the file from another domain.

Because I have a risk to change the b.swf file so I vant to access without changing the b.swf file Is any other wey to access the frames of b.swf file from a.swf file. Please someone help me to solve this issue.

This topic has been closed for replies.
Correct answer kglad

use a local executable (like php) to load the b.swf and return it to a.swf.  for example:

loadSWF.php:

<?

$fh = fopen("www.b.com/b.swf","r");

header("Content-type: application/x-shockwave-flash");

fpassthru($fh);

?>

a.fla:

var target_mc:MovieClip=this.createEmptyMovieClip("target_mc",this.getNextHighestDepth());

target_mc.loadMovie("loadSWF.php");

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 10, 2013

use a local executable (like php) to load the b.swf and return it to a.swf.  for example:

loadSWF.php:

<?

$fh = fopen("www.b.com/b.swf","r");

header("Content-type: application/x-shockwave-flash");

fpassthru($fh);

?>

a.fla:

var target_mc:MovieClip=this.createEmptyMovieClip("target_mc",this.getNextHighestDepth());

target_mc.loadMovie("loadSWF.php");