receiving error #1009 in flash cs4 actionscript3

Posted by Leah on Stack Overflow See other posts from Stack Overflow or by Leah
Published on 2010-05-08T00:56:09Z Indexed on 2010/05/08 0:58 UTC
Read the original article Hit count: 422

Filed under:
|
|

I'm having a weird issue where my buttons will work initially and direct me to an appropriate page, but when i go back to that page and try to use the buttons the roll-overs work but none of the buttons direct to a different page.

This is the actionscript on the initial page with the buttons. If I choose any of these buttons they work. For example the profile_btn will take me to the go_to_page"

stop();
import flash.events.MouseEvent;

//button instancese listed below
profile_btn.addEventListener(MouseEvent.CLICK, aClick);

function aClick(event:MouseEvent):void{
 gotoAndPlay("go_to_page");
}


color_btn.addEventListener(MouseEvent.CLICK, cClick);

function cClick(event:MouseEvent):void{
 gotoAndPlay("color_page");
}


drawing_btn.addEventListener(MouseEvent.CLICK, dClick);

function dClick(event:MouseEvent):void{
 gotoAndPlay("drawing_page");
}


letsgo_btn.addEventListener(MouseEvent.CLICK, fClick);

function fClick(event:MouseEvent):void{
 gotoAndPlay("home_page");
}


 //go to flash fish animation
digital_btn.addEventListener(MouseEvent.CLICK,onMouseClick2);

function onMouseClick2(e:MouseEvent):void

{
 var request:URLRequest=new URLRequest("aquarium2.swf");
 navigateToURL(request,"blank");}


//go to resume document
resume_btn.addEventListener(MouseEvent.CLICK,onMouseClick3);

function onMouseClick3(e:MouseEvent):void

{
 var request:URLRequest=new URLRequest("LeahHonseyResume.pdf");
 navigateToURL(request,"blank");

once at the go_to_page, it plays through a motion tween and ends up at the profile_page. from this page, there is a home_btn. Here is the actionscript for the profile_page.

stop();

home_btn.addEventListener(MouseEvent.CLICK, gClick);

function gClick(event:MouseEvent):void{
 gotoAndPlay("return_frame");
}

But when I click on the home_btn I get an output:

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

It does take me to the correct page, but none of the button then on this page are working. the actionscript for the return_frame page is:

stop();
import flash.events.MouseEvent;

//button instances listed below
profile_btn.addEventListener(MouseEvent.CLICK, hClick);

function hClick(event:MouseEvent):void{
 gotoAndPlay("profile_page");
}


color_btn.addEventListener(MouseEvent.CLICK, iClick);

function iClick(event:MouseEvent):void{
 gotoAndPlay("color_page");
}


drawing_btn.addEventListener(MouseEvent.CLICK, jClick);

function jClick(event:MouseEvent):void{
 gotoAndPlay("drawing_page");
}


letsgo_btn.addEventListener(MouseEvent.CLICK, kClick);

function kClick(event:MouseEvent):void{
 gotoAndPlay("home_page");
}


//go to flash fish animation
digital_btn.addEventListener(MouseEvent.CLICK,onMouseClick4);

function onMouseClick4(e:MouseEvent):void

{
 var request:URLRequest=new URLRequest("aquarium2.swf");
 navigateToURL(request,"blank");}


//go to resume document
resume_btn.addEventListener(MouseEvent.CLICK,onMouseClick5);

function onMouseClick5(e:MouseEvent):void

{
 var request:URLRequest=new URLRequest("LeahHonseyResume.pdf");
 navigateToURL(request,"blank");}

Can anyone help me figure out why this script is not working? Thank you. I am a beginner flash user, and am trying to build my portfolio site for a homework assignment on Monday.

Leah

© Stack Overflow or respective owner

Related posts about flash

Related posts about cs4