Solved

Good Flash application source code

Posted on 2006-10-23
4
169 Views
Last Modified: 2010-04-03
I'm currently having trouble writing Flash classes and eliminating the use of _root and _global. Does anyone have a good suggestion for source code of a flash application with good use of custom classes.

Thanks.
0
Comment
Question by:jpilz
4 Comments
 
LVL 8

Accepted Solution

by:
wildbrookmedia earned 250 total points
ID: 17790876
0
 
LVL 5

Assisted Solution

by:blockage1
blockage1 earned 250 total points
ID: 17927695
Static methods and properties are really useful for the kind of things you might leave on the root or in the global scope. For example if you had a variable called "foo" and you need other classes to be able to access it you could put in a class like so...

class ExampleClass
{
     private static var $foo;
     
     public static function get foo ()
     {
           return $foo;
     }
     public static function set foo ( value )
     {
           $foo = value;
     }
}

then when you need to access it import the class...

   import ExampleClass;

then you can read the variable like this...

   var i = ExampleClass.foo;

and set it like this...

   ExampleClass.foo = "baa"

You can also have static methods too...

class ExampleClass2
{
     public static function myMethod ( )
     {
           // do stuff
     }
}

which you can call like this...

    import ExampleClass2;
    ExampleClass2.myMethod();
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

708 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

15 Experts available now in Live!

Get 1:1 Help Now