My account
Shopping cart
Knowledge base
Support


JC Play List Methods



Overview | Properties | Methods | Events | XML

Method Description
addItem(item:Object):void Adds a new item to the list. The item is created based on the properties of the object sent as parameter.

Parameters
item:Object - the object on which the new item will be created. The new item will have the exact same properties as the object sent as parameter.

Usage:
var myItem:Object = new Object();
myItem.title = "A new item";
myItem.description = "Some sort of description for this item";
myItem.thumbnail = "thumbnail_image.jpg";
myItem.content = "some_video.flv";
componentInstance.addItem(myItem);
addItemAt(item:Object, index:uint):void Adds a new item to the list. The item is created based on the properties of the object sent as parameter. The index of the first item in the list is 1 so it should always be greater than 0. If the index is greater than the maximum number of items in the list, than the new item will be added at the end of the list.

Parameters
item:Object - the object on which the new item will be created. The new item will have the exact same properties as the object sent as parameter.
index:uint - the position where the new item will be added to. Must be greater than 0.

Usage:
var myItem:Object = new Object();
myItem.title = "A new item";
myItem.description = "Some sort of description for this item";
myItem.thumbnail = "thumbnail_image.jpg";
myItem.content = "some_video.flv";
componentInstance.addItemAt(myItem, 3);
getItemAt(index:uint):Object Returns the item from the list that has the index specified as parameter. The index of the first item in the list is 1. The JCPlayListEvent.ITEM_SELECT event is not dispatched.

Parameters
index:uint - the index of the item to select. The list has a 1-based index, meaning that the first item has the index 1 and not 0.

Returns
- the item object that has the index specified as parameter or null if there was no item that with that index in the list.

Usage:
myItem = componentInstance.getItemAt(3);
getItemByProperty(propName: String, propValue:*):Object Returns the item from the list that has the property with the name and value specified as parameters. The JCPlayListEvent.ITEM_SELECT event is not dispatched.

Parameters
propName:String - the name of the property to look for.
propValue:* - the value of the property looked up by the component in the list.

Returns
- the item object that has the property and value specified as parameters or null if there was no item that corresponds to the parameters.

Usage:
myItem = componentInstance. getItemByProperty("title", "A new item");
getXML():XML Returns the XML object from which the list was generated. The structure of the XML object depends on the type of feed used by the component: regular .xml file, flickr rss or picasa rss feed.

Returns
- the XML object of the list.

Usage:
myXML = componentInstance.getXML();
next():void Selects the next item from the list. If the next item is not on the currently visible page, it also navigates to the next page to display the item. If the currently selected item is the last item in the list, then nextItem() will not have any effect, but it will however dispatch the JCPlayListEvent.ITEM_SELECT event.

Usage:
componentInstance.next();
nextPage():void Slides the list to display the next page of items. In this case there is no item selection, therefor the JCPlayListEvent.ITEM_SELECT event is not dispatched.

Usage:
componentInstance.nextPage();
pause():void Stops the slide show of the list.

Usage:
componentInstance.pause();
play():void Starts the slide show of the list. If the slide show has been previously paused, it continues from the next item. Each selection of an item during the slide show, causes a dispatch of the JCPlayListEvent.ITEM_SELECT event.

Usage:
componentInstance.play();
previous():void Selects the previous item from the list. If the previous item is not on the currently visible page, it also navigates to the previous page to display the item. If the currently selected item is the first item in the list, then previousItem() will not have any effect, but it will however dispatch the JCPlayListEvent.ITEM_SELECT event.

Usage:
componentInstance.previous();
previousPage():void Slides the list to display the previous page of items. In this case there is no item selection, therefor the JCPlayListEvent.ITEM_SELECT event is not dispatched.

Usage:
componentInstance.previousPage();
random():void Randomly selects an item from the list and dispatches the JCPlayListEvent.ITEM_SELECT event.

Usage:
componentInstance.random();
removeAll():void Removes all the items from the list and the component is redrawn.

