Solved

Good Flash application source code

Posted on 2006-10-23
4
177 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Embedding Flash App/Movie on Website 3 503
Failed download 57 570
Flash builder 4.13 list scroller does not work 1 46
Shockwave Flash Object within PowerPoint 2013 2 151
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to how to record live broadcast.
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.

821 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