Ive been trying all day and cant get the MC to stop playing.
I have a MC that I want to play over buttons when they are rolled over.
Class sparkle.
I want the MC to stop when the user rolls out.
I dont understand why Im getting this error or what the best way to achieve my desired result.
//Btn_Home_mc the instance of a particular button
Btn_Home_mc.buttonMode = true;
Btn_Home_mc.addEventListener(MouseEvent.ROLL_OVER, HomeSpark);
Btn_Home_mc.addEventListener(MouseEvent.ROLL_OUT, HomeSparkClear);
function HomeSpark(event:MouseEvent):void
{
if (spark == null)
{
var spark:sparkle = new sparkle;
addChild(spark);
spark.x = 256.1;
spark.y = 276.7;
}
}
function HomeSparkClear(event:MouseEvent):void
{
removeChild(spark);
}
ERROR
ReferenceError: Error #1065: Variable spark is not defined.
I tried every possible variation of moving and calling but dont get it..
please help...
thanks