is it posible to load an away.swf file into another file.swf??

Software: Away3D 4.x

charlito, Jr. Member
Posted: 23 May 2012 11:31 PM   Total Posts: 36

i have a simple code for loading externals swf into a new swf..
but with away3d swf’s i’ve been unable to..

public function startload():void
 {
 
var mLoader:Loader = new Loader();
         var 
mRequest:URLRequest = new     URLRequest("../assets/Testaway.swf");
            
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETEonCompleteHandler);
            
mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESSonProgressHandler);
            
mLoader.load(mRequest);
  
}
  
public function onCompleteHandler(loadEvent:Event):void
        {
            addChild
(loadEvent.currentTarget.content);
        
}
       
public function onProgressHandler(mProgress:ProgressEvent):void
        { 
            
var percent:Number mProgress.bytesLoaded/mProgress.bytesTotal;
            
//trace(percent);
        


any ideas??
can this be done??

   

ASWC, Member
Posted: 24 May 2012 02:10 AM   Total Posts: 76   [ # 1 ]

‘i’ve been unable to’ is not really a proper way to refer to a coding problem. What is the problem? Do you get errors? If yes what are those errors? etc ...

   

charlito, Jr. Member
Posted: 24 May 2012 03:21 AM   Total Posts: 36   [ # 2 ]

thx for ur answare..

it throws this error..

SecurityError: Error #2070: Security sandbox violation: caller file:///C|/temp/pepsi_loader/assets/Testaway.swf cannot access Stage owned by file:///C|/temp/pepsi_loader/bin/pepsiloader.swf.

but what makes me think its a stage3d problem, is that if i change the
URLRequest(”../assets/Testaway.swf”);
for another flash 10.0 swf file.. it totally works…

so i wonder if anyone has ever done it…

thx a lot..  smile

   

ASWC, Member
Posted: 24 May 2012 04:37 AM   Total Posts: 76   [ # 3 ]

Then pass a LoaderContext to your loader.

   

charlito, Jr. Member
Posted: 24 May 2012 05:39 PM   Total Posts: 36   [ # 4 ]

thx a lot for ur suggestion.. i didnt know about the loadercontext method..

although still i cant run the swf from away3d into another swf.
i used the loadercontext method.. with no result..

public function startload():void
  {
   
var mLoader:Loader = new Loader();
            var 
mRequest:URLRequest = new URLRequest("../assets/Testaway.swf");
   var 
contexto:LoaderContext = new LoaderContext();
   
contexto.allowCodeImport true;
   
contexto.checkPolicyFile false;

   
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETEonCompleteHandler);
            
mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESSonProgressHandler);
   
            
mLoader.load(mRequest,contexto);
  

still throws this error:

SecurityDomain 'file:///C|/temp/pepsi_loader/assets/Testaway.swf' tried to access incompatible context 'file:///C|/temp/pepsi_loader/bin/pepsiloader.swf'
[Fault] exceptioninformation=SecurityErrorError #2070: Security sandbox violation: caller file:///C|/temp/pepsi_loader/assets/Testaway.swf cannot access Stage owned by file:///C|/temp/pepsi_loader 

so.. does anyone has ever load an away3d.swf into a diferent swf??

i’m using flash player 11.2 for both swfs…

thx a lot..  smile

   

Karim Beyrouti, Administrator
Posted: 17 December 2013 03:04 PM   Total Posts: 30   [ # 5 ]

Hello Charlito ! Wondering if you ever sorted this one out ?.. and if you did what your solution was ? ...

Thank you .

   

Avatar
alihm, Jr. Member
Posted: 05 January 2014 11:46 AM   Total Posts: 49   [ # 6 ]

Hi,
I’ve had no problem loading away3d swf’s into another swf file.
Same code as yours(first one), both files were compiled on the same machine using FlashCS6 IDE, both 11.2, both in the same directory.

hope it helps.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X