Welcome to Viewzoo!  |  Log In  |  Sign Up
Downloads

Quick access to downloads. That's what we're all about.

Archives

May, 2007

Flash Client API Documentation
Learning Guide
Flash Client API Documentation
cmancini, cofounder & vp of products
May 30, 2007    Discuss
Class DataPull com.viewzi.core.DataPull
The DataPull class is the mechanism for query data from the Viewzi servers into flash. To use the DataPull class you must first do the following:
  1. Drag the ViewziDataPull library to the stage.
  2. Import the DataPull class in the first frame of the Flash application by placing the following import statement at the beginning of your application:
  3. import com.viewzi.core.DataPull;

Example

The following example instantiates an instance of the DataPull class named foo, sets up an eventListener, and calls the queryData method to request flickr photo results. var foo = new com.viewzi.core.DataPull(); foo.addEventListener("dataResult", this); foo.queryData("flickr_01", "bono", ["flickr"]); function dataResult(param) { for (var x=0; x<param.eventData.length; x++) { trace(x+")"+param.eventData[x].url); } }
PROPERTIES pendingPulls:Number -the total number of data pull calls pending the server at that moment in time.
METHODS queryData (uID:String, term:String, sourceList:Array, procList:Array, resultLength:Number, resultPage:Number) :Boolean Request the data from the server via the given parameters. Parameters
  1. uID:String - this is a unique identifier to watch for in the return event so you can react to the given data pull accordingly.
  2. term:String - if live UI, the term will be added onto the search term, if the authoring environment, it is the search term.
  3. sourceList:Array - an array of data source keys to query the term from. data source keys are strings.
  4. procList:Array - an array of processors keys to run on the data source nodes. processor keys are strings.
  5. resultLength:Number - the total amount of data nodes to return.
  6. resultPage:Number - the page which to begin returning results at (zero is page 1)

Example

foo.queryData("testPull01", "dallas", ["yhoo", "goog"], ["screenshot", "dedupe"], 20, 0);
EVENTS dataResult (dataObj:Object) The return result of the webcall with its associated data. Parameters
  1. dataObj.target:Object - the DataPull class object
  2. dataObj.type:String - "dataResult"
  3. dataObj.id:String - your unique identified passed to the queryData method
  4. dataObj.eventData:Object - indexed array of data nodes based upon your data source and processors passed into the queryData method