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 3431800
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:22:16+00:00 2026-05-18T07:22:16+00:00

I am designing a flash website and I made it object oriented. I have

  • 0

I am designing a flash website and I made it object oriented. I have a lot of classes and I am having difficulty in accessing information ( variables ) from other classes.

To do so I usually include the variable at the parameters of my class’ functions ( or constructor) OR I create custom event objects that will transport the variables to another class ( that listens for them ). This methods are sluggish.

I know there are local variables ( those who are declared inside a function and are available only to that function ) and global variables ( who are declared inside a class as private or public and are available in that class ). Can I, somehow, create some sort of ‘superglobal’ variables that are available to the whole flash program?

If not, do you guys know a way to pass along variables in an OOP design?

Thanks! I will try to implement a singleton.

  • 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-05-18T07:22:17+00:00Added an answer on May 18, 2026 at 7:22 am

    Singleton class:

    package {
    
       public class SingletonDemo {
          private static var instance:SingletonDemo;
          private static var allowInstantiation:Boolean;
    
          public static function getInstance():SingletonDemo {
             if (instance == null) {
                allowInstantiation = true;
                instance = new SingletonDemo();
                allowInstantiation = false;
              }
             return instance;
           }
    
          public function SingletonDemo():void {
             if (!allowInstantiation) {
                throw new Error("Error: Instantiation failed: Use SingletonDemo.getInstance() instead of new.");
              }
           }
        }
    }
    

    I think I get it now. Thanks!

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

Sidebar

Related Questions

When designing user table what would be the must have fields from the security/user
We are currently designing a website that will be accessed from kiosks in a
I'm new to designing OO systems. I have a simple Flash Cards app where
I have been working on Flash AS3 project. I am designing a 3D system.
Designing a new system from scratch. I'll be using the STL to store lists
When designing LINQ classes using the LINQ to SQL designer I've sometimes needed to
There's a real art to designing a website that works for everyone, and Progressive
I am very new to website design. Have an architect who wants his clients
I'm storing a variety of variables containing statistics, items weapons, etc in a flash
i have some knowledge of css,jQuery,Grails,django,servlets and jsp still i can't see me designing

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.