3 Replies Latest reply on Nov 10, 2007 5:04 AM by Greg Dove

    loading xml into dynamic text..

    ChadC940
      so I've got XML being loaded into a dynamic XML textbox, which in itself is fine. I just have two questions relating to that.
      1) I tried using both <br> and \n within the loaded text to create a line break. Both didn't work, is this possible?
      2) I would like to link as with HTML as well. At this point though, it also isn't working. Is it possible?
      With both of these issues does it have to do with commenting out the < and > so that the XML parser doesn't read it? Or is there some value in the XML class that will look past these elements? Or am I way off base and this isn't even possible.


      My other, more minor and not really AS3 issue but I figured I'd ask here before I started a new thread elsewhere, issue relates to text boxes themselves. In Illustrator I can draw a shape of any size and make the the text box. Is that possible in Flash? For example I have an oblong sphere that is rotated about 45 degrees that I would like to display the text in, pretty much all the way to the boarders. Is there any way to set the text box to be that sphere?

      Thanks,
      Chad
        • 1. Re: loading xml into dynamic text..
          Greg Dove Level 4
          To avoid the XML parser attempting to parse your HTML node as part of the XML data, you should use a CDATA node

          The following thread is as2 related, not as3, but it will show you what a CDATA node looks like. If you need more info, just google it.
          http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=288&threadid =1308394&highlight_key=y&keyword1=CDATA
          If you include valid flash html inside a CDATA node, including links etc they should work when you assign it to the htmlText property of the textfield.

          To answer your second question....no I think you would need to layer that shape behind your textfield and textfields only have a rectangular shape.
          • 2. Re: loading xml into dynamic text..
            schlafendes_faultier
            second question: i think it is possible to let flash temporairy convert the textbox into an bitmap and then you are able to turn everything around. and if you put everything in a container you're able to make an bitmap and then you can rotait everything. I've never try it, but i think it will work.
            • 3. loading xml into dynamic text..
              Greg Dove Level 4
              You don't need to turn the textfield into a bitmap in order to rotate it etc. You can achieve all the regular flash effects with a textfield (if the fonts are embedded). That's no problem.

              But you can't have (for example) a different shaped textfield (e.g. circular to match the outline of a sphere) and expect dynamic text inside it to word-wrap to the boundaries of the new shape (for example a circle). At least no way that I'm aware of, but I'm less familiar with as3. Perhaps with enhanced text metric information in as3 you could create a class that extended textfield and did something to achieve that. by hard line breaks (and maintaining a reference to them to update when things change and return 'clean' results for text and htmlText properties when accessed externally) ...I dunno.

              I thought that the nature of the original request was more to do with having text behave appropriately (e.g. word-wrap) within a shape other than a rectangle.