Question
AS3: Getting loaderURL from Singleton
Hi,
Running into a bit of problem with ActionScript 3 at the mo. Maybe someone here can help me out.
Does anyone know in actionscript 3 how to get the current flash movie url (the old _root._url, now loaderInfo.loaderURL) from the context of a singleton class?
I know this can normally be accessed from the stage property of any DisplayObject in the display list but the problem is:
* My singleton is not a DisplayObject
* I cannot use a temporary DisplayObject (like a Sprite) within the singleton because a DisplayObject's "stage" or "loaderInfo" property is only instantiated when the DisplayObject is added to the display list. Before that it's always null. And since my singleton is not in the display list I can never make that temporary object part of it.
So... does anyone know how I can retrieve in such a case the url of the current movie (the old _root._url) ?
Cheers
Ben
Running into a bit of problem with ActionScript 3 at the mo. Maybe someone here can help me out.
Does anyone know in actionscript 3 how to get the current flash movie url (the old _root._url, now loaderInfo.loaderURL) from the context of a singleton class?
I know this can normally be accessed from the stage property of any DisplayObject in the display list but the problem is:
* My singleton is not a DisplayObject
* I cannot use a temporary DisplayObject (like a Sprite) within the singleton because a DisplayObject's "stage" or "loaderInfo" property is only instantiated when the DisplayObject is added to the display list. Before that it's always null. And since my singleton is not in the display list I can never make that temporary object part of it.
So... does anyone know how I can retrieve in such a case the url of the current movie (the old _root._url) ?
Cheers
Ben