A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [RESOLVED] combining variable with sting for html textfield

  1. #1
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588

    resolved [RESOLVED] combining variable with sting for html textfield

    I'm using the following code to try and change the font size of a textfield dynamically using a varaible but I can't get size to use the variable as a value however all the other variables I combine with the string works as intended just not size .....can somebody spot the trouble plz.

    PHP Code:

     
    var chSize 50;
                  
    trace(msg);
                    
    insID.htmlText += "<font size="+chSize.toString(16)+" fontFamily='Tahoma' color=\"#"+newColor.toString(16)+"\">"+msg+"</font>";
                     
    insID.wordWrap=true;
                    
    stage.focus msgOut;
                    
    scrollBar.update(); 
    ~calmchess~

  2. #2
    Senior Member dudeqwerty's Avatar
    Join Date
    Mar 2005
    Location
    Bosnia
    Posts
    1,626
    Why are you converting the size to hexadecimal?

    Change:
    Code:
    chSize.toString(16)
    to:
    Code:
    chSize.toString()
    New sig soon

  3. #3
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    doesn't work either way
    ~calmchess~

  4. #4
    Senior Member dudeqwerty's Avatar
    Join Date
    Mar 2005
    Location
    Bosnia
    Posts
    1,626
    Forgot one thing, you need the quotes around the size too. Your could should look like this:
    Code:
    var chSize:int = 50; 
    trace(msg); 
    insID.htmlText += "<font size=\""+chSize.toString()+"\" fontFamily='Tahoma' color=\"#"+newColor.toString(16)+"\">"+msg+"</font>"; 
    insID.wordWrap=true; 
    stage.focus = msgOut; 
    scrollBar.update();
    New sig soon

  5. #5
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    YES! I knew it was just a matter of getting quoats in the right place.............Thank you very much for your help once again......cookie for you
    ~calmchess~

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