Well, I think that there are different ways to accomplish this and every developer will have his own way. You could store the config variables in Application, or you could have a Config class that is set up when Application starts, i.e. getting the configuration from an XML file, and the rest of classes could access to its properties via getInstance().getSomeProperty() or static properties/methods.

PS: sorry if you get this message twice, but it seems that the previous message was rejected by the server for beeing so long.

Wade Arnold escribió:
Where would you place a your "global" properties? This is a question that
has always got me.
If the properties such as framerate, gatewayURL, styles, etc need to be in
the class application. They have to be there for two reasons.
1. User defined inspectable properties.
2. variables must be available for proper instantiation.


I have always wanted to have a config file, then a worker class that just
handles all the get setters. However I have never been able to pull this off
in order for the application class to wait for the variables to be
populated. Any ideas? I assume I will try again in AS3.

Wade



On 11/22/06 1:56 AM, "Miguel Angel Sánchez" <[EMAIL PROTECTED]> wrote:

There is another approach to communicate those swfs:
- At your side:
1. Class Application (singleton)
2. Class LoadedSWF (or whatever), abstract class that every swf of the
team development will have to extend. This class could implement any
interface you like, and will have a constructor like this:

public function LoadedSWF() {
    Application.getInstance().register(this);
}

3. Your Application class will have a method register where you can
subscribe to LoadedSWF events, or even store a reference to the object
to call any of his methods.

public function register(obj:LoadedSWF):Void {
    obj.addEventListener("event", Delegate.create(this, onEvent));
}

- At the team development side:
1. intrinsic class Application
2. intrinsic class LoadedSWF
3. The class that controls the swf will have to extend LoadedSWF, and
call super() in its constructor
class Whatever extends LoadedSWF {
    public function Whatever() {
        super();
        ...
    }
}

This way everytime you load an external swf of your team development it
automatically notifies your Application class.

PS: so many people from DMSTK around here these days :-)

Ricardo Sánchez escribió:
Man! I must be very dumb, but I don't know how to refer to the class that
implements the interface from the main swf.
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to