send a tweet from flash using as2?
I need to send a tweet from flash, so i've been looking for solution on the net, but everything i found is using as3. Since i don't know anything of as3, it becomes difficult to edit everything.
I wonder if it's possible.
Does anybody开发者_运维问答 know a solution?
posting a tweet requires the user being authenicated via OAuth. so assuming you have a user authenicated, you can just POST data to this URL:
http://twitter.com/statuses/update.xml
w/ post vars: status
, in_reply_to_status_id
(optional)
something like this:
var lv:LoadVars = new LoadVars()
lv.status = 'mystatus'
lv.in_reply_to_status_id = 'XXXXXX'
lv.onData = myDataHandlerFunction
lv.sendAndLoad( 'http://twitter.com/statuses/update.xml', lv, 'POST');
The authentication process for OAuth is fairly complex. There are a few OAuth libs out there for flash, but all are AS3.
If you really are set on AS2, you can use a serverside OAuth library that you can interface your AS2 app with. Something like twitteroauth
All signs point to learning AS3 if you plan on doing any real Flash/Twitter work, but you can get up and running with AS2 with a little more work.
精彩评论