Flex 3: How do I get URL
I'm setting up a twitter button on my Flex 3 site. I've got it working, but the URL info it uses is static--- www.mysite.com, for example. I want to make it so that twitter button interacts with whatever "page" the user is looking at. But, I don't know how to grab the current URL. So, for example, if the user is looking at: http://www.my开发者_开发技巧site.com/#view=2 how do I get that information. Or if they're looking at http://www.mysite.com/#view=44, how do I get that the URL?
Thank you.
-Laxmidi
This should work.
var browserUrl:String = ExternalInterface.call('window.location.href.toString');
You'll want to use JavaScript to obtain the location object. Look into the AS3 class ExternalInterface.
精彩评论