protected function onApplicationCreationComplete( event : FlexEvent ) : void
{
var xURL : String = FlexGlobals.topLevelApplication.url;
// ...
// next fragment of code
}
next fragment of code will be executed before xURL receive the application URL.
How to capture when the FlexGlobals.topLevelApplication.url is ready?
This property is set in Application’s initialize function.
You can try to override it and read url property after call to super.initialize()