Presentation is loading. Please wait.

Presentation is loading. Please wait.

Wave Actionscript API (wave-as-client) Sung Wu 2009/06/07.

Similar presentations


Presentation on theme: "Wave Actionscript API (wave-as-client) Sung Wu 2009/06/07."— Presentation transcript:

1 Wave Actionscript API (wave-as-client) Sung Wu 2009/06/07

2 Agenda Intro Intro Architecture Architecture API API Code example Code example

3 Introduction A Flex library for accessing Google Wave Gadget API A Flex library for accessing Google Wave Gadget API AS3 AS3 Opensource Opensource http://code.google.com/p/wave-as-client

4 Architecture Wave Gadget Your swf Wave Gadget Javascript API Browser Wave-as-client library ExternalInterface.call callback

5 Wave Actionscript Gadget API Wave getParticipants() getViewer() getHost() getState() getTime() setParticipantCallback() setStateCallback() isInWaveContainer() isPlayback() WaveState getKeys() getStringValue(key, opt_default) submitDelta(delta) WaveParticipant getId() getDisplayName() getThumbnailUrl() This diagram is inspired by diagram in Google I/O presentation: http://code.google.com/events/io/sessions/ProgrammingWithAndForGoogleWave.html

6 Design Decisions Uses waves gadget javascript API Uses waves gadget javascript API For state callback and participant callback, do ExternalInterface.registerCallback() For state callback and participant callback, do ExternalInterface.registerCallback() Assumes that there is only one state at a time to make things simple Assumes that there is only one state at a time to make things simple

7 Code sample: state callback private function init():void { // remember that you can only create // one instance of Wave in the application. var wave = new Wave(); wave.setStateCallback(stateCallback); } /** * @param state - WaveState object */ private function stateCallback(state:Object):void { // you can use wave.getState() to get current state. Alert.show("stateCallback being called."); }

8 Code Sample: changeState // submit a key-vlaue pair of var delta:Object = {}; delta.testkey = new Date().getTime(); wave.getState().submitDelta(delta); // you should get stateCallback after you submitDelta.

9 Resource Project site: http://code.google.com/p/wave-as-cleint Project site: http://code.google.com/p/wave-as-cleint http://code.google.com/p/wave-as-cleint Blog: http://nextgenapp.blogspot.com Blog: http://nextgenapp.blogspot.comhttp://nextgenapp.blogspot.com Contact: Sung Wu apiswswsw@gmail.com Contact: Sung Wu apiswswsw@gmail.com

10 Status 2009/06/07: Most of the major functionalities are working. It is tested on Wave developer sandbox. 2009/06/07: Most of the major functionalities are working. It is tested on Wave developer sandbox.


Download ppt "Wave Actionscript API (wave-as-client) Sung Wu 2009/06/07."

Similar presentations


Ads by Google