Hi gang,
Here's what I need to do: I add an object to the stage via AS. This object has a dynamic text field in it called txt1. Now, as I add the object on the main MC, I also want to set the text for that textfield (txt1) inside. Now, this text is from an array, so I can't just set a var in the textfield itself becuase I am adding multiple instances of this one dynamic object.
I hope that wasn't too confusing. Here's some code:
ActionScript Code:
stop();
vars = new LoadVars();
vars.action = "events";
vars.sendAndLoad(_root.url + _root.directory + _root.file, vars, "post");
vars.onLoad = function() {
eventID = vars.eID.split("|");
eventName = vars.eN.split("|");
eventDate = vars.eD.split("|");
eventFlyer = vars.eF.split("|");
eventCount = eventID.length - 1;
addEventButtons();
}
function addEventButtons() {
yPos = -214;
for (i = 0; i < eventCount; i++) {
this.attachMovie("evList", "e" + i, i);
this["e" + i]._x = -349;
this["e" + i]._y = yPos;
this["e" + i].txt1.text = eventDate[i] + "\n" + eventName[i];
yPos += 60;
}
}
I hope this is clear, thanks guys