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 ?
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.
North America
Europe, Middle East and Africa
Asia Pacific