I've spent days working on this code, it seems so simple, but yet it never works. All I'm trying to do is make a loop automatically load person0.swf through person4.swf in the same directory. I've got it set-up so that I can change a single number and it loads up to person[whatever-the-new-number-is].swf
Currently it loads the first movie and thats it. I also get this error:
"TypeError: Error #1009: Cannot access a property or method of a null object reference. at Menu()"
Here is the code
package {
import flash.display.*;
import flash.net.URLRequest;
import flash.events.*;
public class Menu extends MovieClip {
var loaders:Array;
var loadedCount:uint;
var person:Array = new Array();
var filenum:int = 5;
function Menu() {
for (var i = 0; i < 4; i++) {
var loader = new Loader();
person.push("person" + i + ".swf");
var currentperson = person[i];
var url:URLRequest = new URLRequest(currentperson);
loader.load(url);
addChild(loader);
loader.content.x = i * 240;
}
}
}
}