简体   繁体   中英

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.mysite.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

这应该工作。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM