|
goToPage Method
Description
This method retrieves the specified page of video search results for the current set of videos.
Arguments
This method accepts the following arguments:
|
pageNum
|
Integer. Required.
The page number of the set of video search results to return.
|
Syntax
The following code sample illustrates how this method can be invoked:
var TVS = new TruveoVideoSearch(appid);
...
TVS.goToPage(pageNum);
Return Value
This method returns 'true' if the XML API request was sent successfully. It returns 'false' if there is no VideoSet available; this is likely caused because the getVideos method was not invoked prior to invoking this method.
Response Data Objects
The response returned by this method can update the following data objects:
|
method
|
A string containing the name of the API method used to retrieve the response. In this case, this field would return the string 'goToPage'.
Usage syntax: myVar = TVS.method;
|
|
query
|
A string containing the original submitted query associated with this response.
Usage syntax: myVar = TVS.query;
|
|
querySuggestion
|
A string containing a suggested query, if available, for the original submitted query associated with this response.
Usage syntax: myVar = TVS.querySuggestion;
|
|
VideoSet
|
The container for all of the video records in the set of returned videos.
More details on the structure and attributes of this data object can be found here.
Usage syntax: myVar = TVS.VideoSet;
|
|
TagSet
|
The container for all of the tags associated with the entire set of matching videos. The TagSet is returned only if the parameter 'showRelatedItems' is set to 1.
More details on the structure and attributes of this data object can be found here.
Usage syntax: myVar = TVS.TagSet;
|
|
ChannelSet
|
The container for all of the channels associated with the entire set of matching videos. The ChannelSet is returned only if the parameter 'showRelatedItems' is set to 1.
More details on the structure and attributes of this data object can be found here.
Usage syntax: myVar = TVS.ChannelSet;
|
|
CategorySet
|
The container for all of the categories associated with the entire set of matching videos. The CategorySet is returned only if the parameter 'showRelatedItems' is set to 1.
More details on the structure and attributes of this data object can be found here.
Usage syntax: myVar = TVS.CategorySet;
|
|
UserSet
|
The container for all of the users associated with the entire set of matching videos. The UserSet is returned only if the parameter 'showRelatedItems' is set to 1.
More details on the structure and attributes of this data object can be found here.
Usage syntax: myVar = TVS.UserSet;
|
Events
This method can fire the following events:
|
onupdate
|
This event fires when a response to an Flash request
is received by the TruveoVideoSearch object. When this event fires, it will pass one argument, 'eventObj', of type com.truveo.flash.TruveoUpdateEvent to any handler attached to this event.
In addition to the standard properties associated with event objects in ActionScript, 'eventObj' will have a property
'methodName' that will be set to the name of the method that issued the original Flash request associated with this onupdate event.
Event binding syntax: TVS.addEventListener('onupdate', myHandler);
|
|
onerror
|
This event fires when an error occurs.
When this event fires, it will pass one argument, 'eventObj', of type com.truveo.flash.TruveoErrorEvent to any handler attached to this event. In addition to the standard
properties associated with event objects in ActionScript, 'eventObj' will have two properties set: 'errorCode' and 'errorMessage'. The value
of 'eventObj.errorCode' will be the numerical code assigned to the error and 'eventObj.errorMessage' will be a text message that describes the error.
Event binding syntax: TVS.addEventListener('onerror', myHandler);
|
Errors
If execution of this method is not successful, the errors with the following error codes can be thrown:
|
400
|
Bad API request or API Service unavailable. Check that the parameters to the request are correctly specified.
A method of the Flash API was called with incorrect arguments or the XML API service is unavailable.
|
|