A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: dynamic text boxes

  1. #1
    Junior Member
    Join Date
    Mar 2007
    Posts
    23

    dynamic text boxes

    Hi,

    Not sure if this is in the correct section, sorry if not!

    I have got a php page with a rich text editor that updates a dynamic text box in my flash file.

    I can add bullet points etc, but i can't change the text colour, size etc via the rich text editor as it just remains how it formatted in flash.

    Any ideas how i make the dynamic text box reflect the formatting of the rich text editor and not how it is set in flash.

    Many thanks,

    Mark

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    take a read of TextFormat in the Help files

    in Flash 8 -
    ActionScript 2.0 Language Reference > ActionScript classes > TextFormat

    Use the TextFormat class to create specific text formatting for text fields. You can apply text formatting to both static and dynamic text fields.

  3. #3
    Junior Member
    Join Date
    Mar 2007
    Posts
    23
    thanks for the reply, however thats not really answering my question.

    I need to make the dynamic text box not be formatted in anyway within flash, but from a rich text input field within a PHP web page.

    I hope this clarifies my problem, sorry if i didn't explain it very well before.

  4. #4
    Get Squared Away.
    Join Date
    Feb 2000
    Location
    Allentown, PA
    Posts
    543
    Hello,

    You'll need to make sure your dynamic text box is checked to RENDER as HTML and then you can pass a php string to it. The php string can set your html formatting for you...something like:

    Code:
    $newsText = "";
    $newsText .= '<font color="#0000FF" size="18">';
    $newsText .= stripslashes($row['title']);
    $newsText .= '</font><br>';
    
    // Add date posted and author name in small font
    $newsText .= '<font color = "#666666" size="12">';
    $newsText .= $posted . " by " . $row['author'];
    $newsText .= '</font><br>';
    
    // Add news item body with a double linebreak
    $newsText .= HTMLSpecialChars($row['body']) . '<font color = "#666666" size="16"><br><br>---------------------------------------------------<br><br></font>';
    //$newsText .= HTMLSpecialChars($row['body']) . '<br><br><img src="horz.gif"><br><br>';
    
    // EMAIL PARSER
    $newsText = ereg_replace("[[:alpha:]]+@[^<>[:space:]]+[[:alnum:]]","<font color=\"#FF0000\"><u><a href=\"mailto:\\0\">\\0</a></u></font>", $newsText);
    
    // URL PARSER FOR MESSAGE
    $newsText  = ereg_replace ("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]]", "<font color=\"#FF0000\"><u><a href=\"\\0\"target=\"_blank\">\\0</a></u></font>", $newsText);
    
    $newsText = ereg_replace("\[url\]([^\[]+)\[/url\]", "<font color=\"#1E71B8\"><u><a href=\"\\1\"target=\"_blank\">\\1</a></u></font>", $newsText);
    
    // BOLD, ITALICS, UNDERLINE AND PRE PARSER
    $searchFor = Array ('', '', '[pre]', '[/pre]', '', '', '', '');
    $replaceWith = Array ('<b>', '</b>', '<pre>', '</pre>', '<i>', '</i>', '<u>', '</u>');
    $newsText = str_replace ($searchFor, $replaceWith, $newsText);
    
    // END PARSING SECTION 
    
    // Output news items back to Flash
    print "&newsText=". urlencode ($newsText);

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