Skip to main content
Participating Frequently
April 18, 2007
Answered

Newbie - dependable comboBox Flash 8

  • April 18, 2007
  • 9 replies
  • 1039 views
Hi everyone, I've never used this before, so go easy on me. I'm having trouble with getting a dependable combobox functioning. Actually, I don't have a clue. So could someone point me in the direction of a tutorial or functioning example I could download as a guide. I have one for MX, but it has a variable not present in Flash 8 and I have no idea what to do with it or how to recreate it.

Cheers,
This topic has been closed for replies.
Correct answer Optikalefx
ha, i guess i should have tested my code, i just typed it up here. i made some minor changes, names and such, and cleaned it up, with no comments, the same basic idea, except one thing. I had to create all the combo boxes in the start, make them invisible, and them when called, make them visible, it works fine, as u can see heres the code, straight copy and paste it and test it.

9 replies

NcCMbCAuthor
Participating Frequently
April 19, 2007
Okay, thanks for you help. I have lot to learn before I'll be able to get this working the way I need, but you have provided a fantastic start. I'm sure the other newbie's will appreciate it as well.
Inspiring
April 19, 2007
im not sure what you mean, but just think in IF statements. if you can talk it out with If elses, then it will work, otherwise, im not sure what you mean.
Inspiring
April 19, 2007
if you want to get "codie" at the top instead of doing attach movie a million times
just use a for statement

for (i=1;i<=4;i++) {
this.attachMovie("ComboBox","my_cb" + i,_root.getNextHighestDepth(),{_y:0,_x:150*i});
set("my_cb" + i + ".visible" , false);}
this.attachMovie("ComboBox","my_cb",_root.getNextHighestDepth(),{_y:0,_x:0});
NcCMbCAuthor
Participating Frequently
April 19, 2007
Thank you again, that is great. I appreciate you taking the time on this. Is there a way to have only two comboboxes or to have the first box change the contents of a list?
NcCMbCAuthor
Participating Frequently
April 19, 2007
Oops, I get a bunch of errors... I fixed most of them, at least I think I did, but these remain...

**Error** Scene=Scene 1, layer=action, frame=1:Line 21: Statement block must be terminated by '}'
myListener.change = function(event:Object) {

**Error** Scene=Scene 1, layer=action, frame=1:Line 62: Syntax error.
}

Total ActionScript Errors: 2 Reported Errors: 2
OptikalefxCorrect answer
Inspiring
April 19, 2007
ha, i guess i should have tested my code, i just typed it up here. i made some minor changes, names and such, and cleaned it up, with no comments, the same basic idea, except one thing. I had to create all the combo boxes in the start, make them invisible, and them when called, make them visible, it works fine, as u can see heres the code, straight copy and paste it and test it.
Inspiring
April 18, 2007
// "label:"Game"" the second thing a combo box needs, is w

i meant label1 not Game (sorry used from my own code)
NcCMbCAuthor
Participating Frequently
April 18, 2007
Did I mention it has to be compatible with version 6 and up?
Inspiring
April 18, 2007
this might be confusing, but i tried to explain each part bit by bit
NcCMbCAuthor
Participating Frequently
April 18, 2007
Thank you Optikalefx!!!! You are a life saver!! I want to learn more about Flash and ActionScript so that I won't have to restrict my creativity because I don't know how to implement a function - Cheers!!
kglad
Community Expert
Community Expert
April 18, 2007
no, lo is the name of a listener object that's created on line 1. you need change nothing for your application.

eo is an event object that's passed by the object that calls the change method. you need change nothing for your application.

cb is the only thing you need to change to match the instance names of one of your comboboxes.

if you use your first combobox, you'll used the selectedItem's data (probably) to populate your 2nd combobox using the 2nd comboboxes dataProvider property.
NcCMbCAuthor
Participating Frequently
April 18, 2007
I understand now, mostly. Thank you for taking the time to answer my question, I just have one final part that I'm not sure about:

"if you use your first combobox, you'll used the selectedItem's data (probably) to populate your 2nd combobox using the 2nd comboboxes dataProvider property."

I think I understand, but really I would be just guessing. I'm not sure how to populate the data into the second combobox and get it to jump to a frame when selected. gotoandstop command?

Do you have a suggestion for a good tutorial book to learn these basics? I'm a graphic designer, so I learn by example, not by learning rules then applying them in different situations - math, lol

Cheers,
NcCMbCAuthor
Participating Frequently
April 18, 2007
Thanks, but oh wow, totally over my head. lo and eo are the instance names? It took me hours just to get a combo box that would actually do something when a selection was chosen. Now I'm completely baffled as to how to put two comboboxes on the stage and have the first one provide the list for the second and then for the timeline to jump to a frame when the selection is clicked...
kglad
Community Expert
Community Expert
April 18, 2007
here are the essentials: