8 Replies Latest reply on May 29, 2009 7:15 AM by kglad

    Html turns to percent signs

    kristinx1367

      I am trying to load html into a text box from a website. when i load to the text box, everything goes fine except that it is loaded as something that looks like this:

       

           "%20Cheese%20Croissant=&nbsp%3B%3Cimg%20src=%22http%3A%2F%2Fwww%2Ehousing%2Eumich%2Eedu%2Fd ining%2Fmenus%2Fm%2Dfit%2Egif%22%20alt%3D%22%2A%22%3E%3C%2Fdiv%3E%3Cdiv%20class%3D%22Desse rts%22%3EOat%20Bran..."

       

      I wouldnt mind if the html tags were there, because I can deal with those, but I don't know what to do with this. Here is my loader:

       

      var my_lv:LoadVars = new LoadVars();
                      my_lv.onLoad = function(success:Boolean)
                      {
                           var mL:String = String(my_lv);
                           mc.mealList.htmlText = reformat(mL);
                           trace(mL);
                           mc.mealList._height = mc.mealList.textHeight;
                           mc.mealList.setTextFormat(foodFeedFormat);
                           mealTween = new Tween(mc.mealList, "_y", None.easeOut, 300, (mc.mealList._height * -1), (0.05 * mc.mealList._height),true);
                           mealTween.looping = true;
                      };
                      my_lv.load(website);

        • 1. Re: Html turns to percent signs
          kglad Adobe Community Professional & MVP

          unescape that string and you'll recover your html encoded string.

          • 2. Re: Html turns to percent signs
            kristinx1367 Level 1

            do you mean by just making it look like this:

                                      var my_lv:LoadVars = new LoadVars();
                                      my_lv.onLoad = function(success:Boolean)
                                      {
                                           mc.mealList.htmlText = my_lv;

                                           ...

             

            because i tried getting rid of the String and it didnt change anything

            • 3. Re: Html turns to percent signs
              kglad Adobe Community Professional & MVP

              like so:

               

              do you mean by just making it look like this:

                                        var my_lv:LoadVars = new LoadVars();
                                        my_lv.onLoad = function(success:Boolean)
                                        {

              // although that's not likely to display correctly because of the limited html tags flash can parse
                                             mc.mealList.htmlText = unescape(my_lv);

                                             ...

               

               

              • 4. Re: Html turns to percent signs
                kristinx1367 Level 1

                When I did that, I got a "type mismatch" error.

                • 5. Re: Html turns to percent signs
                  kristinx1367 Level 1

                  I also don't mind if some of the html tags show up, because i can go through and systematically remove them afterwards. I just have to get it to display as html first, and not all these symbols. it cuts the whole beginning off too until it hits the last "&" sign.

                  • 6. Re: Html turns to percent signs
                    kglad Adobe Community Professional & MVP

                    kglad wrote:

                     

                    like so:

                     

                    do you mean by just making it look like this:

                                              var my_lv:LoadVars = new LoadVars();
                                              my_lv.onLoad = function(success:Boolean)
                                              {

                    // although that's not likely to display correctly because of the limited html tags flash can parse
                                                   mc.mealList.htmlText = unescape(String(my_lv));

                                                   ...

                     

                     

                    • 7. Re: Html turns to percent signs
                      kristinx1367 Level 1

                      ok, i've done that, and it showed up in html format! however, it's only got part of it (like the style html and a couple words from the body) was this what you were talking about when you said it wouldn't parse correctly? i was probably wrong, but i just thought that it would include the body and all the html tags. is there anything i can do so that all of the body shows up?

                      • 8. Re: Html turns to percent signs
                        kglad Adobe Community Professional & MVP

                        if you think more data is being sent than is being presented in your textfield find the code that causes the data truncation by using the trace() function and possibly the flash string methods.

                         

                        this is a separate issue though.  this thread has been answered.