|
Project Information
Links
|
What is it?BasecampAS3Lib is an Actionscript 3 wrapper library for the Basecamp REST API. Basecamp is a project management, collaboration and task solution built by 37signals. The library can be used by Flex, Flash applications built with Adobe AIR. At the moment there is still a problem with browser applications because the basic authentication isn't working in the browser. Important
Code example<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:basecamp="net.hufkens.basecamp.*"
xmlns:services="net.hufkens.basecamp.services.*"
layout="absolute">
<mx:VBox width="100%" height="100%">
<mx:HBox width="100%">
<mx:Label text="url:"/>
<mx:TextInput id="apiurl" width="100"/>
<mx:Label text="username:"/>
<mx:TextInput id="username" width="100"/>
<mx:Label text="password:"/>
<mx:TextInput id="password" width="100"/>
<mx:Button label="get projects" click="getProjects()"/>
</mx:HBox>
<mx:DataGrid dataProvider="{projects}" width="100%" height="100%"/>
</mx:VBox>
<basecamp:BasecampAPI id="api" url="{apiurl.text}" username="{username.text}" password="{password.text}"/>
<mx:ArrayCollection id="projects"/>
<mx:Script>
<![CDATA[
import net.hufkens.basecamp.events.BasecampEvent;
private function getProjects():void {
api.projectService.addEventListener(BasecampEvent.GET_LIST, handleGetList);
api.projectService.addEventListener(BasecampEvent.FAIL, handleFail);
api.projectService.getList();
}
private function handleGetList(event:BasecampEvent):void {
projects = new ArrayCollection(event.data as Array);
}
private function handleFail(event:BasecampEvent):void {
Alert.show(event.data as String);
}
]]>
</mx:Script>
</mx:WindowedApplication>If you have any comments or feedback please add it here. More infoYou can read more about this on my blog or follow me on Twitter for more info about this library. |