Solved

Good Flash application source code

Posted on 2006-10-23
4
178 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 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

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…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

739 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