Hi;
I have this code:
public function thePic(x:int,
y:int)
{
var path:String = new String();
switch (counter)
{
case 0:
path = "images/bracelet.jpg";
break;
case 1:
path = "images/brooch.jpg";
break;
case 2:
path = "images/chain.jpg";
break;
case 3:
path = "images/earring.jpg";
break;
case 4:
path = "images/necklace.jpg";
break;
case 5:
path = "images/ring.jpg";
break;
}
var req:URLRequest = new URLRequest(path);
var loader:Loader = new Loader();
loader.load(req);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded);
}
function loaded(e:Event):void
{
var loaderInfo:LoaderInfo = e.target as LoaderInfo;
var displayObject:DisplayObject = loaderInfo.content;
displayObject.width = 257;
displayObject.height = 257;
displayObject.x = myX + 31;
displayObject.y = myY + 31;
var myBevel:BevelFilter = new BevelFilter();
myBevel.type = BitmapFilterType.FULL;
myBevel.distance = 10;
myBevel.highlightColor = 0xFF0000;
myBevel.shadowColor = 0xFFFF00;
myBevel.blurX = 20;
myBevel.blurY = 20;
displayObject.filters = [myBevel];
addChild(displayObject);
}
If I trace "path" all paths print out in the iteration of "counter". The
problem is that "Event.COMPLETE.loaded" is apparently called only once after
the while loop terminates that increments counter (inside of which all of
the above code is contained). Please advise how to make function loaded fire
for each iteration.
TIA,
Susan
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders