///from: http://www.ilike2flash.com/2009/06/black-white-gallery-effect.html //1.Array to hold all the picture instances. var picArr:Array=new Array(pic1_mc,pic2_mc,pic3_mc); //2.Function to control the rollover and rollout effect. function rollBW(picture:MovieClip):void { picture.addEventListener(MouseEvent.MOUSE_OVER, over); picture.addEventListener(MouseEvent.MOUSE_OUT, out); picture.addEventListener(MouseEvent.CLICK, clicker); function over(event:MouseEvent):void { picture.gotoAndPlay(2); trace(i); //trace(picture.jumpTarget); ///slides.gotoAndStop(picture.jumpTarget) } function out(event:MouseEvent):void { picture.gotoAndStop(1); } function clicker(event:MouseEvent):void { trace(picture.jumpTarget); slides.gotoAndStop(picture.jumpTarget) } } //3.For loop to call move images. for (var i = 0; i < picArr.length; i++) { rollBW(picArr[i]); }