Usage:
componentInstance.removeAll();
removeItem(item:Object): Boolean Removes an item from the list. The parameter must be one of the objects contained in the items Array property.

Parameters
item:Object - one of the objects from the list of items. That object can be retrieved from the items property or by using one of the getItemAt() or getItemByProperty() methods.

Returns
- true if the item has been successfully removed or false if the item could not be removed (there was no item to remove or there was an error during the process).

Usage:
var itemToRemove:Object = componentInstance.items[3];
componentInstance.removeItem(itemToRemove);
removeItemAt(index:uint): Boolean Removes from the list the item located at the index specified as parameter. The index of the first item in the list is 1.

Parameters
index:uint - the index of the item that will be removed.

Returns
- true if the item has been successfully removed or false if the item could not be removed (there was no item to remove or there was an error during the process).

Usage:
var isDeleted:Boolean = componentInstance.removeItemAt(3);
if (isDeleted) trace("The item has been removed.");
removeItemByProperty( propName: String, propValue:*):Boolean Removes an item from the list, that has the property name and value specified as parameters.

Parameters
propName:String - the name of the property to look for.
propValue:* - the value of the property looked up by the component in the list.

Returns
- true if the item has been successfully removed or false if the item could not be removed (there was no item to remove or there was an error during the process).

Usage:
componentInstance.removeItemByProperty( "thumbnail", "my_image.jpg");
scrollToItem(item:Object):void Scrolls the list to the item specified as parameter. The JCPlayListEvent.ITEM_SELECT event is not dispatched.

Parameters
item:Object - the item where the list should scroll to.

Usage:
var myItem:Object = componentInstance.items[4];
componentInstance.scrollToItem(myItem);
scrollToItemAt(index:uint):void Scrolls the list to the item specified as parameter. The JCPlayListEvent.ITEM_SELECT event is not dispatched.

Parameters
index:uint - the index of the item where the item should scroll to. The index must be an integer greater than 0 - the index of the first item in the list is 1.

Usage:
componentInstance.scrollToItemAt(2);
scrollToItemByProperty( propName: String, propValue:*):void Scrolls the list to the item that has the property name and value specified as parameters. The JCPlayListEvent.ITEM_SELECT event is not dispatched.

Parameters
propName:String - the name of the property to look for.
propValue:* - the value of the property looked up by the component in the list.

Usage:
componentInstance.scrollToItemByProperty( "title", "A new item");
selectItemAt(index:uint, allowReselect:Boolean):Object Selects the item from the list that has the index specified as parameter. The index of the first item in the list is 1. The JCPlayListEvent.ITEM_SELECT event is dispatched.

Parameters
index:uint - the index of the item to select. The list has a 1-based index, meaning that the first item has the index 1 and not 0.
allowReselect:Boolean - specifies whether the content of the item will be set again on the target viewer object (a loader or an audio/video player component). If true, the target viewer object will reload the content.

Returns
- the item object that has just been selected or null if there was no item that corresponds to the index given as parameter.

Usage:
myItem = componentInstance.selectItemAt(3, false);
selectItemByProperty(propName: String, propValue:*):Object Selects the item from the list that has the property with the name and value specified as parameters. The JCPlayListEvent.ITEM_SELECT event is dispatched.

Parameters
propName:String - the name of the property to look for.
propValue:* - the value of the property looked up by the component in the list.

Returns
- the item object that has just been selected or null if there was no item that has the property and value specified as parameters.

Usage:
myItem = componentInstance. selectItemByProperty("width", 20);
setXML(myXML:XML):void Sets a new XML object from which the component will create a new list. This forces the component to redraw itself.

Parameters
myXML:XML - the new XML object on which the new list will be based on.

Usage:
componentInstance.setXML(myXML);

Overview | Properties | Methods | Events | XML

The pack contains the .mxp install file, the documentation file and the sample files.
Fully free component
Easy visual representation of multimedia lists
Compatibility with other components
Fully customizable skin