-
[RESOLVED] Dynamic News Editing
I am trying to create a news editing system. All parts of the news (title, author, date, content) are loaded from a mySQL database. PHP is exporting the variables from the database to flash. I then load the variables into a combo box. Now, the name is working, or in essence, the "label" of the combo box. The entries show up in the combo box, however clicking on them does not change the text inside the textboxes I have created for this. My textboxes have the correct variables of "texttxt" and "authortxt" and so forth. I am using a mix of input and dynamic boxes.
Please examine my script, I have been stuck on this for days and would really like to get over the hurdle.
Code:
//populating the combobox "dropDown"
function AddItems() {
for (i=0; i<NumItems; i++){
var Name = eval("Name"+i);
var TextData = eval("TextData"+i);
var Author = eval("Author"+i);
var TheDate = eval("TheDate"+i);
var ListBoxData = { textData:TextData, author:Author, theDate:TheDate};
dropDown.addItem(Name, ListBoxData);
}
dropDown.setChangeHandler("SelectItem");
}
//loading variables into text boxes "newstitle_input" and "newstxt_input"
function SelectItem(){
titletxt = dropDown.getSelectedItem().label;
texttxt = dropDown.getSelectedItem().data["textData"];
datetxt = dropDown.getSelectedItem().data["theDate"];
authortxt = dropDown.getSelectedItem().data["author"];
}
Last edited by pyramidhead; 01-06-2007 at 03:58 AM.
-
up to my .as in code
Already tested with fake data
http://flex.hobby-site.com/examples/pyramidhead.html
Change this:
dropDown.setChangeHandler("SelectItem");
}
function SelectItem(){
titletxt = dropDown.getSelectedItem().label;
texttxt = dropDown.getSelectedItem().data["textData"];
datetxt = dropDown.getSelectedItem().data["theDate"];
authortxt = dropDown.getSelectedItem().data["author"];
}
To this:
dropDown.addEventListener("change", this);
}
function change(evt){
_root.titletxt = dropDown.getSelectedItem().label;
_root.texttxt = dropDown.getSelectedItem().data["textData"];
datetxt = dropDown.getSelectedItem().data["theDate"];
authortxt = dropDown.getSelectedItem().data["author"];
}
Last edited by Chris_Seahorn; 01-06-2007 at 04:30 AM.
-
Thank you so much. This was a perfect fix... hours and hours of debugging and now it works!
-
up to my .as in code
No sweat. Glad to help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|