Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Good Flash application source code

Posted on 2006-10-23
4
Medium Priority
?
181 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 8

Accepted Solution

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

Assisted Solution

by:blockage1
blockage1 earned 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

722 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