Skip to main content
Participant
February 17, 2014
Question

How to load external SWF used sharing library.

  • February 17, 2014
  • 0 replies
  • 245 views

Hi~~~

Before ask the question, plz understand my bad English..

Recently I try to load the Swf file that is maded by Flash CS 6.0.

Especially it used shared library..

When I try to load this SWF, I used FileStream instead URLRequest.

This is because the target SWF File located same device with the Swf Application.. So when I use the URLRequest

it give me the warning - Sandbox security violation.

But by using FileStream, the warning did not occur.

This is the sample code below..

  var myFile = new File(path);

  var myStream = new FileStream();

  myStream.open(myFile, FileMode.READ;

  var myBytes:ByteArray = new ByteArray();

  myStream.readBytes( myBytes );

   mSwfLoader.loadBytes( fileStream, context );

  

   mSwfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadedComplete);

As you can see, I made a event listener to get the content of the Loader, after receving Complete Event(I guess.. after decording?).

But I can't receive any event call, so I removed symbol used sharing library in the SWF.

And this gave me the result as I respected... So I guess the problem caused by using sharing Library..!

(In parenthease, I can see the valid result in running debug time on the Flash CS6..)

What should I do? I respect that using sharing libary give saving memory.  So I want to using it as possible.

Thanks for your reading...!

This topic has been closed for replies.