dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Bold using as...on dynamic text?

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

    Bold using as...on dynamic text?

    Hello!

    Quick description of my app..

    I have an movieclip that is basically a multiple choice application. You select an answer and hit a button and it spits back feedback on your answer.

    The multiple choice options and the feedback are all stored in two arrays:

    answers[]
    feedBack[]

    Because the first word in the feedback should be bolded, i'm having issues findoing how to bold JUST the first word in the string stored in the array. For example...

    var feedBack:Array = new Array
    (
    ["Right. You answered correctly!"],
    ["Wrong. You suck."]
    )

    i have functions work out which array item to post based on the option selected, but would need it output like:

    Wrong. You suck.



    Any ideas????



    Thanks in advance.
    K

  2. #2
    Junior Member
    Join Date
    Jan 2008
    Posts
    9
    How about using html tags ?

    you can try using dynamic text with html enabled.

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    as blu3bird suggested -
    PHP Code:
    var feedBack:Array = new Array(
    [
    "Right. You answered correctly!"],
    [
    "Wrong. You suck."]);

    var 
    tmp:Array = new Array();

    for(var 
    n=0;n!=feedBack.length;n++)
    tmp[n] = feedBack[n][0].split(". ");

    txt1.html true;
    txt1.htmlText "<b>"+tmp[0][0]+".</b> "+tmp[0][1];

    txt2.html true;
    txt2.htmlText "<b>"+tmp[1][0]+".</b> "+tmp[1][1]; 

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