Hi I have an actionscript file which is displaying a button. I want to remove the button from my display. So i need to make changes to the actionscript code and generate a new SWF file after doin the changes.
Can anyone kindly help me regarding how to generate an SWF file from an actionscript file.
Thanks In Advance.
If you still have the problem and need a quick solution, then instead of "changing the actionscript code and generate a new SWF", you can try to do a workaround.
Embed the swf file with the button in a new flash project: for this use the Embed metatag and embed the file as a ByteArray then load it to a Loader object.
[Embed(source="filename-of-swf-with-button", mimeType="application/octet-stream")]
var class1:Class;
var ldr:Loader = new Loader();
ldr.loadBytes(new class1());
After this you can reach the "swf's" content by ldr.content
.
There you go, if you know the name of the instance, make it invisible or remove it from the displaylist. If you don't know the name, then try to find it the hard way:
for(var i:int = 0; i < ldr.content.numChildren; i++)
{
trace(ldr.content.getChildAt(i).name);
}
and after the search, pick the button instance.