NeoMarine
05-22-2008, 01:34 PM
The following code returns a 1009 error:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at myfile_fla::MainTimeline/colorActiveItemEvent()
But I have no idea what it is referring to exactly. The thing is, the code works, except everytime I use it inside test mode I get this annoying typeerror...
Does anyone know the reason, or fix for this?
Here's my code:
import flash.geom.ColorTransform;
function colorActiveItemEvent(eventObject:Event):void {
var newColorTransform:ColorTransform = activeItem.transform.colorTransform;
newColorTransform.color = colorChanger.cpColor.selectedColor;
activeItem.objectColor.transform.colorTransform = newColorTransform;
currentHairColor = colorChanger.cpColor.selectedColor;
}
activeItem.addEventListener(Event.ENTER_FRAME, colorActiveItemEvent);
TypeError: Error #1009: Cannot access a property or method of a null object reference. at myfile_fla::MainTimeline/colorActiveItemEvent()
But I have no idea what it is referring to exactly. The thing is, the code works, except everytime I use it inside test mode I get this annoying typeerror...
Does anyone know the reason, or fix for this?
Here's my code:
import flash.geom.ColorTransform;
function colorActiveItemEvent(eventObject:Event):void {
var newColorTransform:ColorTransform = activeItem.transform.colorTransform;
newColorTransform.color = colorChanger.cpColor.selectedColor;
activeItem.objectColor.transform.colorTransform = newColorTransform;
currentHairColor = colorChanger.cpColor.selectedColor;
}
activeItem.addEventListener(Event.ENTER_FRAME, colorActiveItemEvent);