I have two versions of the same movie clip background image, one at normal brightness and the other with a darker brightness (by duplicating the movie clip and placing it behind the brighter image).
I’ve created a small circular mask to use as the torch light
The code I’m using is:
Mouse.hide();
pic_mc.cacheAsBitmap = true
mask_mc.cacheAsBitmap = true
pic_mc.mask = mask_mc
stage.addEventListener(Event.ENTER_FRAME,custom);
function custom(event:Event):void {
mask_mc.x = mouseX
mask_mc.y = mouseY
}
The problem is, that when I’ve tried to duplicate this template I’m using in my own project, I get this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ZombieGame15_fla::MainTimeline/frame355()
at flash.display::MovieClip/gotoAndStop()
at ZombieGame15_fla::MainTimeline/droptl()
Would someone be able to talk me through created this effect from scratch?
I’m wondering if I maybe missed a step. I copied the mask across to my project, renamed my background image movie clip and copied the code.