Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flash security error - Twitter API

I'm trying to hit the Twitter API in my Flash application. It works in the local Flash IDE, but doesn't work when I upload it to my server. I'm getting this error:

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http//alpha.{oursite}.com/flash/twitterticker.swf cannot load data from http//twitter.com/statuses/user_timeline/{ouraccount}.xml.

[ignore the lack of a ":" in the http:// in the error msg - I don't have enough of a reputation yet to post more than one hyperlink :-)]

When I look in Charles, it appears that the error is related to not finding an entry for my website in Twitter's crossdomain.xml file. As far as I know, this is not a requirement to use their API. Is there something I'm missing?

TIA!

Steve W

like image 607
Steve W Avatar asked Sep 24 '26 02:09

Steve W


1 Answers

Looking at the crossdomain file at http://twitter.com/crossdomain.xml you won't be able to directly call the twitter API from flash.

You are going to either need a serverside proxy, or use ExternalInterface bi-directional communication since javascript can bypass the sandbox using JSONP

The twitter API site has several links to ready written twitter implementations for Flash. Maybe you can use one of their serverside proxies.

like image 188
Les Avatar answered Sep 26 '26 16:09

Les



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!