Skip navigation
cablish
Currently Being Moderated

flex4.5 load a flash swf using swfLoader, How to can't run flash swf ActionScript code?

May 14, 2012 1:50 AM

Hi:

     flash swf(sample.swf)  ActionScript code:

 

     Object(this).clickMe.addEventListener(MouseEvent.CLICK,onClickButtonF unc);

 

     function onClickButtonFunc(evt: Event)

     {  

         var obj:Object = this.parent.parent;

         Object(this).dataView.text = obj.document.txtPasswd.text.toString();

     }

 

     flex4.5 Application code:

     <s:Application>

     <s:VGroup>

          <s:SWFLoader source="/sample.swf">

  <s:TextInput id="txtPasswd" text="aaaa"/>

     </s:VGroup>

     </s:Application>

Q:

    Load a contain ActionScript code flash swf using swfLoader in the flex4.5 Application.

    How to can't run  ActionScript code ?

 
Replies
  • Currently Being Moderated
    May 14, 2012 8:06 AM   in reply to cablish

    Your goal is to prevent the AS in the loaded SWF to run?

     
    |
    Mark as:
  • Currently Being Moderated
    May 14, 2012 10:05 PM   in reply to cablish

    If your main SWF is on www.foo.com and you upload to uploads.foo.com, when you load the SWF from uploads.foo.com, it will be loaded in a sandbox.  The actionscript can run, but it cannot access your display objects or code or the stage.  That can cause the SWF to fail if it is not designed to handle being in a sandbox.

     

    There is also an option to set the allowCodeImport option on the LoaderContext, but that might also have side-effects.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points