Error#1009 null has no properties.

26 views
Skip to first unread message

jbac...@fourthwall.ca

unread,
Feb 5, 2015, 11:21:23 AM2/5/15
to swfre...@googlegroups.com
Getting strange runtime error on very simple swf when I try to render.

Error#1009 null has no properties.

karim beyrouti

unread,
Feb 6, 2015, 4:09:32 AM2/6/15
to jbac...@fourthwall.ca
This was also answered here: https://groups.google.com/forum/#!topic/swfrenderer/f3ehzPsTY-M however this needs it's own thread - so answering it here. 

You are getting this error because you are referencing the application stage before it has been added to the host application's stage ( SWFRenderer ). Here is a Fix:

package
{
import flash.display.MovieClip;
import flash.events.Event;
import flash.utils.setTimeout;
public dynamic class MainTimeline extends MovieClip
{
public function MainTimeline()
{
super();
addEventListener(Event.ADDED_TO_STAGE , addedToStage ) ;
}
public function addedToStage( e : Event ) : void
{
setTimeout( startApp , 1 );// Added a timeout to give loaderInfo time to initialize
}
private function startApp() : void
{ trace( loaderInfo.width); // FIX: best option to use if you can;
trace( stage.stageWidth ); // could throw an error as you are accessing the application domain
}
}
}
Reply all
Reply to author
Forward
0 new messages