ActionScript 3 Client Library
last revision: 5/4/2008
We provide a compiled Adobe Flex ActionScript3 library (imeem.api.swc) that wraps the web services to provide access to imeem's media library, social graph and media features. Additionally, the AS3 library provides a media playback class for streaming and playing back music and videos from the imeem media library. The only required UI is the imeem toolbar that should be displayed at the bottom of your application. This gives the developer the freedom to fully control the user experience.
All web services calls are accessible through the imeem class. Simply instantiate an imeem class and begin making method calls. All methods are grouped logically into the following groups: users, media, playlists, and friends. Each group is accessible through a property on the imeem class. A callback approach is used for handling the asynchronous web service calls. Therefore each method call takes a callback function which has one parameter of type ResultData. If desired, you can provide an arbitrary context object that is passed back to you in the callback function. When the results are retrieved, your callback function is called with the appropriate ResultData.
The imeem class constructor requires an apiKey and apiSecret which is issued to the app developer upon creating an application.
For example, if you want to perform a music search on imeem, you could do the following:
private var imeem:Imeem = new Imeem(apiKey, apiSecret);
imeem.music.search(“linkin park”, 0, 100, onSearchResultsCallback, “linkin park”);
private function onSearchResultsCallback(result:ResultData):void
{
if (result.success)
trace(‘onSearchResultsCallback success: ‘ + result.context);
else
trace(‘onSearchResultsCallback error: ‘ + result.context);
}
ResultData contains a status property, the original context object that was passed into the call, as well as a data object. The data object is typically an array of MusicData, PhotoData, PlaylistData, or VideoData objects, depending on the method called.
Available Classes