So i have done a couple days worth of research and nothing I find is working.
Maybe I am doing this wrong, i dont know. What I am trying to do is dynamically place movie clips into a container called container. when I roll over the movie clip I need it to show on top… right now its either not showing up on top or i get an Error #2006… out of bounds… Below is my AS3 code that i created to do what I want… so far everything is working except the rollover effect…
can some one please help me fix it or point me to some reading material that would better explain what I am trying to do… thank you in advance…
import caurina.transitions.*;
var imgHolder:MovieClip;
for (var i:int = 0; i < 6; i++){
imgHolder = new imageHolder();
imgHolder.x = (imgHolder.width + 3) * i;
imgHolder.y = (container.height / 2);
imgHolder.addEventListener(MouseEvent.ROLL_OVER, getBigger);
imgHolder.addEventListener(MouseEvent.ROLL_OUT, getNormal);
if(i == 0 || i == 2 || i == 4 || i == 6){
imgHolder.alpha = 1;
}else{
imgHolder.alpha = .5;
}
container.addChild(imgHolder);
}
function getBigger(evt:MouseEvent):void{
container.setChildIndex(evt.target as MovieClip, container.numChildren - 1)
Tweener.addTween(evt.target, {scaleX:1.5, scaleY:1.5, time:1, transition:"easeOutExpo"});
}
function getNormal(evt:MouseEvent):void{
Tweener.addTween(evt.target, {scaleX:1, scaleY:1, time:1, transition:"easeOutExpo"});
}