dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [F8]Can we make text Bold & Italic from XML file

  1. #1
    Member
    Join Date
    Nov 2008
    Posts
    49

    [F8]Can we make text Bold & Italic from XML file

    Hi,

    I want to know that if the flash file is getting its text from XML file, is it possible to make text bold or italic by passing some commands in the XML file.
    I tried
    html.Text = true;
    but that seems tobe working only if its hard coded in the flash file. The important this is that not whole of the textfield is needed tobe made bold or italic. Just few words in the paragraphs. I am using Flash 8.

    Regards,

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    Copy-n-Paste to test.fla
    PHP Code:
    _root.createTextField("test",1,10,10,350,35);
    test.autoSize true;
    test.multiline true;
    test.wordWrap true;
    test.html true;

    _xml = new XML();
    _xml.ignoreWhite true;
    _xml.load("test.xml");

    _xml.onLoad = function(){
    aNode this.firstChild.firstChild.childNodes[1].firstChild.nodeValue;
    test.htmlText aNode;
    }; 
    Copy-n-Paste to test.xml
    PHP Code:
    /* --test.xml-- uses a CDATA element to pass html tags to Flash

    <?xml version="1.0" encoding="UTF-8"?>
    <images>
    <pic>
    <image>aberdeen.swf</image>
    <caption><![CDATA[
    <i>Aberdeen Brewing Comp.</i>
    <b>Valparaiso</b>
    <u>Restaurant and Office Construction</u>

    <font color='#FF0000'>Located in a large-scale golf community development, this microbrewery, restaurant, and office condominium complex required a design that blends with the image of its Aberdeen neighborhood.</font> 
    ]]></caption>

    <thumbnail>projects/thumbnails/aberdeen.jpg</thumbnail>

    </pic>
    </images>

    */

  3. #3
    Member
    Join Date
    Nov 2008
    Posts
    49
    Dear Bro,

    Thank You so much for responding and its 100% working. But can you please explain how is it working because when I remove any tag from the xml, it do not work.
    What is the function of "<![CDATA[" and do I only need to put <b>,<i> and <u> to make it bold, italic and underlined and can we increase the font size too.

    Best Regards,
    Last edited by just_started; 12-26-2008 at 12:17 AM.

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    to help you understand CDATA sections -
    http://www.javacommerce.com/displayp...c.sql&id=18238

    also use this forums Search facility - keyword -- cdata

  5. #5
    Member
    Join Date
    Nov 2008
    Posts
    49
    Thanks alot bro, it was helpful

    Regards,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center