A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: In panic - Flex Builder 3 Beta 2 sandbox violation error

  1. #1
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90

    In panic - Flex Builder 3 Beta 2 sandbox violation error

    Until today, i've been using FB 3 Beta 1 but now i am forced to use Beta 2 since Beta 1 release expired today. I was working on the project which consists of HorizontalList in which i load images from remore url. Today i opened project in Flex 3 Beta 2 and got following error:

    Code:
    Main Thread (Suspended: SecurityError: Error #2122: Security sandbox violation: Loader.content: http://localhost/Diplomski/bin/smile_on.swf cannot access http://www.sabljic-apartment.com/Smil/Shared/copyright.gif. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.)	
    	flash.display::Loader/get content [no source]	
    	mx.controls::SWFLoader/get content	
    	mx.controls::SWFLoader/notifyStyleChangeInChildren	
    	mx.core::UIComponent/notifyStyleChangeInChildren	
    	mx.core::UIComponent/notifyStyleChangeInChildren	
    	mx.core::UIComponent/setStyle	
    	mx.states::SetStyle/apply	
    	mx.core::UIComponent/mx.core:UIComponent::applyState	
    	mx.core::UIComponent/mx.core:UIComponent::commitCurrentState	
    	mx.core::UIComponent/setCurrentState	
    	mx.core::UIComponent/set currentState	
    	smile_on/menuCreatorItemClicked	
    	smile_on/__imageList_itemClick	
    	flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction [no source]	
    	flash.events::EventDispatcher/dispatchEvent [no source]	
    	mx.core::UIComponent/dispatchEvent	
    	mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::mouseClickHandler
    'smile_on.swf' is my application and 'http://www.sabljic-apartment.com/Smil/Shared/copyright.gif' is remote image that is loading in HorizontalList control. Image is loaded and displayed fine but i get above error after i click on it.

    This application worked without any problems while i was using Flex Builder Beta 1 so i am in big trouble now and starting to panic. Can anyone help me with this error, how can i get rid of it?

    thanks in advance

  2. #2
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90
    I got the following reply at flexcoders list regarding my problem:

    Code:
    That's a bug in the beta. A workaround is to subclass SWFLoader,
    override notifyStyleChangeInChildren and regenerateStyleCache and have
    them just return w/o doing anything.
    So i guess that's something that can be solved but since i am no Flex expert, I don't know how the heck can i do that? I mean how can i "subclass SWFLoader and override notifyStyleChangeInChildren and regenerateStyleCache to have them just return w/o doing anything"? Can someone please be kind enough to explain this to me a little bit further?

    thanks in advance

  3. #3
    OOP is one letter from OOPS kortex's Avatar
    Join Date
    Aug 2005
    Location
    New Hope, PA
    Posts
    2,668
    package{
    class SWFLoaderBugFix extends SWFLoader{
    public override function notifyStyleChangeInChildren ():void{}
    public override function regenerateStyleCache ():void{}
    }
    }
    Jeremy Wischusen
    Flash - Flex - LAMP - Web Developer Purple Inc
    AS OOP FAQ-Best Practices Thread | Flashkit OOP Tutorials | Purple Inc (day job) | Blog


  4. #4
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90
    First of all i'd like to thank you for your time and help, i really appreciate it. I have one more question though if it's not too much to ask. The thing is that all of my code which basically consists of few methods structured in my main .mxml file inside <mx:Script> tags like this:

    Code:
    <mx:Script>
    <![CDATA[
    
    ...                     
    ...
    
    public function Function1():void{
    //do something
    }
    
    
    public function Function2():void{
    //do something
    }
    
    ...
    ...
    
    ]]>
    </mx:Script>
    And theese methods are called depending on various component events like "click" or something like that. So i don't know how to combine the OOP code you posted above with my "procedural" code since i am not using classes? Would it be enough to put the code you posted inside external .as file and use "include" statement in my main .mxml like this:

    Code:
    <mx:Script>
    <![CDATA[
    
    ...                     
    ...
    
    include "yourCode.as";
    
    public function Function1():void{
    //do something
    }
    
    
    public function Function2():void{
    //do something
    }
    
    ...
    ...
    
    ]]>
    </mx:Script>
    Or i have to do something else?

    thank you very much
    Last edited by blu3; 11-01-2007 at 05:15 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center