Author Message

Posted: Thu May 14, 2015 2:54 pm   Post subject: Error loading local SWFs

I'm receiving the following error when attempting to load a SWF using a snippet of sample code:

Error: The loaded SWF file is not a presentation created with iSpring Pro
   at classes::iSpringTest/onMovieLoaded()[<path>\]
*** Security Sandbox Violation ***
SecurityDomain '<path>/swf/behavior.swf' tried to access incompatible context 'app:/iSpringTest.swf'

The SWF I'm trying to load is stored locally. It was generated using iSpring, and actually loads just fine when using the source FLA provided in samples. I'm also able to compile and execute the provided sample without issue which is why this issue is a little perplexing.

I'm guessing there's something simple & obvious that I'm overlooking.

Here's the actual code I'm running, ripped from one of the samples:
public function iSpringTest() {
   m_loader = new Loader();
         m_loader.contentLoaderInfo.addEventListener(Event.INIT, onMovieLoaded);
   var appDomain:ApplicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
   var context:LoaderContext = new LoaderContext(false, appDomain);
   m_loader.load(new URLRequest(File.applicationDirectory.nativePath + "/swf/behavior.swf"), context);
private function onMovieLoaded(e:Event):void {
   var contentInfo:LoaderInfo = LoaderInfo(;
   m_playerView = contentInfo.content;
   // Query IPresentationPlayerContainer interface of the loaded SWF file
   m_playerContainer = m_playerView as IPresentationPlayerContainer;
   if (m_playerContainer == null)
      // The loaded file is not an iSpring presentation
            throw new Error("The loaded SWF file is not a presentation created with iSpring Pro");
   // Wait for the player to initialize
         //m_playerContainer.addEventListener(PlayerContainerEvent.PLAYER_IS_AVAILABLE, onPlayerAvailable);
   // Add the presentation to stage
   trace("contentInfo: " + contentInfo);
   trace("m_playerView: " + m_playerView);
   trace("m_playerContainer: " + m_playerContainer);

Flash Pro CS6
iSpring Suite DX 7.1.0 (trial)
AIR 17

Looks like this error occurs when using "File.applicationDirectory.nativePath" in the file path. Using a relative path instead seems to be working (i.e. "/swf/movie.swf")

Profile profile test

Posted: Thu May 14, 2015 5:40 pm   Post subject: Re: Error loading local SWFs

Thank you for the post!
I think you can try to add the following code to LoaderContext:

I hope this helps you to resolve the issue.

Profile profile test
Display posts from previous:  Sort by  


Who is online
Who is online In total there are 12 users online :: 1 registered, 0 hidden and 11 guests (based on users active over the past 5 minutes)
Most users ever online was 803 on Sat Dec 12, 2020 9:21 am

Registered users: Bing [Bot]