I'm using and XML connector to read in data, and I have the XML connector
successfully bound to a DataSet. Instead of displaying that data from the
DataSet into a DataGrid, I'm attaching a movieclip from the library for each
row of data in the DataSet. Each movie clip has a TextInput component (along
with some other irrelevant graphics). I have some action script in each
movieclip that binds the TextInput component to the DataGrid, but I want to
bind each TextInput to a specific row in the DataSet.
The binding works successfully, other than it binds each TextInput to the
first record of the DataSet. I want to bind each TextInput independently to a
different row in the DataSet.
Any ideas on how to do this?
I've attached the code I'm using right now.
Thanks,
John
------------------------------------------------
import mx.data.binding.*;
//Source Endpoint - The DataSet
var src = new EndPoint ();
src.component = _root.taskDataSet;
//There is a value available - this.rowNumber - that indicates what
rowNumber this movieclip should be linked to
src.property = "cName"; //cName is a defined string in my DataSet's schema
src.event = "afterLoaded";
//Destination EndPoint - the TextInput box
var dest = new EndPoint ();
dest.component = this.cNameText;
dest.property = "text";
//Binding EndPoints
new Binding (src, dest);
jwize - 17 Aug 2005 01:53 GMT
var LayerDepth = 100; // A layer that won't conflict with other layer
// Sets a listener to the afterLoaded event of the dataset.
yourDataSet.addEventListener("afterLoaded", AddDataToTextBoxes); // Where your
dataset = the name of your dataset.
// This adds the data
function AddDataToTextBoxes(){
// Create movie clip and store it in mc variable.
var mc:MovieClip = attachMovieClip("customclip", "customclip" +
(LayerDepth + i), (LayerDepth + 1));
mc.textbox_txt.text = yourDataSet.items.username; // if you have a
"username" field in your dataset
}
JohnWolff - 17 Aug 2005 16:09 GMT
Thanks, I appreciate the input. However, I don't have any problems drawing the
moviclips and displaying the data. What I need to do is "bind" the data, so
that if they change the data in the TextInput it actually changes the data in
the DataSet.
PS I've found the getNextHighestDepth() function easier to use then trying to
track layers myself.
JohnWolff - 19 Aug 2005 15:59 GMT
I've tried binding through the iterator property of the DataSet and still no luck. Anyone with any other ideas?