Error 1109

New Here ,
Oct 20, 2019 Oct 20, 2019

Copy link to clipboard

Copied

I've ran it before and it works. Then suddenly it didn't. 

Code: 

import flash.events.Event;
import flash.filters.*;

stop();

//////////////////////Filters///////////////////////
var permGlow:GlowFilter = new GlowFilter();
permGlow.alpha = .5;
permGlow.color = 0xffffff;
permGlow.blurX = 10;
permGlow.blurY = 10;
Journal1.filters = [permGlow];
Journal2.filters = [permGlow];
Journal3.filters = [permGlow];

var myGlow:GlowFilter = new GlowFilter();
myGlow.alpha = 1;
myGlow.color = 0xffffff;
myGlow.blurX = 50;
myGlow.blurY = 50;

//////////////////////Circular Path//////////////////
var angle:Number = 0;
var radius:Number = 170;

var center:Number = 266;
var centery:Number = 140;

stage.addEventListener(Event.ENTER_FRAME,spin);
function spin(e:Event):void
{
Journal1.x = center + Math.sin(angle - 500) * radius;
Journal1.y = centery + Math.cos(angle - 500) * radius;

Journal2.x = center + Math.sin(angle - 100) * radius;
Journal2.y = centery + Math.cos(angle - 100) * radius;

Journal3.x = center + Math.sin(angle + 300) * radius;
Journal3.y = centery + Math.cos(angle + 300) * radius;

angle += .02;
}
////////////////////////Button Click///////////////////////
Journal1.addEventListener(MouseEvent.CLICK, jump_char);
function jump_char(e:MouseEvent):void
{
gotoAndPlay(2);
}

Journal2.addEventListener(MouseEvent.CLICK, jump_place);
function jump_place(e:MouseEvent):void
{
gotoAndPlay(3);
}

Journal3.addEventListener(MouseEvent.CLICK, jump_monster);
function jump_monster(e:MouseEvent):void
{
gotoAndPlay(4);
}
//////////////////////////Hover//////////////////////////
Journal1.addEventListener(MouseEvent.MOUSE_OVER, glow1);
function glow1(e:MouseEvent):void
{
Journal1.filters = [myGlow];
Journal1.addEventListener(MouseEvent.MOUSE_OUT, closeglow);
}

Journal2.addEventListener(MouseEvent.MOUSE_OVER, glow2);
function glow2(e:MouseEvent):void
{
Journal2.filters = [myGlow];
Journal2.addEventListener(MouseEvent.MOUSE_OUT, closeglow);
}

Journal3.addEventListener(MouseEvent.MOUSE_OVER, glow3);
function glow3(e:MouseEvent):void
{
Journal3.filters = [myGlow];
Journal3.addEventListener(MouseEvent.MOUSE_OUT, closeglow);
}
//////////////////////Off Hover/////////////////////////
function closeglow(e:MouseEvent):void
{
Journal1.filters = [permGlow];
Journal2.filters = [permGlow];
Journal3.filters = [permGlow];
}

 

Error:

TypeError: Error #1009: Cannot access a property or method of a null object reference. at GravityFalls_fla::MainTimeline/spin()

TOPICS
ActionScript, Code, Error

Views

78

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 20, 2019 Oct 20, 2019

Copy link to clipboard

Copied

I figured it out.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 20, 2019 Oct 20, 2019

Copy link to clipboard

Copied

Have to properly remove the stage event before going to next frame.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 20, 2019 Oct 20, 2019

Copy link to clipboard

Copied

LATEST

null object reference usually means something on your stage might have gotten deleted. So while the code might not have changes, something on your stage might have. Maybe check to see if anything has been removed or instance renamed?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines