简体   繁体   English

Flex 3:如何获取网址

[英]Flex 3: How do I get URL

I'm setting up a twitter button on my Flex 3 site. 我在Flex 3网站上设置了一个twitter按钮。 I've got it working, but the URL info it uses is static--- www.mysite.com, for example. 我可以使用它,但是它使用的URL信息是静态的,例如www.mysite.com。 I want to make it so that twitter button interacts with whatever "page" the user is looking at. 我要使Twitter按钮与用户正在查看的任何“页面”进行交互。 But, I don't know how to grab the current URL. 但是,我不知道如何获取当前URL。 So, for example, if the user is looking at: http://www.mysite.com/#view=2 how do I get that information. 因此,例如,如果用户正在查看: http : //www.mysite.com/#view=2我如何获取该信息。 Or if they're looking at http://www.mysite.com/#view=44 , how do I get that the URL? 或者,如果他们正在查看http://www.mysite.com/#view=44 ,如何获得该URL?

Thank you. 谢谢。

-Laxmidi -Laxmidi

这应该工作。

var browserUrl:String = ExternalInterface.call('window.location.href.toString');

You'll want to use JavaScript to obtain the location object. 您将要使用JavaScript来获取location对象。 Look into the AS3 class ExternalInterface. 查看AS3类ExternalInterface。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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