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

Posted on 2009-04-20
Last Modified: 2013-11-12
i am atempting to close a sub movie and go back to the host move but i get this error on click of my exit_btn plz help.

ReferenceError: Error #1069: Property activateButtons not found on flash.display.Stage and there is no default value.
      at window_fla::window_1/exit()

this is the code for the sub move exit button:

function exit(event:MouseEvent):void{

//define parentObj as an object holding the path to the host movie

var parentObj:Object = this.parent.parent as Object;

//call the function activateButtons using the path defined in parentObj



//User Interactions

exit_btn.addEventListener(MouseEvent.CLICK, exit);

code from the host movie:

this is the code for the function to remove the loaded movie and reactivate the buttons

this function is called by the child loaded through the addMovie function

function activateButtons(){


	// enables the buttons

	oven_btn.mouseEnabled= true

	window_btn.mouseEnabled= true

	table_btn.mouseEnabled= true

	book_btn.mouseEnabled= true

	bins_btn.mouseEnabled= true


Open in new window

Question by:chrissowerby
    LVL 8

    Accepted Solution

    You are trying to call the activateButtons method from within the MovieClip that was clicked by the user (parentObj).

    That's why Flash will look for this function in the Class this MC (parentObj) is linked to. Obviously the function does not reside in the button's Class but in another one (I presume you are writing your actionscript code on the main time line ?)

    You could try to call the function as is :

    //instead of :

    If that doesn't work I might have to take a deeper look at your code...

    I hope you understand all this, if you don't please shout !


    Author Closing Comment

    ye i took it out of the mc time line and pasted it to the main time line now its working!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
    Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
    The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now