Error loading local SWFs
Author | Message |
Issue Code: Error: The loaded SWF file is not a presentation created with iSpring Pro at classes::iSpringTest/onMovieLoaded()[<path>\iSpringTest.as:54] *** 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: Code: 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(e.target); 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 addChild(m_playerView); trace("contentInfo: " + contentInfo); trace("m_playerView: " + m_playerView); trace("m_playerContainer: " + m_playerContainer); } Environment Flash Pro CS6 iSpring Suite DX 7.1.0 (trial) AIR 17 Update: 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")
|
Thank you for the post!
|
||||
|
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] |