If your Application's initialize handler has set
public var init:Object;
in the Application's <mx:Script>, then you can access this Object from
any class as
Application.application.init
if you import mx.core.Application.
BTW, MXML files simply get translated by the MXML compiler into AS3
classes. Everything in Flex is just AS3 classes at runtime. The MXML
compiler simply makes doing various things such as creating a visual
hiearchy of UIComponents, initializing styles from CSS, or databinding
much easier than coding these from scratch in AS3.
- Gordon
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of thierrybertossa
Sent: Thursday, March 08, 2007 12:50 AM
To: [email protected]
Subject: [flexcoders] Init Global Object Best Practice
With the Application's initialize event, I instanciate a unique -init-
Object.
How can I access This instance inside another Class ?
-instanceName-.variable doesn't work inside other Class?
I don't really understand the probleme.
What is the Best Practice to link AS3 OOP and The Flex MXML?