4 Replies Latest reply on Sep 23, 2009 3:41 AM by Minigrim

    Use input text as navigation Flash 8 AS2

    Minigrim

      Hi All.
      Flash 8 AS2

       

      I'm trying to find out if you can use an input text fields as navigation?

       

      The idea:
      If I open my page and then enter (G-12226) or a (MiniGrim) into an input text field is it possible that the flash navigates itself to the Number or Name that is been entered in the input text field, Either automatically or via the touch of a button have no idea what is easiest
      No idea if this is possible?

       

      Thank you for everything
      Regards: MiniGrim

        • 1. Re: Use input text as navigation Flash 8 AS2
          Ned Murphy Adobe Community Professional & MVP

          Input textfields have an onChanged event that you can use to define/trigger a function...  so if you have an input textfield with an instance name of "iField, you can have something like the following....

           

          iField.onChanged = function(){

               if(iField.text == "G-12226"){

                    gotoAndPlay("G-12226");

               } else if(iField.text == "MiniGrim"){

                    gotoAndPlay("MiniGrim");

               } etc...

          }

           

          For each character you add to the textfield it would check to see if the entry matched a condition, and when it finds a match it will eecute the goto command.

           

          Alternatively, if you have a button to go with the textfield then you could just enter the text and have the button function just have...

           

          Btn.onRelease = function(){

               gotoAndPlay(iField.text);

          }

          1 person found this helpful
          • 2. Re: Use input text as navigation Flash 8 AS2
            Minigrim Level 1

             

            Thanks for such a quick answer to my question Ned Murphy.

             

            I see that you have pointed me in the right way and it works
            so the problem with using the input text as navigation
            is fixed and working for themselves perfectly

             

            But now I have a new question.

            If one wants to use this together with a drop down
            menu that has all podukt name and product number and you get the results into a dynamic / input text fields, is it then
            possible to use that AS setup then?

             

            No idea if you need to know what I'm working
            on, but think it may help to say it.

             

            My idea is to create a printable label form where you can both select the correct information
            via the menu and also have the ability to type in product name or product number and the
            rest of the form will fill out the appropriate info, now you know what im think about and try to make.

             

            Regards: Mini-Grim
            It is so good that there are a people who help those who may be less experienced
            this is the way to learn, and maybe in the future can help others
            Thank you very much for everything

             

            Ps: if you or anyone who wants to look at the files
                  i can send them to you / those who want through
                  mail show it helps you to help me LOL.
            • 3. Re: Use input text as navigation Flash 8 AS2
              Ned Murphy Adobe Community Professional & MVP

              When you dynamically change the content of a textfield using actionscript, such as having a combobox selection fill in the textfield, the onChanged event is NOT detected.  But you could still have a function assigned to the combo box that would fill in the textfield and then initiate a gotoAndPlay command to move to that frame.

              • 4. du Re: Use input text as navigation Flash 8 AS2
                Minigrim Level 1
                Hi Ned
                Thank you for responding so quickly to my questions

                 

                I've tried to get it to work, but do not have enough experience with AS.
                So is there anything you can help or point me in the right way

                 

                Here is AS in first frame that controls my menu, and there is a lot of AS that is used that i do not understand.

                 

                import ComboBox.as;
                var st:ComboBox = new ComboBox ();
                st.scope = this;
                st.rowCount = 6;
                st._x = 285;
                st._y = 5;
                //st.openEasing = com.robertpenner.easing.Expo.easeOut;
                //st.closeEasing = com.robertpenner.easing.Expo.easeOut;
                st.openDuration = 15;
                //st.setStyle ("bold", true);
                st.setStyle ("font", "Verdana");
                //st.setStyle ("blockIndent", 10);
                //st.setStyle ("color", 0xFF9900);
                //st.setStyle ("wordWrap", true);
                st.setStyle ("size", 12);
                //setStyle ("multiline", true);
                setStyle ("type", "Søk via Navn");
                st.setStyle ("text", "Søk via: Type");
                //produktArray = new Array ("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");
                //smallArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
                //st.dataProvider=smallArray;
                function add ()
                {
                for (var i = 0; i < produktArray.length; i++)
                {
                  st.addItem (produktArray[i] + "\r" + produktArray[i]);
                }
                }
                //st.theme = "0x79896D";
                var object = new Object ();
                object.change = function ()
                {
                type_selection_txt.text = st.selection.data;
                };
                st.addEventListener ("change", object);
                Produkter = [
                    "G-1221.1 (Blak Marbel Stipes)",
                    "G-1222.2 (Kina Silver)",
                    "G-1223.3 (Jasmin red)",
                    "G-1224.4 (Wooden Black)",
                    "G-1225.5 (White Travertine)",
                    "G-1226.6 (Spring Yellow)",
                    "G-1227.7 (Dragon Jade)",
                    "G-1228.8 (Ming Green)"];
                st.dataProvider = Produkter;

                 

                 

                I would actually do this myself if i could, but since i do not have experience it is difficult

                 


                MiniGrim