Skip to main content
Participant
August 13, 2014
解決済み

TypeError: Error #1009:

  • August 13, 2014
  • 返信数 1.
  • 388 ビュー

Here is my error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

  at GuitarAnimation_2_fla::MainTimeline/frame176()

  at flash.display::MovieClip/gotoAndStop()

  at GuitarAnimation_2_fla::MainTimeline/Chome()

My animation is to teach the user what each strings name and sound is and how to play 3 different simple chords on a guitar. Each chord section has a sub section to learn the finger placements and also to hear/see the chord being played.

I have 3 action layers- One for the main Navigation Buttons, One for the buttons on the guitar strings page, and one for the sub navigation buttons on each learn the chord page. I have pasted the code which I am recieving an error on. I ran the debugger and it said the issues is with line 7, which I have marked as red below. Below this code, is the full error I get when I run the debugger.

//sub navigation

import flash.events.MouseEvent;

stop();

c_placebtn.addEventListener(MouseEvent.CLICK, c_place);

hear_cbtn.addEventListener(MouseEvent.CLICK, c_hear);

d_placebtn.addEventListener(MouseEvent.CLICK, d_place);

hear_dbtn.addEventListener(MouseEvent.CLICK, d_hear);

g_placebtn.addEventListener(MouseEvent.CLICK, g_place);

hear_gbtn.addEventListener(MouseEvent.CLICK, g_hear);

function c_place(event:MouseEvent):void {

  gotoAndStop("cfingers")

  c_placebtn.alpha = 0;

  hear_cbtn.alpha = 100;

}

function c_hear(event:MouseEvent):void {

  gotoAndStop("c_hear_chord")

  c_placebtn.alpha = 100;

  hear_cbtn.alpha = 0;

}

function d_place(event:MouseEvent):void {

  gotoAndStop("dfingers")

  d_placebtn.alpha = 0;

  hear_dbtn.alpha = 100;

}

function d_hear(event:MouseEvent):void {

  gotoAndStop("d_hear_chord")

  d_placebtn.alpha = 100;

  hear_dbtn.alpha = 0;

}

function g_place(event:MouseEvent):void {

  gotoAndStop("gfingers")

  g_placebtn.alpha = 0;

  hear_gbtn.alpha = 100;

}

function g_hear(event:MouseEvent):void {

  gotoAndStop("g_hear_chord")

  g_placebtn.alpha = 100;

  hear_gbtn.alpha = 0;

}

Full debugger error

Attempting to launch and connect to Player using URL C:\Users\owner\Documents\AIOP-Schoolwork\Interactive Authoring\Class Project\Guitar Animation_2.swf

[SWF] C:\Users\owner\Documents\AIOP-Schoolwork\Interactive Authoring\Class Project\Guitar Animation_2.swf - 153383 bytes after decompression

TypeError: Error #1009: Cannot access a property or method of a null object reference.

  at GuitarAnimation_2_fla::MainTimeline/frame176()[GuitarAnimation_2_fla.MainTimeline::frame176:7]

  at flash.display::MovieClip/gotoAndStop()

  at GuitarAnimation_2_fla::MainTimeline/Chome()[GuitarAnimation_2_fla.MainTimeline::frame1:17]

このトピックへの返信は締め切られました。
解決に役立った回答 kglad

if the info you supplied is accurate, d_placebtn doesn't exist when that line of code executes.

返信数 1

kglad
Community Expert
kgladCommunity Expert解決!
Community Expert
August 13, 2014

if the info you supplied is accurate, d_placebtn doesn't exist when that line of code executes.

Participant
August 16, 2014

Thank you. The way I had all the layers organized was making it so the code would not function.

kglad
Community Expert
Community Expert
August 16, 2014

you're welcome.