i am new in flash..please help me in this code..
why is it that when i run this program it will proceed to else statement???
how coould i fix this???
thanx..
var dragArray:Array = [orangeduck, monkey, yoyo, car];
for(var i:int = 0; i < dragArray.length; i++){
dragArray[i].buttonMode = true;
dragArray[i].addEventListener(MouseEvent.MOUSE_DOWN, item_onMouseDown);
dragArray[i].addEventListener(MouseEvent.MOUSE_UP, item_onMouseUp);
}
function item_onMouseDown(event:MouseEvent):void {
var clip:MovieClip = MovieClip(event.currentTarget);
clip.startDrag();
}
function item_onMouseUp(event:MouseEvent):void {
var clip:MovieClip = MovieClip(event.currentTarget);
clip.stopDrag();
if (i==1)
{
gotoAndStop(3);
}
if(i==2)
{
gotoAndStop(currentFrame+2);
}
if(i==3){
gotoAndStop(currentFrame+3);
}
else{
gotoAndStop(currentFrame+4);
}
}