A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Error #1010 help

  1. #1
    Junior Member
    Join Date
    Jan 2010
    Posts
    4

    Error #1010 help

    i am following this tuturial, but when i go to debug i get this error.
    Code:
    TypeError: Error #1010: A term is undefined and has no properties.
    	at Index_fla::MainTimeline/frame1()[Index_fla.MainTimeline::frame1:11]
    here is the code.
    Code:
    /////////////////////////////////////////////////////////////////////
    // Startup.
    /////////////////////////////////////////////////////////////////////
    stop();
    mainMenu_mc.stop();
    
    
    /////////////////////////////////////////////////////////////////////
    // Event Setup.
    /////////////////////////////////////////////////////////////////////
    mainMenu_mc.goals_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
    mainMenu_mc.statements_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
    mainMenu_mc.outcomes_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
    mainMenu_mc.resume_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
    mainMenu_mc.statements_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
    /////////////////////////////////////////////////////////////////////
    // Event Handlers.
    /////////////////////////////////////////////////////////////////////
    function navigationClicked(Event:MouseEvent):void
    {
        //We'll use this to store the Frame Label's name.
        var frmLabel:String = '';
    
        //Determine what Frame Label to use based on which
        //button was clicked.
        switch (Event.target)
        {
    
            case mainMenu_mc.goals_btn :
                frmLabel = "goals_frm";
                break;
            case mainMenu_mc.statements_btn :
                frmLabel = "statement_frm";
                break;
            case mainMenu_mc.outcomes_btn :
                frmLabel = "outcomes_frm";
                break;
            case mainMenu_mc.resume_btn :
                frmLabel = "resume_frm";
                break;
            case mainMenu_mc.letters_btn :
                frmLabel = "letters_frm";
                break;
       }
    
        //Find the frame number based on our Frame Label.
        var frmGoto:Number = this.getFrame(frmLabel);
    
        //Go to the requested page.
        gotoAndPlay(frmGoto);
    }
    /////////////////////////////////////////////////////////////////////
    // Helper Functions.
    /////////////////////////////////////////////////////////////////////
    function getFrame(frameName:String):Number
    {
        var frame:Number = 1;
    
        //Loop through all Frame Labels to find our requested frame.
        for (var i = 0; i < currentLabels.length; i++)
        {
            if (currentLabels[i].name == frameName)
            {
                frame = currentLabels[i].frame;
                break;
            }
        }
    
        return frame;
    }
    could some one pls tell me why i am getting this error?
    i am using flash cs4, and in action script 3.0 if you need to know that.

  2. #2
    Senior Member
    Join Date
    Jul 2009
    Posts
    113
    Go into "mainMenu_mc" and make sure there is an object named "goals_btn".

  3. #3
    Junior Member
    Join Date
    Jan 2010
    Posts
    4
    ya it there



  4. #4
    Senior Member
    Join Date
    Jul 2009
    Posts
    113
    The <Instance Name> isn't filled in. You need to replace that with "goals_btn".

  5. #5
    Junior Member
    Join Date
    Jan 2010
    Posts
    4
    Still doesn't work, what else could it be?

    i have included the file i really need to find out why it doing this
    Attached Files Attached Files
    Last edited by mastermc01; 02-24-2010 at 08:18 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center