So I'm new at AS3 and I want my game application to consist of several SWF files to make modifications more easy. So for that I tried to load those other SWF files inside of the main one. To load each of those, I used the code below:
var loading =new Loader();
loading.load(new URLRequest('assets/loader.swf'));
ExtLoader.addChild(loading);
(ExtLoader is a movieclip on the main timeline of the main SWF.) Inside of loader.swf there is a button called 'confirm1' and I want to use it to go to another frame of the main SWF file, so I try this:
loading.content.confirm1.addEventListener(MouseEvent.CLICK, autosavewarning);
function autosavewarning(event:MouseEvent):void
{
gotoAndPlay('AutoSaveWarning');
}
But why like that? Because I want to make sure that you cant load the application without all the external SWF files, I even thought of just loading all of them in a chain to make sure nothing is missing.
It comes up with "Error #1009: Cannot access a property or method of a null object reference." I also tried "rawContent" and "getSWFChild('confirm1')" instead of just "content" but nothing really helped. The external SWF file loads just fine, but pressing the button inside it won't do anything, is there a way for me to access it from the main file?