Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 3rd, 2004, 03:46 AM
revenga revenga is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 revenga User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problems selecting ComboBox value dynamically

Hello,

Filling a ComboBox dynamically with values of countries, using a numerical country code, from a text file. That all works fine.

Problem is, cant get the combobox to jump to the right value (determined via MySQL & PHP). While PHP definitely passes the country code correctly to Flash, the Combobox wont budge in what its displaying. In fact, hardcoding an index does not work either, although similar code works fine and I do seem to be targetting correctly. Here´s the parts of my code I think the problem must be in after some debugging.

Does anyone know if filling the combo dynamically messes with the numerical index?

// dynamically create entries for
// combobox...works. label is the name of // the country, data an index running
// 0 - 190

this.ondata = function(){
for (i=0; i<191; i++) {
// create a real item
var myItem = new Object();
myItem.label = eval(this.i);
myItem.data = i;
// put it in the array
countries[i] = myItem;
}
// fill the combo box
country.setDataProvider(countries);
}

/* dynamically select entry, doesnt work.
Country is instance of combobox in one case, and country code variable in the other. This is instantiated correctly by PHP */

_root.movie_mc.main_mc.edit_mc.country.setSelectedIndex(_root.movie_mc.main_mc.data_mc.country);

// hard-coding it doesn´t work either

_root.movie_mc.main_mc.edit_mc.country.setSelectedIndex(190);

Anyone see a problem with the code or got something similar to work?

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Problems selecting ComboBox value dynamically


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway