Solved

Flash AS3 - My combobox will not populate?? Possible bug

Posted on 2008-10-29
4
464 Views
Last Modified: 2012-05-05
hi there. The below code works in one of my other projects, but will not work in my new project!! I do have a combobox working in a movieclip in this project, but even copy and pasting it and the code does not work.

The combox will not populate. It remains empty and you can not drop down the select...

Please help me to find the problem! I have tried for hours now

I drag and drop the combo component and then my code is as below:



import fl.controls.ComboBox;
import fl.data.DataProvider;
 
var dp:DataProvider = new DataProvider();
dp.addItem({label:"New", data:"NEW"})
 
dp.addItem( {label:"Copy", data:"COPY"});
 
combo.dataProvider = dp;
 
 
combo.addEventListener(Event.CHANGE, changeHandler);
 
function changeHandler(event:Event):void {
  
  var cb:ComboBox = event.currentTarget as ComboBox;
    var item:Object = cb.selectedItem;
    	
	if (cb.selectedIndex ==0) {
		//do something
		
    } else if(cb.selectedIndex ==1) {
		//do something
	} 
}

Open in new window

0
Comment
Question by:Jarmanje
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 10

Expert Comment

by:Savong
ID: 22836888
This is probably ridiculous, but did you verify that the combo box has the correct instance name in flash?  Is it specified as "combo"?
0
 

Author Comment

by:Jarmanje
ID: 22837217
Thanks for reply

yes.
there is no error compiling the code. The combobox seems to be bugged and doesn't populate..
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
ID: 22839611
if i copy and paste your code. my combobox gets the labels new and copy.
so if all else fails delete the combobox in the library and stage and drag another instance and try again.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can't find all of the preferences on Flash Pro 2 494
Microsoft WSUS 4 110
Flash movie or gif/animation? 3 942
Is it possible to insert an Adobe Flash video in a .net  web page ? 2 109
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question