-
Need new script for MX2004 ComboBox!
I used this script on my combobox in FlashMX(6) but it dont works with MX2004 (7). Need a upgraded version!
code:--------------------------------------------------------------------------------
function GoToURL() {
value = cb.getSelectedItem().data
gotoAndStop(value);
}
cb.setChangeHandler("GoToURL");
cb.addItem("start", "label1");
cb.addItem("finish", "label2")
--------------------------------------------------------------------------------
-
See-n-reMember
howdy peder,
looks like addItem() should still work the same, as far as the "change" handler...try attaching this to your actions on the main timeline:
Code:
listenerObject = new Object();
listenerObject.change = function(eventObject){
// your code here
GoToURL();//call to your fxn
}
comboBoxInstanceName.addEventListener("change", listenerObject)
...have a look at this page, and see if that helps. if not post again
-
Thanks!
It worked out this way:
listener = new Object();
listener.change = function(eventObj){
if(my_cb.selectedIndex == 1){
gotoAndStop("label1");
}else if(my_cb.selectedIndex == 2){
getURL("http://wwww.google.com");
}else if(my_cb.selectedIndex == 3){
getURL("http://wwww.amazon.com");
}
}
my_cb.addEventListener("change",listener);
Regards
peder
-
See-n-reMember
glad you found a solution
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|