dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Division Symbol

  1. #1
    Member
    Join Date
    Jan 2003
    Posts
    70

    Division Symbol

    Hi,

    I'm making a math game for my students. They are given input and output values and have to figure out the operation. I'd like the operation ( + 5, x 6, etc) to appear in a dynamic text box. My question is:

    How do you get the division symbol (not a slash or fraction bar) to appear in the text box?

    Thanks!

  2. #2
    Registered Deviant
    Join Date
    Sep 2004
    Location
    Cornelius, OR, USA
    Posts
    280
    If you're using HTML, you can use the HTML code of "& #247;", else you have to create the character. The example below assumes you have two text boxes, one called test, the other test2. The formatting in the forums is messing up my text, so make sure to remove the space between the ampersand and hash mark!
    Code:
    var divide:String = String.fromCharCode(247);
    var divideHTML:String = "& #247;";  // No space here!
    
    test.html = false;
    test.htmlText = "<b>bold</b><i>italic</i>"+divide;
    
    test2.html = true;
    test2.htmlText = "<b>bold</b><i>italic</i>"+divideHTML;
    If you can read this, you're in the right place.

  3. #3
    Member
    Join Date
    Jan 2003
    Posts
    70
    Thanks a lot!

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