简体   繁体   中英

Flex3: How Do I Add a Twitter Share Button?

I've got a Flex 3 website. How do I add a Twitter share button?

Thank you.

-Laxmidi

Just use a regular Flex Button that links to twitter. Conceptually something like this:

<mx:Button id="TwitterButton" click="onClick()" />

The onClick method should just create a new URLRequest and the navigate to it.

<mx:script>
 public function onClick():void{
   var urlRequest = new URLRquest('/http://twitter.com/share?url=http://bit.ly/fKYLIN&text=I just got a free Flex AutoComplete Component courtesy of @Flextras It rocks! Be sure to get your own');
   navigateToURL(urlRequest);
 }
</mx:script>

The twitter URL format should be documented somewhere in the twitter help. Start here and then go here .

You should factually use the Twitter AS3 API. Sharing on twitter is just a function call away, if you use that API. You can get the details here

我找到了本教程,其中显示了如何做: 链接

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