How can I get the application itself full path in actionscript?
Asked
Active
Viewed 364 times
0
-
Actionscript or Flex app? server side or client installed application directory? – Glycerine Nov 19 '10 at 12:41
-
I build a flex app, the code is in actionscript for client desktop – Proyb2 Nov 19 '10 at 13:10
-
It will get the C:\program files\ location. – Proyb2 Nov 19 '10 at 13:11
2 Answers
2
If you're using AIR, stage.loaderInfo.url
will return app:/[SWF name].swf. Combine that with File.applicationDirectory.nativePath
and voila.
Update: For in-browser app, Application.application.url or stage.loaderInfo.url should be enough (full url with params (not flashvars, url params if any - ...swf?param1=1.))

alxx
- 9,897
- 4
- 26
- 41
-
+1 I believe this would work for Flash Player apps as well. Not sure about the use of "stage" though, maybe in Flash. – JD Isaacks Nov 19 '10 at 14:03
-
-
I was not referring to the File part, I was referring to the loaderInfo.url part. – JD Isaacks Nov 19 '10 at 14:27
1
If you are using Flex the root class Application
for Flash Player and WindowedApplication
for AIR.
Has a url property which returns:
The URL from which this Application's SWF file was loaded.

JD Isaacks
- 56,088
- 93
- 276
- 422
-
In AIR that url will be app:/[SWF name].swf since it starts from app location. – alxx Nov 19 '10 at 14:18