PDA

View Full Version : multiple swfs in a loader



chelle22
June 24th, 2008, 10:21 PM
Hey guys

I have a frustrating problem, Im trying to load different swfs using the same loader, this works but the problem is that I can't seem to change the location and size dimensions with other affecting the other swf.. (one needs to be scaled smaller)

I've tried using the different varible names for each loader/swf.. but then they stack on top of each other after another button is pressed.. is there any possible way of doing this?

Thanks



var loader1:Loader = new Loader();
loader1.contentLoaderInfo.addEventListener(Event.I NIT, onComplete);
function onComplete(e:Event):void {
loader1.scaleY =.9; //resizing to fit in certain area of gallery
loader1.scaleX=.9;
loader1.x= 410.9; //positioning
loader1.y= 235.3;
addChild(loader1);
}
var request2:URLRequest = new URLRequest("Match2.swf");
mat_btn.addEventListener(MouseEvent.MOUSE_DOWN, mat);
function mat(evt:MouseEvent):void {
loader1.load(request2);
}
loader1.contentLoaderInfo.addEventListener(Event.I NIT, Dvd2);
function Dvd2(e:Event):void {
loader1.scaleY =.9; //resizing to fit in certain area of gallery
loader1.scaleX=.9;
loader1.x= 410.9; //positioning
loader1.y= 235.3;
addChild(loader1);
}
var request3:URLRequest = new URLRequest("dvdmenuproject.swf");
dvd_btn.addEventListener(MouseEvent.MOUSE_DOWN, dvd);
function dvd(evt:MouseEvent):void {
loader1.load(request3);
}