Topic: Game Programming /
Preloader problem, loading swf into MovieClip, Flixel
So i am using Flixel for my project and Flixel have built in Preloader..
Because Kongregate is sponsoring the game i need to use Kongregate’s swf in loading screen instead of stuff that Flixel have set for loading bar…
So my idea was that i load swf file into MovieClip object.
Problem is that when i try to change .x and .y position of loaded swf that’s placed in MovieClip variable i get error that i cannot access property of null object…
What i don’t understand is how that loaded_swf is null anyway when i place swf inside of it…
So please check my code and tell me what i am doing wrong and how could i fix it…
Thanks in advance :)
private var loaded_swf: MovieClip;
private var url:URLRequest = new URLRequest(“kong.swf”);
private var ldr: Loader = new Loader();
private function swfLoadedHandler( evt: Event ): void
trace( ‘SWF loaded!’ );
// Read the SWF that has been loaded and store it in a variable.
loaded_swf = evt.target.content as MovieClip;
loaded_swf.x = 0;
loaded_swf.y = 0;
addChild( loaded_swf );