3 Replies Latest reply on Aug 18, 2006 3:22 PM by Newsgroup_User

    Retrieving HTML text without page title

    Leao16
      I've created a dynamic text box (with the attached actionscript )that retrieves its text from an HTML page. The only problem is that when it retrieves the text it retrieves the title of the HTML page too. Is there somehow I can avoid this?

      Thank you,

      Leo
        • 1. Re: Retrieving HTML text without page title
          Level 7
          Leao16,

          > I've created a dynamic text box (with the attached
          > actionscript )that retrieves its text from an HTML
          > page. The only problem is that when it retrieves the
          > text it retrieves the title of the HTML page too. Is
          > there somehow I can avoid this?

          I don't see why not. You're already using the String.split() method to
          remove part of the string. If the text comes back with HTML formatting, you
          could probably look for the </title> tag and strip out all the text up to
          (and including) that. Look up the String class for additional methods,
          including String.substring(), String,substr(), String.indexOf(), etc.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: Retrieving HTML text without page title
            Leao16 Level 1
            I didn't write the original actionscript so I don't really know how to implement what you suggested. Could you explain a little more?

            Thanks,

            Leao
            • 3. Re: Retrieving HTML text without page title
              Level 7
              Leao,

              > I didn't write the original actionscript so I don't
              > really know how to implement what you suggested.

              Aha! Well, that can be a bit like painting yourself into a corner. ;)

              > Could you explain a little more?

              Spend a bit of time with the String class. Before you even do that, you
              may want to familiarize yourself with the concept of objects in general.
              See this introductory article ...

              http://www.quip.net/blog/2006/flash/actionscript-20/ojects-building-blocks

              ... then spend a bit of time in a completely new FLA experimenting with the
              String class. Many of its methods are specifically geared toward changing
              the value of the text content, including stripping away certain characters.
              e.g., you can use String.indexOf() to return the position of a particular
              character (or characters) in a string of text. You may then use that
              position in cahoots with String.substr() to return a new string that as been
              "pruned" of undesired content.


              David Stiller
              Adobe Community Expert
              Dev blog, http://www.quip.net/blog/
              "Luck is the residue of good design."