Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Supporting Technologies > Flash Remoting

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-17-2005, 01:34 PM   #1
llebron
Registered User
 
Join Date: Sep 2003
Posts: 8
Question Reloading combo box from amfphp

I am working on a flash application to manage users. When the form loads up it creates a combo box with the name of all the users. Here's the code
ActionScript Code:
function get_users_Result(result) {       length = result['items'].length;         getItems_cb.addItem({label:' -- Please select a user --'});         for($i=0; $i < length; $i++)         {         getItems_cb.addItem({label:result['items'][$i]['First_Name']+' '+ result['items'][$i]['Last_Name'], data:result['items'][$i]['UserID']});         } } get_users = users.get_users("");

This works. However, when I add or delete an user I want to regenerate the combo box. I tried the following code but the combo box does not get regenerated, eventhough the get_users method gets called.
ActionScript Code:
function add_user_Result(result) {     trace(result);     get_users = users.get_users(""); }

Any help would be greatly appreciated.

thanks

Luis
llebron is offline   Reply With Quote
Old 03-20-2005, 08:23 AM   #2
prt1
FlashScape
 
Join Date: Mar 2004
Posts: 139
Default

The normal way is to check the 'add' worked in the php file and return the list of Users if true. This way you only make one call.
You have no error checking in your 'result' function, how do you know the 'add' worked?
Looking at your code there doesn't seem to be anything that clears the combo box before refreshing it, it is just adding onto the end of it.
Hope this helps.
prt1 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:57 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.