On Mon, Feb 22, 2010 at 2:27 PM, Keith Reinfeld
<[email protected]>wrote:
> > Thanks for the clarification, but that ain't doing it either.
>
> // LoaderInfo
> e.currentTarget
>
> // Bitmap
> e.currentTarget.loader.content
>
Perhaps, but if I trace(displayObject) it traces as the bitmap, so I can use
that. Such being the case, I apply the bevel filter to the bitmap, which is
correct. Then I add the child to the default (stage) and it appears.
Everything good here. I presume my removeEventListener works.
But,,,that's not the problem!
> Your images are likely to display one top of the other, making it seem
like
you are only getting one.
THAT'S the problem. "myX" and "myY" are all the same value every iteration
(traced 'em). So, how do I pass new values to fn loaded?
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 loaderArray:Array = new Array();
loaderArray[counter] = new Loader();
loaderArray[counter].load(req);
loaderArray[counter].contentLoaderInfo.addEventListener(Event.COMPLETE,loaded);
}
function loaded(e:Event):void
{
var loaderInfo:LoaderInfo = e.target as LoaderInfo;
var displayObject:DisplayObject = loaderInfo.loader.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);
e.currentTarget.content.removeEventListener(Event.COMPLETE, loaded);
}
TIA,
Susan
>
>
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders