Skip to content

Commit

Permalink
add: faceAPI.account
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Mederak committed Nov 16, 2011
1 parent 40cd19e commit a399a11
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 5 deletions.
25 changes: 25 additions & 0 deletions .settings/launch/AccountLimitsExample.launch
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.powerflasher.fdt.ui.MxmlcGroup">
<stringAttribute key="ADL_ARGUMENTS" value=""/>
<stringAttribute key="APP_ARGUMENTS" value=""/>
<stringAttribute key="ARGUMENTS" value=""/>
<booleanAttribute key="KILL_PREVIOUS_VIEWER" value="true"/>
<stringAttribute key="LAUNCHER_DEPENDENCIES" value="[Self]"/>
<stringAttribute key="MAIN_CLASS" value="src/examples/AccountLimitsExample.as"/>
<stringAttribute key="OUTPUT" value="bin/AccountLimitsExample.swf"/>
<booleanAttribute key="PASS_CP" value="true"/>
<booleanAttribute key="PASS_MAIN_CLASS" value="true"/>
<booleanAttribute key="PASS_RSLS" value="false"/>
<booleanAttribute key="PASS_SWCS" value="true"/>
<stringAttribute key="PROJECT_NAME" value="Face.com API"/>
<booleanAttribute key="START_SWF_ENABLED" value="true"/>
<stringAttribute key="START_SWF_LOCATION" value="bin/AccountLimitsExample.swf"/>
<stringAttribute key="START_SWF_WITH" value="External SWF Viewer"/>
<booleanAttribute key="USE_PROJECT_COMPILER_ARGUMENTS" value="true"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/Face.com API"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
</launchConfiguration>
25 changes: 25 additions & 0 deletions .settings/launch/FacesStatusExample.launch
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.powerflasher.fdt.ui.MxmlcGroup">
<stringAttribute key="ADL_ARGUMENTS" value=""/>
<stringAttribute key="APP_ARGUMENTS" value=""/>
<stringAttribute key="ARGUMENTS" value=""/>
<booleanAttribute key="KILL_PREVIOUS_VIEWER" value="true"/>
<stringAttribute key="LAUNCHER_DEPENDENCIES" value="[Self]"/>
<stringAttribute key="MAIN_CLASS" value="src/examples/FacesStatusExample.as"/>
<stringAttribute key="OUTPUT" value="bin/FacesStatusExample.swf"/>
<booleanAttribute key="PASS_CP" value="true"/>
<booleanAttribute key="PASS_MAIN_CLASS" value="true"/>
<booleanAttribute key="PASS_RSLS" value="false"/>
<booleanAttribute key="PASS_SWCS" value="true"/>
<stringAttribute key="PROJECT_NAME" value="Face.com API"/>
<booleanAttribute key="START_SWF_ENABLED" value="true"/>
<stringAttribute key="START_SWF_LOCATION" value="bin/FacesStatusExample.swf"/>
<stringAttribute key="START_SWF_WITH" value="External SWF Viewer"/>
<booleanAttribute key="USE_PROJECT_COMPILER_ARGUMENTS" value="true"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/Face.com API"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
</launchConfiguration>
Binary file added bin/AccountLimitsExample.swf
Binary file not shown.
Binary file removed bin/AccountStatusExample.swf
Binary file not shown.
Binary file added bin/FacesStatusExample.swf
Binary file not shown.
38 changes: 38 additions & 0 deletions src/examples/AccountLimitsExample.as
@@ -0,0 +1,38 @@
package examples {
import facecom.api.FaceAPI;
import facecom.api.events.FaceAPIEvent;

import flash.display.Sprite;
import flash.events.IOErrorEvent;


/**
* @author medec
*/
public class AccountLimitsExample extends Sprite {
private var faceAPI : FaceAPI;

public function AccountLimitsExample() {
init();
}

private function init() : void {
faceAPI = new FaceAPI('228f62cbac5d536b33318268c6f3bb7d', '848436c04c57ea431965f0a7a76557de');

faceAPI.addEventListener(IOErrorEvent.IO_ERROR, faceAPIIOError);
faceAPI.addEventListener(FaceAPIEvent.ACCOUNT_LIMITS, accountLimitsHandler);

//faceAPI.faces.status('all@testnamespace', 'testnamespace');
faceAPI.account.limits();

}

private function accountLimitsHandler(event : FaceAPIEvent) : void {
trace('limits: ' + event.data);
}

private function faceAPIIOError(event : IOErrorEvent) : void {
trace('error', event);
}
}
}
Expand Up @@ -9,9 +9,9 @@ package examples {
/**
* @author medec
*/
public class AccountStatusExample extends Sprite {
public class FacesStatusExample extends Sprite {
private var faceAPI : FaceAPI;
public function AccountStatusExample() {
public function FacesStatusExample() {
init();
}

Expand Down
6 changes: 3 additions & 3 deletions src/facecom/api/FaceAPI.as
Expand Up @@ -44,14 +44,14 @@ package facecom.api {
private var _faces : FacesProxy;
private var _account : AccountProxy;
private var _tags:TagsProxy;

private var names : Object;


public function FaceAPI(apiKey : String, apiSecret : String = '') {
this.apiKey = apiKey;
this.apiSecret = apiSecret;

_faces = new FacesProxy(this);
_account = new AccountProxy(this);
_tags = new TagsProxy(this);

jpgEncoder = new JPGEncoder(40);
}
Expand Down

0 comments on commit a399a11

Please sign in to comment.