Hey guys.
Been tasked to create a site with a dropdown box with links to other pages using a combobox. I have not yet got up to speed with AS3 ( wow, it’s gonna take me some studying ). So for the meantime I am using what I know.
Anyhow I found geat code from lunatic here:
http://www.kirupa.com/forum/showthre…t=combobox+url
all works fine except for the fact that clicking on any of the boxes on the combobox does nothing where it should be going to a url.
I scoured kirupa, I scoured my training cds and googled it, I can’t find a solution except for an AS3 one.
Any help would be so greatly appreciated!
Cheers!
Orionstar
[COLOR=Black]Lunatic’s Code. [/COLOR][SIZE=1][COLOR=Black]( thanks Lunatic )[/COLOR][/SIZE]
[COLOR=#000000]**function**[/COLOR] getLink[COLOR=#000000]([/COLOR]c[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#000000]**var**[/COLOR] linkname = c.[COLOR=#000080]getSelectedItem[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR].[COLOR=#0000ff]data[/COLOR];
[COLOR=#0000ff]getURL[/COLOR][COLOR=#000000]([/COLOR]linkname, [COLOR=#ff0000]"_blank"[/COLOR][COLOR=#000000])[/COLOR]
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]**var**[/COLOR] data_array = [COLOR=#000000]**new**[/COLOR] [COLOR=#0000ff]Array[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#808080]*// first item*[/COLOR]
data_array[COLOR=#000000][[/COLOR][COLOR=#000080]0[/COLOR][COLOR=#000000]][/COLOR] = [COLOR=#000000]{[/COLOR]label:[COLOR=#ff0000]"Kirupa"[/COLOR], [COLOR=#0000ff]data[/COLOR]:[COLOR=#ff0000]"http://www.kirupa.com"[/COLOR][COLOR=#000000]}[/COLOR];
[COLOR=#808080]*// second item*[/COLOR]
data_array[COLOR=#000000][[/COLOR][COLOR=#000080]1[/COLOR][COLOR=#000000]][/COLOR] = [COLOR=#000000]{[/COLOR]label:[COLOR=#ff0000]"Flashkit"[/COLOR], [COLOR=#0000ff]data[/COLOR]:[COLOR=#ff0000]"http://www.flashkit.com"[/COLOR][COLOR=#000000]}[/COLOR];
[COLOR=#808080]*// third item*[/COLOR]
data_array[COLOR=#000000][[/COLOR][COLOR=#000080]2[/COLOR][COLOR=#000000]][/COLOR] = [COLOR=#000000]{[/COLOR]label:[COLOR=#ff0000]"Google"[/COLOR], [COLOR=#0000ff]data[/COLOR]:[COLOR=#ff0000]"http://www.google.com"[/COLOR][COLOR=#000000]}[/COLOR];
[COLOR=#808080]*// set data provider*[/COLOR]
links.[COLOR=#000080]setDataProvider[/COLOR][COLOR=#000000]([/COLOR]data_array[COLOR=#000000])[/COLOR];
[COLOR=#808080]*// set change handler*[/COLOR]
links.[COLOR=#000080]setChangeHandler[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"getLink"[/COLOR][COLOR=#000000])[/COLOR];