ActiveDen

Themed Image Galleries

I tried to load this as a SWF into my Flash project, but it doesn’t work. I get a “null object reference” error. What am I doing wrong?

Often an instance of the Loader class is added as a child upon completion of the load process; that is, in listeners to Event.COMPLETE. This works fine unless the loaded SWF contains references to “stage” (which this file does). In order to have access to the “stage”, the loaded content must be on the Display List BEFORE any code in it referencing “stage” is executed. Following is some example code for your use in preparing a container FLA :

var request:URLRequest = new URLRequest(“Themed_Image_Galleries.swf”);

var loader:Loader = new Loader();

addChild(loader);

loader.load(request);

In summary, add the child to the display list BEFORE loading the SWF .

by
by
by
by
by