Double-click the Bound To field in the Component inspector to open the Bound To dialog
17.
box.
In the Component Path field, select "DataSet <userData>" from the Component Path column,
18.
and then select "selectedIndex : Number" from the Schema Location column.
Enter the following code in the Actions panel:
19.
nextBtn.addEventListener("click", nextBtnClick);
function nextBtnClick(eventObj:Object):Void {
userData.next();
}
This code uses the
object's collection of items. Since you had previously bound the
the DataGrid object to the same property of the DataSet object, changing the current item in
the DataSet object will change the current (selected) item in the DataGrid object, as well.
Save the file, and select Control > Test Movie to test the SWF file.
20.
The DataGrid object is populated with the specified items. Notice how clicking the button
changes the selected item in the DataGrid object.
DataSet class (Flash Professional only)
Inheritance
MovieClip > DataSet
ActionScript Class Name
The DataSet component lets you work with data as collections of objects that can be indexed,
sorted, searched, filtered, and modified.
The DataSet component functionality includes DataSetIterator, a set of methods for traversing
and manipulating a data collection, and DeltaPacket, a set of interfaces and classes for working
with updates to a data collection. In most cases, you don't use these classes and interfaces directly;
you use them indirectly through methods provided by the DataSet class.
Method summary for the DataSet class
The following table lists the methods of the DataSet class.
Method
DataSet.addItem()
DataSet.addItemAt()
DataSet.addSort()
DataSet.applyUpdates()
DataSet.changesPending()
DataSet.clear()
DataSet.createItem()
304
Chapter 6: Components Dictionary
method to navigate to the next item in the DataSet
DataSet.next()
mx.data.components.DataSet
Description
Adds the specified item to the collection.
Adds an item to the data set at the specified position.
Creates a new sorted view of the items in the collection.
Signals that the
access using data binding or ActionScript.
Indicates whether the collection has changes pending that have not
yet been sent in a delta packet.
Clears all items from the current view of the collection.
Returns a newly initialized collection item.
selectedIndex
property has a value that you can
deltaPacket
property of
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?