Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9264277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T13:47:08+00:00 2026-06-18T13:47:08+00:00

I wrote this code for a game im making, Im just learning, There are

  • 0

I wrote this code for a game im making, Im just learning, There are no compiler errors but when i run the code it fails with no errors. I have a line where i would like to goto a specified frame so the code is Button_Object.gotoAndStop(Local_Frame) but it looks as if the program just skips over it. I have tried to put _root.gotoAndstop(Local_Frame) and stage.gotoAndStop(Local_Frame) but these both give compiler errors the error it gives is

 C:\Users\Nathan\Desktop\Matching Game\ClickSolver.as, 
 Line 34    1120: Access of undefined property _root. 

I do see the trace statements. As a side note im trying to access the the main time line, not the objects timeline.

here’s the code

package  {
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.utils.Timer;
import flash.events.TimerEvent;

public class ClickSolver {
    private var Button_Object:MovieClip;
    private var Check_Object:MovieClip;
    private var Score:Number = 0;
    private var Local_Frame:Number = 0;
    private var Local_Timer:Timer = new Timer(1000,3);

    public function ClickSolver(ButtonObject:MovieClip, CheckObject:MovieClip, Frame:Number) {

        Local_Frame = Frame;
        Button_Object = ButtonObject;
        Check_Object = CheckObject;
        Button_Object.buttonMode = true;
        trace(Button_Object.name);
        trace(Check_Object.name);
        Local_Timer.start();
        trace(Local_Timer.currentCount);
        Button_Object.addEventListener(MouseEvent.CLICK, Object_Button_Clicked);
        Button_Object.addEventListener(MouseEvent.MOUSE_OVER,Button_Mouse_Over);
        Button_Object.addEventListener(MouseEvent.MOUSE_OUT, Button_Mouse_Out);
        Local_Timer.addEventListener(TimerEvent.TIMER_COMPLETE, TimerIsDone);

    }
    private function TimerIsDone (event:TimerEvent):void{
        trace("Timer is done");
        Local_Timer.stop();
        Local_Timer.reset();
        Button_Object.gotoAndStop(Local_Frame);
    }
    private function Button_Mouse_Out (event:MouseEvent):void{
        Button_Object.alpha = 1;
    }
    private function Button_Mouse_Over (event:MouseEvent):void{
        Button_Object.alpha = 0.75;
    }
    private function Object_Button_Clicked (event:MouseEvent):void{
        Score++;
        Check_Object.visible =  false;
        Button_Object.gotoAndStop(Local_Frame);
        trace("Score: " + Score);
        trace("Frame: " + Local_Frame);
    }

  }

   }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T13:47:10+00:00Added an answer on June 18, 2026 at 1:47 pm

    _root isn’t supported in AS3.

    Try

    MovieClip(root).gotoAndStop(local_Frame);
    

    PS. A common naming convention for you code is to name variables using lower camelCase (i.e. start with a lowercase letter) and name classes with upper CamelCase (i.e. start with an uppercase letter).

    This will make your code easier to read and allow you to instantly see which items are variables and classes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code for a small jQuery game I'm making, and all the
I wrote this code for zoom in/out . it works but even with one
I wrote this code. The constructor works normally, but in the destructor I get
My brother wrote this code for me to show an example of polymorhism. But
Im new to ruby, wrote this code and works but i know is not
I'm making a text-based game, and I just finished the majority of code, and
So I am making a small game in C++ and I have run across
I wrote this code for zoom in / out and it suppesed to only
I wrote this code to create a custom annotation image - (MKAnnotationView *)mapView:(MKMapView *)mapView
I wrote this code in C# to encrypt a string with a key: private

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.