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

  • Home
  • SEARCH
  • 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 8837727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:47:59+00:00 2026-06-14T09:47:59+00:00

i have a class name sample_1.as package { import flash.display.MovieClip; public class sample_1 extends

  • 0

i have a class name sample_1.as

package  {

    import flash.display.MovieClip;


    public class sample_1 extends MovieClip {

        public var targetScene:String;

        public function sample_1() {
            // constructor code
        }
    }
}

and i want to access and change the targetScene string from different frames and also inside movieclips like

gotoAndPlay(targetScene);
or
targetScene = "MainMenuEnter";

how can i do that?

  • 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-14T09:48:02+00:00Added an answer on June 14, 2026 at 9:48 am

    A quick and easy way to have a variable like that available from any frame/class is to make it static:

    public class sample_1 extends MovieClip {    
        public static var targetScene:String;
    }
    

    You can access targetScene from anywhere using sample_1.targetScene, for example:

    sample_1.targetScene = "3";
    gotoAndPlay(uint(sample_1.targetScene));
    

    It’s not the best method to use, especially as a project gets bigger and has more components, declaring variables static for the sake of global access can lead to a lot of spaghetti code but it’s a quick ‘n’ dirty fix to get you started.

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

Sidebar

Related Questions

I have the following classes: package models; public class Test extends activejdbc.Model { }
I have a simple class I'm serializing. [DataContract(Name = Test, Namespace = )] public
I have a class like this, public class person { name Name {set; get;}
I have a class like so: [JsonObject(MemberSerialization.OptIn)] public class foo { [JsonProperty(name_in_json)] public string
So i have a class name repository which is just a simple array.Here is
I have a class CollectionOfThings . As its name suggests its a simple collection
I have a simple model like this one: class Artist(models.Model): surname = models.CharField(max_length=200) name
I have a class Person and a class Name. Name contains two Strings firstName
I have style sheet with a class name changebackgroundcolor i want make change in
I have made a Rest Web Service: package org.jboss.samples.rs.webservices; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import

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.