How to get url from an SWF in Actionscript 3
Posted on October 10, 2007Adobe sure did change alot with this new Actionscript 3 stuff. With all the extra hoops you have to jump through just to do something simple, they still somehow managed to make Flash 9 ten times faster.
of those is the _url field. It was a complete pain in the butt trying to figure out, but it’s not that bad. It’s all in the LoaderInfo() class.
Define it by doing something like so,
public var linfo:LoaderInfo = new LoaderInfo()
Don’t forget to…
import flash.display.LoaderInfo
Now anytime you want to refer to the url of the loaded SWF file, simply call
linfo.url
It’s that simple.
Categories: Uncategorized