5 Replies Latest reply on Aug 1, 2009 8:08 AM by kglad

    loading images into text field - links problem

    shiftless Level 1

      Hello,

       

      I use AS3 and I load external text from XML to the text field created manually. External text includes hyperlinks and <img> tags. The problem is if I load more than 1 image this way , my links no longer work. They work if I load only 1 image...

       

      Text field is multiline, wraps the text, got embedded font and autoSize is set to "left"...

       

      I could not find any solution to this, is there any?!

       

      Thanks for any thoughts.

        • 1. Re: loading images into text field - links problem
          kglad Adobe Community Professional & MVP

          show your xml and xml parsing code that assigns htmlText to your textfield.

          • 2. Re: loading images into text field - links problem
            shiftless Level 1

            // XML

            <?xml version="1.0" encoding="utf-8"?>

            <content>
            <text><![CDATA[<font color="#ffffff" size="25"><b>Title</b></font>
            <br />
            <a href="www.google.com" target="_blank">Nulla tincidunt</a> commodo <b>fermentum. Suspendisse</b> venenatis suscipit vehicula. Phasellus eu est non tellus fringilla mattis id in magna. Nullam suscipit fermentum ipsum, at semper ante auctor viverra. Morbi gravida tristique aliquam. Mauris facilisis urna et arcu rhoncus ac tempor velit consectetur. Vestibulum lacus justo, rutrum vitae ultrices nec, porta quis orci. Proin pellentesque mauris quis eros semper vulputate. Etiam sed magna et dolor dapibus sodales.
            <br />
            <img src="content/image.jpg">
            <br />Vivamus sit amet metus orci, facilisis dignissim arcu. Suspendisse fringilla varius mauris, in gravida purus cursus non. Integer lacinia faucibus turpis, nec tempus leo porttitor quis. Cras id posuere elit.
            <br />
            In eros purus, commodo eu fermentum id, blandit ut ligula. Curabitur arcu dolor, laoreet convallis fermentum eu, ullamcorper id est. <a href="www.google.com" target="_blank">Etiam varius viverra dui eu placerat</a>.
            <br />
            <img src="content/image.jpg">
            <br /><a href="www.google.com" target="_blank">Nulla tincidunt</a> commodo fermentum. Suspendisse venenatis suscipit vehicula. Phasellus eu est non tellus fringilla mattis id in magna.]]>
            </text>

            </content>

             

            // AS

            var myXML:XML;

             

            // inside "Event.COMPLETE" function

            myXML = new XML(xmlLoader.data);

            myText.htmlText = myXML.text.*;

            • 3. Re: loading images into text field - links problem
              kglad Adobe Community Professional & MVP

              that looks good.  now test online.  any problems?

              1 person found this helpful
              • 4. Re: loading images into text field - links problem
                shiftless Level 1

                Oh yay!

                 

                Looks like it needed the newest fp available.. I thought it would work with fp 9.0.45 but I was wrong, I'm sorry, at least I know what to do first with similar problems!

                 

                Thank you for your time.