ActionScript 1/2 :: ComboBox Not Setting Any 'selected' Text?
May 25, 2007i'm having some trouble with an actionscript-generated ComboBox here's my script
[Code]...
i'm having some trouble with an actionscript-generated ComboBox here's my script
[Code]...
When I set style color, it changes both the text color for the selected item/component label and the text in the dropdown menu.
color
Type: uint Format: Color CSS Inheritance: yes
Color of text in the component, including the component label. The default value is 0x0B333C.
I would really like the label to be white and the text to be black.
Any way to set the text that initially appears within a ComboBox without actually making it a selection? I have a ComboBox that initially starts out with one selection labeled "Select One". When you click on the ComboBox, the first selection in the list is "Select One". Is there a way to tell the ComboBox to just say "Select One" when it first hits the stage without making it editable?
View 3 RepliesHow do I make the selected label and data in my combobox appear in a dynamic text box in macromedia flash 8?
View 10 RepliesI am using the combocheck example from the following site: [URL]
It's a very useful component and works very well.
Now, I need to set the text property of this combo box upon application startup with certain values (which are defined dynamically according to some criteria). The problem is that although I have no problem setting the text property of the combo box at other times of the application run, setting the property at startup seems to have no effect unfortunately.
For example, I want to set the text property of the combobox to "Bob" (which is one of the items in the dataprovider for the combobox) and the "set text" method is called on the combo box. Performing a step-through shows that the "set text" method is receiving the correct value item but not setting the _text property.
I have tried not doing anything until "ApplicationComplete" but no joy there either.
Here is the code (a combination of the code from the URL above and some other changes to it). However, as I've stated above, the codes does work. The problem is that it doesn't work at the application startup. Whenever an event is fired and setComboText is called as a result, the text of the combo box is set correctly.
private function onComboChecked(event:ComboCheckEvent):void {
var obj:Object=event.obj;
var index:int=selectedItems.getItemIndex(obj);
[Code]....
I'm trying to set a specific list item in a mx combobox to have a custom item renderer, the problem is that I cannot do this via mxml, it needs to be done via actionscript at a later stage, eg: combobox gets created, combobox gets populated, user does other tasks, combobox needs to set one or more items in the combobox to have icons (via item renderer)..
I can do this via the onChange event, but it only applies the icon when the combobox is opened and there is a slight delay so you can see the icon being added.
Flash documentation says this is possible, but cb.selectedItem={label:'labeltext',data:'data'}; is a no go for me. Maybe I'm missing something obvious? Setting selectedIndex works great, but this should work too.
View 19 RepliesWhen I select an item from the comboBox-list the selected item stays blank(visually) but the comboBox-list remains populated and change-event keeps firing.
This happens when I embed fonts and modifies or removes items from an existing combobox.
Here's the code that causes the anomoly:
comboBox.textField.setStyle("textFormat", fontFormat);
comboBox.textField.setStyle("embedFonts", true);
I have a combobox with arrayCollection dataprovider, it selects nothing at start, but i see the first object label as selected, i want to add select text, as first option that selects nothing, just to indicate that the user didn't select an option yet.
View 1 RepliesI am using a combobox for the us states, link. The label is set to the full name of the state, while the value attribute holds the abbreviation. What I want to do is to get the selected item's value. So I tried combo.selectedItem.value and combo.selectedItem.@value, but neither of them worked.
View 2 RepliesI had a comboBox and loading the datadynamically from the server. i need to display the first value in comboBox as a selected value and based on the value data should be populated on the grid.
View 2 RepliesIm trying to use the selected item in a combo box (aCB) to populate a text field (taLabel) the trace statement shows the correct item but i'm missing something simple to make it work. This is the error I get:
ReferenceError: Error #1069: Property null not found on fl.controls.ComboBox and there is no default value.
var cPriorities:Array = new Array(
{label:"Image Conscious",data:"Image Conscious"},
{label:"Durable", data:"Durable"},
{label:"Dependable", data:"Dependable"},);
[Code] .....
I have one combobox in layer which is under the masking (Mask Layer). It does not display selected item particularly in chrome browser (version 14)
when click on combobox it drops down and display items but when make selected specific item, it doesn't display.
Flex is so tricky to style.
I have a combobox, when I arrow up and down over a select it has a background color, how do I change this color. This should be easy.
an example how to do this?UPDATEI know how to get the selected item in actionscript,but my question is how to get it in javascript?
View 1 RepliesWhen a combobox is elected in the flex app, there is a quick flicker, then the combobox needs to be selected again in order to get the dropdown to open. After that, the dropdown works as expected, but only while selecting the control subsequent times while on the form. Reloading the form requires the double selection again.
View 1 RepliesBecause of screen size, I must ensure we're only displaying necessary data to the user.I have a drop down box that contains only 5 items and I would like that when an item is selected, it doesn't appear in the drop down box (since technically it's showing twice, once at the top as the selected item and once in the list). how I would achieve this? I tried using a custom CellRender and overriding the "set selected" function to call this.visible = false if selected is true, but that simply hides the item but does not remove it from the layout of the drop down list.
View 1 RepliesI've just recently started out using Flash Builder and have a question surrounding states. In fact I'm not entirely sure it is related to states but read on and I hope it will become clearer. I currently have a custom component that contains 3 comboboxes. This resides in a TabNavigator component. The TabNavigator consits of 5 pages (Tabs). The custom container holding the comboboxes should display the same selected data across all Tabs. ie. If I am in Tab1 and select an item from one of the comboboxes then click on Tab2 I need to mirror the combobox's selection in Tab2.
View 1 RepliesIsn't there a better way to accomplish this?[code]...
All I want to do is make sure that when I update the item that the comboBox is pointing to internally, that it's selectedIndex also update so that the label within the ComboBox reflects the new value.
I'm developing an AIR app that requires a menu to show only during the first run. In it the user will be able to choose the desired language for the app to run in.
I'm displaying this menu without a problem but I need it to stay visible until the "select language" comboBox is changed and then return the selected choice's data value.
how to return a value only after the combo box is changed.
function promptFRMenu():String{
FRMenu.enabled = FRMenu.visible = true; //when I detect the app is running for the
// first time, the dialog box is enabled
[Code]....
I have a combobox that act as autosuggestion for a search application. Search function is getting triggered by a search button. I also want to trigger the search function either when the item in combobox is double or single clicked. Code:
[Code]..
In a flex application how to display default selecteditem from the dataprovider of the combobox.
I'm using {staticdataholder.currencylist}.
For example: I have to show INDIA so it should be selected as default from the list.
I have made a combobox and I am trying to make it so that when I press a button, the song that is selected plays. I have this code already but it doesn't work.
ActionScript Code:
song1 = new Sound();
song1.attachSound("pdandcos");
song2 = new Sound();
song2.attachSound("pieman");
song = song1;
play_btn.onRelease = function() {
song = songlist_cb.value;
song.start();
};
I have a ComboBox with a label function like this one:
private function fieldLabelFunction(item:Object):String {
return resourceManager.getString('dashboard',"SS." + item);
}
When I change locales, the labels display correctly in the ComboBox's dropdown list, or if I change a selection. However, the currently selected item's label doesn't refresh at first. Is there a way to force the labelFunction to get called again?
I just want to acquire the existing label from the currently selected item in a ComboBox. I populated it with a DataProvider with a list of strings and it will not allow me to get the currently selected label, especially if I input a new one, not included in the DataProvider
View 1 RepliesI've got a combobox, cb, for which I need to programmatically set the selection. The combobox was populated by:
cd.addItem({data:"string1",label:"string1"});
cd.addItem({data:"string2",label:"string2"});
cd.addItem({data:"string3",label:"string3"});
Lets say I need to set the combobox to "string2",I've tried all of the following, none work:
cb.selectedItem("string2");
cb.selectedItem(data:"string2");
cb.selectedItem(label:"string2");
cb.selectedItem({data:"string2",label:"string2"});
The docs say selectedItem() is read/write but all the examples I can find are read only.
my string LINK at the end of the script is undefined it should change when i select the categories with my combo box
here is the xml :category.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<slideshow>
[code].......
I have tried
ActionScript Code:
fontCombo.textField.autosize= TextFieldAutoSize.RIGHT;
ActionScript Code:
[code]......
Is it possible to use AS2 to dynamically set the current state of a ComboBox?I'm loading variables from an external file, and I need the ComboBoxes to reflect the selection that comes in.
View 3 RepliesI need to set the text value of the ComboBox and numericStepper when an item in a list is pressed. I understand that the value of the ComboBox and NumericStepper is read only. How can I force these components to show the value that I want?
View 3 Replies