2 Replies Latest reply on Oct 5, 2011 2:07 PM by HDsuperglide

    Help with ComboBox scripting

    HDsuperglide Level 1

      Hi all,

       

      I am using Flash CS5 on an iMAC, running OSX 10.6.

       

      I created a file that uses a Combobox on the first frame, and I would like to connect the buttons to go to and stop/play on multiple labels. Can anyone please show me how to do this? I would be most grateful.

       

      Many thanks in advance,

      HDsuperglide

        • 1. Re: Help with ComboBox scripting
          Ned Murphy Adobe Community Professional & MVP

          What you can do is assign the frame labels as the data element of the combobox entries and then use an Event.CHANGE event listener to call a function that uses the combobox's selectedItem.data properties to gotoAndStop(data).

           

          You should look up the ComboBox component in the help documentation and become familiar with all of its properties methods and events.  THis will make it easier for you to understand the tool you want to implement.

          • 2. Re: Help with ComboBox scripting
            HDsuperglide Level 1

            Hi Ned,

             

            I was able to assign the Google button to open Google.com, with the following code, but this code is different from going to a label. Could you show me what the code should look like?

             

            ________________________________

            import flash.events.Event;

            import flash.net.URLRequest;

             

            mylist.addEventListener(Event.CHANGE, gotogoogle);

             

            function gotogoogle(event:Event)

            {

                if (mylist.selectedItem.label == "google")

                {

                    var request:URLRequest = new URLRequest("http://www.google.com/")

                    navigateToURL(request);

                }

               

            }

            ___________________________________

             

            Many thanks,

             

            HDsuperglide