Now that Pownce has released an official API covering features such as posting files, I decided to go ahead and make an AS3 library for it. I just posted it to googlecode and have only done minimal testing on it. I would appreciate any feedback.
The Pownce team did a terrific job with the API. Easy to use and consistent. I had minimal issues while creating the as3 library.
In my opinion (yeah you can skip this) Pownce is a far better user experience than Twitter. Its like a gobot and a transformer or a dell laptop and a macbook or chocolate torte and hohos. That is the best I an come up with that the moment, yes.


I could be missing something here… but this API in my mind is a leap forward in the race with twitter.
// Imports omitted for brevity private const APP_KEY:String = "<your app key>"; private var _pownceService:PownceService; private var _testUsername:String = "<Pownce username>"; private var _testPassword:String = "<Pownce password>"; private function initApp():void{ _pownceService = new PownceService(APP_KEY); _pownceService.setAuth(_testUsername, _testPassword); } // Example of posting a file public function testPostAFile():void{ var file:FileReference = new FileReference(); _pownceService.addEventListener(PownceResultEvent.ON_POST_A_FILE, function(event:PownceResultEvent):void{ var pownceResult:PownceNotesResult = event.data as PownceNotesResult; if(pownceResult.success){ trace((pownceResult.notes[0] as PownceNote).body); }else{ trace(pownceResult.statusCode); trace(pownceResult.message); trace(pownceResult.request); } }); file.addEventListener(Event.SELECT, function(event:Event):void{ _pownceService.postAFile("all", event.currentTarget as FileReference, "File upload test"); }); file.addEventListener(ProgressEvent.PROGRESS, function(event:ProgressEvent):void{ trace(event.bytesLoaded + "/" + event.bytesTotal); }); file.browse(); } private function testGetNoteList():void{ _pownceService.addEventListener(PownceResultEvent.ON_GET_NOTE_LIST, function(event:PownceResultEvent):void{ var pownceNoteResult:PownceNotesResult = event.data as PownceNotesResult; if(pownceNoteResult.success){ trace(pownceNoteResult.notes.length); }else{ trace(pownceNoteResult.statusCode); trace(pownceNoteResult.message); trace(pownceNoteResult.request); } }); _pownceService.getNoteList(_testUsername,null, 100, -1, -1); }
I’m going to continue to test the library and improve the documentation. Let me know if I missed anything (outside of OAUTH).
Add me to your Pownce http://pownce.com/InitApp/
Existing issue:
One method is not currently working. It is the retrieval of the send to list. I’ve posted information about the issue to the google pownce group and hopefully it will be resolved soon.




I’ve just finished my flex app for sxsw & pownce (http://www.lesquat.net/pownce/puaw/). I want to add more features, i think i will use your lib.
Awesome Remi. Let me know how it works out.
the api is asking me for ServiceEvent and some other class that are not there. Is that a mistake?
Hey Joshua,
The as3powncelib requires the as3corelib. Download it at the following URL and add it to your project. It contains the ServiceEvent and probably the “other class”.
http://code.google.com/p/as3corelib/downloads/list
Let me know if you have any other issues, i’m happy to help.
Have fun,
Steven
Hi there,
first of all, tnxs for sharing the api with the world. I was looking for a twitter api, couldnt find anything as simple as this one, so our app moved from twitter to pownce…
Although i have one issue, and i dont seem to find whats going on:
Error #2044: securityError no controlado: text=Error #2170: Security sandbox violation: x.swf cannot send HTTP headers to http://api.pownce.com/2.0/note_lists/x.xml?…
Any clues? have this happened before to you?
Hey Goliatone,
That is very cool, but I hope what you’re building is an AIR app. Any of the API commmands that require authentication first, like posting notes needs to be authenticated first. So if you are purely building a online flash application then you will only be able to display notes, just don’t authenticate. The little pownce badge app I put out yesterday works like that.
That being said, there is a potential fix for this. Pownce needs to make a change to their crossdomain xml to allow for these request headers to be passed. I posted a full explanation with a request to the Pownce API forum a while back:
http://groups.google.com/group/pownceapi/browse_thread/thread/f89649a842600074/c712c494aa5b161d?lnk=gst&q=crossdomain.xml#c712c494aa5b161d
You should reply to that thread and appeal to Leah from Pownce to see if you can get them to make the change. I’ll help out however I can.
- Steven