10 Replies Latest reply on Jan 14, 2012 1:39 AM by kglad

    Search Box

    vinod kumar k v Level 1

      Hi,

      I have created a movie clip with nearly 100 frames. Each frame containing the unique text Heading, explanations, Images, flash paper, etc.,..

       

      All I need is,

      When I type a word in the "Search Box". I need the list of topics to be displayed.(It should search the entire content of the topic)

      And then, when I click any particular topic, which is listed, it should direct to the entire content (to that particular document).

      I need your help and solution.

      I prefer AS.2 for this.

      Any help would be greatly appriciated.

      Thank you,

      Vinod Kumar.K.V

        • 1. Re: Search Box
          kglad Adobe Community Professional & MVP

          you'll need to code that.  you can use the object class to associate words with frame numbers.  for example, if key words "moon","sun","solar system" are associated with frame 35 of your movieclip mc, use:

           

          var obj:Object={};

          obj["moon"]=35;

          obj["sun"]=35;

          obj["solar system"]=35;

           

          etc

           

          you can then use,

           

          if(obj[tf.text]){

          mc.gotoAndStop(obj[tf.text]);

          }

           

          where tf is your search textfield.

          1 person found this helpful
          • 2. Re: Search Box
            vinod kumar k v Level 1

            Thanks for your reply,

                But, thats not what I need exactly.

                      (1) The content is large and it contains lot of key words.

                      (2) And the word, that would be typed in the Input field may not  be a full word.

                      (3) It should list the links according to the search.

                      (4) The listed topics should have the link to their corresponding pages

             

            I have attached Images for better clarity.

                 Img1.jpgImg2.jpg

             

            Thank you,

            Vinod Kumar.K.V

            • 3. Re: Search Box
              kglad Adobe Community Professional & MVP

              you would still use the same basic idea suggested in my previous message:

               

              you'll need to code that.  you can use the object class to associate words with frame numbers and figures.  for example, if key words "moon","sun","solar system" are associated with frame 35 of your movieclip mc and figure 3.27(c)

               

              var obj:Object={};

              obj["moon"]=[35,"figure 3.27(c)];

              obj["sun"]=[35,"figure 3.27(c)];

              obj["solar system"]=[35,"figure 3.27(c)];

               

              etc

               

              you can then use,

               

              for(var s:String in obj){

              if(s.indexOf(tf.text)>-1){

              var mc:MovieClip=sp.content.attachMovie("mcID","mc_"+s,sp.content.getNextHighestDepth());

              mc.frame=obj[s][0];

              mc.tf.text=obj[s][1];

              mc.onRelease=function(){

              yourmainmovieclip.gotoAndStop(this.frame);

              }

              }

              }

               

              where tf is your search textfield, mcID is the linkage id of a movieclip that contains a textfield tf, sp is a scrollpane that has its contentPath assigned to an empty movieclip and yourmainmovieclip is the movieclip with 100 frames.

              1 person found this helpful
              • 4. Re: Search Box
                vinod kumar k v Level 1

                Thank you very much for your kind reply.

                I'll apply this in my project and let you know the outcome, shortly.

                 

                Thank you,

                Vinod Kumar.K.V

                • 5. Re: Search Box
                  kglad Adobe Community Professional & MVP

                  you're welcome

                  • 6. Re: Search Box
                    vinod kumar k v Level 1

                    Hi,

                         I need your help to do something like this.

                     

                    http://www.flabell.com/flash/Flash-Full-Text-Search-Component-38

                     

                         This component is working with AS3 (Class / Package) script. And variables from the XML.

                     

                    So, is there any way to make a similar stuff (transition effects not necessary) in AS2

                    • 7. Re: Search Box
                      vinod kumar k v Level 1

                      Yeah, btw

                       

                           In AS2, with no usage of class.

                       

                      Thank you,

                      Vinod Kumar.K.V

                      • 8. Re: Search Box
                        kglad Adobe Community Professional & MVP

                        yes, but i don't see that as being any big help.   it's not searching the swf for text and images.  the text and images are listed in the xml.

                        • 9. Re: Search Box
                          vinod kumar k v Level 1

                          Thank You,

                          Kglad,

                           

                          I got a solution for this.

                           

                          Thank you, very much.

                          • 10. Re: Search Box
                            kglad Adobe Community Professional & MVP

                            you're welcome.