5 Replies Latest reply on May 28, 2010 4:33 AM by Ned Murphy

    Chapter selection with a Combobox

    abbagid Level 1

      Hi there!

      I have made a flash player that get the movie from a seperate server. There are also some slideshows that depending on time in the movie chances so the pictures are relevant with what you are watching., this pictures chanses with the help from a xml file. I would now also like a Combobox that works as a chapter selecter. I have "made" the combobox and the text that i have in the xml shows up however now i cant get the combobox to work.

       

      I hope you out there understand were im going with this and that somone have any good idea what i could do to fix this.

       

      ops im working in AS2

       

        • 1. Re: Chapter selection with a Combobox
          Ned Murphy Adobe Community Professional & MVP

          It is not entirely clear what you are trying to do.  What code are you using to make the combobox work and to assign label/data information to the combobox?  What should the combobox cause to happen when you select something in it?

          • 2. Re: Chapter selection with a Combobox
            abbagid Level 1

            The code I would say is relative here is this

             

             

            #####################################################

            buildMovies();

            function buildMovies() {

            baseURL = "http://api.stresas.dk/projects/public_read/12a2e760-13c4-012d-69a2-0019bb2e7b32";

             

            //baseURL = "test.xml";

            var my_xml:XML = new XML();

            my_xml.ignoreWhite = true;

            my_xml.onLoad = function(success) {

            if (my_xml.firstChild.hasChildNodes()) {

            for (var aNode:XMLNode = my_xml.firstChild.firstChild.nextSibling; aNode != null; aNode=aNode.nextSibling) {

            buildProject(aNode.toString(),"movie");

            trace(aNode.toString());

            }

            }

            initialize();//load complete

             

             

            };

            my_xml.load(baseURL);

            }

             

            var titleObject:Object = new Object();

            function buildProject(arg, arg2) {

            var myxml:XML = new XML(arg);

            for (var aNode:XMLNode = myxml.firstChild.firstChild; aNode != null; aNode=aNode.nextSibling) {

             

             

             

            var dotsNodes:Object = aNode.firstChild;

            var dotsNodesChildren:Object = dotsNodes.childNodes;

             

            for (var i in dotsNodesChildren) {

             

             

            titleObject[dotsNodesChildren[i].attributes.title+dotsNodesChildren[i].attributes.time] = dotsNodesChildren[i].attributes.title;

             

            }

             

             

            }

            inCont += 1;

             

             

            gotoAndStop(2);

            }

             

            stop();

             

            ########################################

            On frame 2 the code is not more then list.addItem(titleObject[i])

            ################################################

            And what I want to do now is when I press on one of the titles in the Combobox i want it to jump so a specific time in the movie. All this is implemented in the xml so i think i just need to get the click function to work but im totaly lost here. Hope this will explain my problem a bit more, if not i will give it a tredje try

            • 3. Re: Chapter selection with a Combobox
              Ned Murphy Adobe Community Professional & MVP

              Typically, an addItem for a combobox involves adding a label and a data element which are usually defined in the object.  I cannot tell if that is what you are doing.  The object would usually be stored as { label: "label text", data: dataValue }  So I would think you would be adding the label and whatever time/frame/measure you intend for the data element as far as where the combobox is supposed to send one to.

               

              I don't see any code where you are actually trying to use the combobox, mostly just loading data into your file.

              1 person found this helpful
              • 4. Re: Chapter selection with a Combobox
                abbagid Level 1

                I striped the code a bit i have the function that fix the time line, might have striped it a bit to much.

                 

                Think the problem is in the combobox function (that i dont have). The thing is that i havent been working with flash in a couple of years, and this prodject was the last one i did. I felt like complete it now, and i have totaly lost my knowledge, so i cant even figgure out how to get a combobox to work... :/
                Thats way you dont find any code regarding the Combobox

                • 5. Re: Chapter selection with a Combobox
                  Ned Murphy Adobe Community Professional & MVP

                  From your descriptions so far I cannot determine what action would be taken when the combo box is clicked.  You mentioned "when I press on one of the titles in the Combobox i want it to jump so a specific time in the movie"  but I don't know what that means... is it a time in a video or a frame in the timeline or something else?

                   

                  What you need to do first is get your combobox filled with label/data information.   I am suggesting that whatever defines "a specific time" is the data element of the combobox.  So when you click it, it you have a listener assigned for the change event (look that up in the help docs) that triggers whatever the "jump to" action involves using the selectedItem.data properties (look those up too).