dropbox-as3. Creating new accounts

I have made some changes in the fantastic dropbox-as3 library that allow us to create new dropbox accounts.

Example code to create a new account:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// create dropbox instance
var config:DropboxConfig = new DropboxConfig( "ConsumerKey","ConsumerSecret");
var dropAPI:DropboxClient = new DropboxClient(config);

// assign createAccount events
dropAPI.addEventListener(DropboxEvent.ACCOUNT_CREATE_RESULT, onCreationResult );
dropAPI.addEventListener(DropboxEvent.ACCOUNT_CREATE_FAULT, onCreationFault );

// call createAccount and pass ( email, password --> min 8 chars, first name, last name )
dropAPI.createAccount('email@example.com','12345678','first_name','last_name');

// Event fired on success
public function onCreationResult( e:DropboxEvent ):void
{
trace( 'ACCOUNT_CREATE_RESULT '+e.resultObject.status );
}

// Event fired on error
public function onCreationFault( e:DropboxEvent ):void
{
trace( 'ACCOUNT_CREATE_FAULT '+(e.resultObject as AccountCreationError).toString() );
}

Download source code: dropbox-as3-create-account

UPDATE: This code has been merged into the original repository at http://code.google.com/p/dropbox-as3

StageWebViewBridge. Updated. Automatic cache creation.

StageWebViewBridge class was upgraded with new features for managing files in the cache.

With the new system it is possible to forget if a cached file is updated, the system does everything for us and finally we get 2 output directories. These 2 directories are the directories we must include in our final package release.

The new methods and properties:

1
2
// sets Debug mode on/off
StageWebViewBridge.DEBUGMODE = true/false;
1
2
3
4
5
6
// sets the default dir to 'htmlFiles'
StageWebViewBridge.setRootFolder('htmlFiles');

// this will create 2 new dirs
app:/htmlFilesCache
app:/htmlFilesSource
1
2
3
4
5
// Change the extensions of the files to parse.
// Default extensions are ["html","htm","css","js"]

// now limit the files to be html or js, and left intact the css and htm files
StageWebViewBridge.setSourceFileExtensions(['html','js']);

More info in the official project page: stagewebviewbridge

StageWebView StageWebViewBridge Communicating between actionscript and javascript and vice versa

I have made an extended StageWebView Class that lets you:

* Communicate Actionscript with Javascript.
* Communicate Javascript with Actionscript.
* Load local files and resources in a easy way.
* Extend loadString method with AS3 – JS communication.

By example you can call javascript from as3

1
2
// call javascript with callack function
webView.bridge.call('someFunctionToCall', callBackFunction, ...arguments );

// reference local resources in a easy way

1
<img src="appfile:/image.png">

You can find it at:

http://code.google.com/p/stagewebviewbridge/

I will post a tutorial here…