I have a preloader.fla(swf) file; when loading is complete the Portfolio.fla(swf) displays.
The preloader.fla worked fine up until I attached a file called MyContent.as to the Portfolio.fla file. Now I'm getting an error message when I preview the preloader.fla that says:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MyContent/init()
at MyContent()
How do I correct this so the Portfolio.swf page displays?
/***preloader.fla***/ var l:Loader = new Loader(); l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop); l.contentLoaderInfo.addEventListener(Event.COMPLETE, done); l.load(new URLRequest("Portfolio.swf")); function loop(event:ProgressEvent):void { var perc:Number = event.bytesLoaded / event.bytesTotal; percent.text = Math.ceil(perc*100).toString(); } function done(event:Event):void { removeChildAt(0); percent = null; addChild(l); }