Welcome to Viewzoo!  |  Log In  |  Sign Up
Navigation
  1. Wiki Home
  2. Categories
  3. Title List
  4. Recent Changes
  5. RSS
  6. Atom
Active Members

 

Search the Wiki

 

Create or Find a Page

 
View FlashAPIDoc
API Documentation

com.viewzi.view.API
Class API

The Viewzi API class is the mechanism for querying data from the Viewzi servers into flash and modifying it for display/view purposes. To use the Viewzi API class, you must first do the following:

1. Download the Viewzi API zip file and uncompress it.
2. the /lib/ directory of the zip file contents contains the classes. move them to your class path (or point your FLA's AS 2.0 class path to the directory via publish settings).
3. Also included in the lib directory are the appropriate adobe data, remoting, and rpc classes if you need them.

var V = new com.viewzi.view.API();

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 p = (_root.p) ? _root.p : "bono";
var V = new com.viewzi.view.API();
V.addEventListener("dataResult", this);

function dataResult (evt)
{
trace("[STAGE] GOT DATA : " +evt.id);
}

V.dataPull("test_pull", p, ["yhoo","goog"], ["dedupe"], 0, 20);


PROPERTIES


pendingPulls:Number
- the total number of data pull calls pending the server at that moment in time.

METHODS


dataPull(uID:String, term:String, sourceList:Array, procList:Array, startNode:Number, endNode:Number) : Boolean

uID:String - this is a unique identifier to watch for in the return event so you can react to the given data pull accordingly.
term:String - if live UI, the term will be added onto the search term, if the authoring environment, it is the search term.
sourceList:Array - an array of data source keys to query the term from. data source keys are strings. see the DataProvAPIDoc.
procList:Array - an array of processors keys to run on the data source nodes. processor keys are strings.
startNode:Number - the first data nodes to return.
endNode:Number - the last data node to return

loaderObj.createSpinner(target:Movieclip, _x:Number, _y:Number, color:Hex, size:Number);

target:Movieclip mc where you want the spinner to be placed
_x:Number x position of the spinner in the target mc
_y:Number y position of the spinner in the target mc
color:Hex the hex color you want the spinner to be (ex: 0xFFFFFF)
size:Number the size in pixels you want the spinner to be
RETURNS: movieclip reference to the spinner MC created

msgObj.throwMessage(callID:String, iconType:String, message:String);

callID:String the unique identifier for this message throw
iconType:String the icon to use ["alert", "flag", "notes"]
message:String the message to display

msgObj.throwDialog(callID:String, type:String, iconType:String, title:String, message:String, fieldName:String)

callID:String the unique identifier for this message throw
type:String the type of dialog box ["input"]
iconType:String the icon to use ["alert", "flag", "notes"]
title:String the title of the dialog box
message:String the message to display
fieldName:String the field name to return from the user

dataStoreObj.getData(dataAccess:Mixed)

dataAccess:Mixed can be an * for everything, a single ds, or an array of DS keys

utilObj.createTagCloud(dataObj:Array, useTitles:Boolean, dataCloud:Array)

dataObj:Array an array of data from the server or the datastore
useTitles use the titles for data nodes w/o a proper tags field?
dataCloud an existing data tag cloud to append onto


Examples


foo.dataPull("testPull01", "dallas", ["yhoo", "goog"], ["screenshot", "dedupe"], 0, 20);

EVENTS


dataResult(evt:Object)

The return result of the webcall with its associated data.

Parameters


evt.type:String - "dataResult"
evt.id:String - your unique identified passed to the queryData method
evt.eventData:Object - indexed array of data nodes based upon your data source and processors passed into the queryData method