My code is below. I have an external Class AS file doing most of my code but I need some of the moviClips to highlight areas (other movieClips) when they're rolled over.
I've kept instance names the same + an H for their highlights to lessen the amount of code and be able to use array's and for loops.
my code is below and brings up this error:
Actionscript Code:
TypeError: Error #1034: Type Coercion failed: cannot convert "areanaH" to flash.display.MovieClip.
at EnterpriseZone_fla::Layer1_1/end()
please help...
Actionscript Code:
import flash.display.MovieClip;
function hArea (e:MouseEvent) {
var mName:MovieClip;
mName = MovieClip((e.target.name) + "H");
mName.gotoAndStop(2);
}
function end (e:MouseEvent) {
var mName:MovieClip;
mName = MovieClip((e.target.name) + "H");
mName.gotoAndStop(1);
}
var stopAll:Array = new Array (bHomes1H,areanaH);
for (var i:int=0;i<stopAll.length;i++){
stopAll[i].stop();
}
var rollArray:Array = new Array (bHomes1,areana);
for (var Mc:int=0;Mc<rollArray.length;Mc++){
rollArray[Mc].addEventListener( MouseEvent.MOUSE_OVER,hArea );
rollArray[Mc].addEventListener( MouseEvent.MOUSE_OUT,end );
}