Skip to main content
Inspiring
February 9, 2007
Question

ComboBox simplicity !? :S

  • February 9, 2007
  • 2 replies
  • 202 views
Ok guys i know this is a ridiculously silly question or im doing something completely wrong :S but i have 1 dropdown or combobox whatever you would like to call it and 1 button

I have seen a lot of home made dropdowns on flashkit.com i was wondering would the same code work for flash components too or do you need to use "special" tags for components which you can just drop on the stage from the components interface ?

Sorry about the long post ppl its just been driving me crazy :S

The Objective : To trace the selected value of the dropdown on press of a button
Dropdown Instance Name is subject

Button Code
on(release){
trace(subject.selectedItem);
}
i have also tried
trace(subject.value);

both give output as undefined

I do use the parameter feature in flash 8 to enter the data and labels both were inputted as 1,2,3,4,5 so data and label was the same. Is there a problem using that , im not looking to use a event listener to detect if the value selected has been changed as the user can press a button to do that i need to learn the simple things before wrecking my brain with listeners lol.

Can someone please point me in the right direction for this as im trying to use the help file but 3hrs later and still not achieved something so simple :(

Many Thanks Pinky


This topic has been closed for replies.

2 replies

Inspiring
August 1, 2008
Thanks ;)
Participant
March 16, 2007
Hey Pinky, Try using .selectedIndex instead this might alleviate some of your stress.

on(release){
trace(subject.selectedIndex);
}

if all else fails you can always use the good ole trace(subject.text)