Hi,
Can anyone tell me why a movie clip i have on stage is not changing color? The movieClip - box1 is being called from the library through linkage and within this movie clip there is a movie clip called boxBG which is the movie clips color I'm trying to change.
I'm getting back "A term is undefined and has no properties" looks like a simple enough problem but can't figure it out - I've already checked that boxBG has the correct instance name, the error is being called when the MouseOverHandler and MouseOutHandler functions run:
ActionScript Code:
import flash.display.MovieClip;
import flash.display.Loader;
import flash.events.MouseEvent;
import flash.geom.ColorTransform;
var colorTransformBG:ColorTransform;
var myBox:box1;
myBox = new box1();
addChild(myBox);
myBox.y = 200; // positions droppables on y axis
myBox.x = 200;
myBox.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
myBox.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
function mouseOverHandler(e:Event):void
{
colorTransformBG = e.target.boxBG.transform.colorTransform;
colorTransformBG.color = 0x6e2685;
e.target.boxBG.transform.colorTransform = colorTransformBG;
}
function mouseOutHandler(e:Event):void
{
colorTransformBG = e.target.boxBG.transform.colorTransform;
colorTransformBG.color = 0x6effff;
e.target.boxBG.transform.colorTransform = colorTransformBG;
}
here is the error:
TypeError: Error #1010: A term is undefined and has no properties.
at Untitled_fla::MainTimeline/mouseOverHandler()[Untitled_fla.MainTimeline::frame1:23]