Hello, i have been using TweenLite for a while and i thought i should work more on the other tools too. So now i want to load 100 thumbnails on a webpage and allow them to scaleUp on mouse over and scale down on mouseOut. The problem im stuck is that i cant change their depth so i cannot bring to front the image that is currently enlarged. Any suggestions?
var x1:int = 0;
var y1:int = 80;
var sizeW:int = 60;
var sizeH:int = 60;
var countI:int = 100;
var queue:LoaderMax = new LoaderMax({name:"mainQueue",onProgress:progressHandler,onComplete:completeHandler,onError:errorHandler});
var i:int;
for (i=1; i{
queue.append( new ImageLoader("flashImages/ex/ex (" + i + ").jpg", {name:"photo"+i, estimatedBytes:100000, container:this, width:sizeW,height:sizeH, scaleMode:"proportionalInside",centerRegistration :true,bgColor:0xFFFFFF}) );
}
//prioritize the loader named "photo1"
LoaderMax.prioritize("photo1");
//same as LoaderMax.getLoader("photo1").prioritize();
//start loading
queue.load();
function progressHandler(event:LoaderEvent):void
{
trace("progress: " + event.target.progress);
}
function completeHandler(event:LoaderEvent):void
{
for (i=1; i {
x1 += sizeW;
if (x1 > 580) //here i allign the thumbnails as they load
{
x1 = sizeW;
y1+=sizeH;
}
var image:ContentDisplay = LoaderMax.getContent("photo" + i);
image.addEventListener(MouseEvent.MOUSE_OVER,enlarge);
image.addEventListener(MouseEvent.MOUSE_OUT,shrink);
TweenLite.to(image, 1, {alpha:1, y:y1,x:x1});
}
trace(event.target + " is complete!");
}
function errorHandler(event:LoaderEvent):void
{
trace("error occured with " + event.target + ": " + event.text);
}
function enlarge(e:Event):void
{
//setChildIndex(e.target,numChildren - 1); <--------------------this brings problem
TweenLite.to(e.currentTarget,0.5,{scaleX:3,scaleY:3});
trace(e.currentTarget+" over"); <------------------trace shows : [object ContentDisplay]
}
function shrink(e:Event):void
{
TweenLite.to(e.currentTarget,0.5,{scaleX:1,scaleY:1});
}