all groups > flash actionscript > may 2004 >
You're in the

flash actionscript

group:

multiple instances of UI COmponent Loader?



multiple instances of UI COmponent Loader? higgo
5/6/2004 9:38:47 PM
flash actionscript: I'm trying to use multiple instances of a Loader UI Component to load images
into my movie. I've dragged the loader component onto the stage and deleted it
to get the Loader into my library and then have the code below on the first
frame of the stage. The problem is that only one of the Loaders shows
(whichever one loads last). What am I doing wrong?

thanks,
Mike

import mx.controls.Loader;

var nav1_path:String = "lib/img/home_image_1.jpg";
var nav2_path:String = "lib/img/home_image_2.jpg";

createClassObject(Loader, "nav_image_1", 0, {contentPath:nav1_path});
nav_image_1._x = 0;
nav_image_1._y = 20;

createClassObject(Loader, "nav_image_2", 0, {contentPath:nav2_path});
nav_image_2._x = 120;
nav_image_2._y = 20;
Re: multiple instances of UI COmponent Loader? michael nieuwenhuizen
5/7/2004 12:00:12 AM

[quoted text, click to view]

you set them at the same depth (0). change the "0" in the second line to
a "1".

mike

AddThis Social Bookmark Button