So I'm trying to dynamically load and position images. I can get them to
display, but how do I position them

I load them using this code:
PHP Code:
 var container:Sprite = new Sprite();
addChild(container);
var xPos:Number = 0;

for each (var a:String in imgURL){
   var image:Sprite = new Sprite();
   var pictLdr:Loader = new Loader();
   var pictURLReq:URLRequest = new URLRequest(a);
   pictLdr.load(pictURLReq);
   pictLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
   container.addChild(image)
   image.addChild(pictLdr);
}
function imgLoaded(e:Event):void
{
   xPos +=e.target.width
}
 Which works great, but no positioning.

Live docs had this
PHP Code:
 function loaded(event:Event):void
{
   var content:Sprite = event.target.content;
   content.scaleX = 2;
}
 But flash throws this error:
Quote:
TypeError: Error #1034: Type Coercion failed: cannot convert
flash.display::[EMAIL PROTECTED] to flash.display.Sprite.
at Timeline0_5417a63c9e955d4fa76fcfb296d91733/loaded()
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to