If you are loading it to another AS3 SWF, yes, you can access the public properties of the loaded SWF. You cannot replace functions - you can call functions, public ones, that is.
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoad);
ldr.load(new URLRequest("filename.swf"));
private function onLoad(e:Event):void
{
var swf:Object = LoaderInfo(e.target).content;
swf.somePublicVar = newValue;
swf.somePublicObject.publicMethod();
swf.getChildAt(0).x = 30;
//assuming there is a sprite at index 1
var child:Sprite = Sprite(swf.getChildAt(1));
child.graphics.lineStyle(1);
child.graphics.drawCircle(10, 10, 10);
}
If you are loading 3rd party SWF from another domain (instead of copying it to your domain and loading it from there), the following rule apply
- If the loaded content is a SWF file written with ActionScript 3.0, it cannot be cross-scripted by a SWF file in another security sandbox unless that cross-scripting arrangement was approved through a call to the Security.allowDomain() or the
Security.allowInsecureDomain()
method in the loaded content file.
Which in short means that unless the SWF creator has explicitly allowed it to be modified from your domain, you cannot modify it by loading it remotely. This doesn't apply if you can get the SWF copied to your domain.