dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: '' and '+' won't display in dynamic text box

  1. #1

    '' and '+' won't display in dynamic text box

    Hi, I'm using the actionscript below to retrieve text into a dynamic text box. I've also embedded a font that the dynamic text boxes are set to display entitled 'Codex LT' by adding it to my Library and changing the Linkage Properties to 'Export for ActionScript' and 'Export in first frame'.

    All of this works brilliantly - the text is retrieved and is displayed as Codex LT even on computers that don't have the font installed. The only problem is that the dynamic text box refuses to display certain characters such as '+' and '', even though it does display other similar characters such as '=' and '$'. Codex LT (see link) definitely does include the '+' and '' characters. I even tried replacing Codex LT with Arial and the problem still remained.

    I tried adding more glyphs via the Embed option in the dynamic text box's properties box but it has zero effect. I tried adding all the Latin characters, then I tried to add the '+' character via the 'Include these characters:' option and then I tried the 'All (39477) glyphs' option but after each attempt I published my movie and the '+' character failed to appear. I originally embedded the Codex LT font by importing it into my library and changing the 'Linkage properties', as when I tried to embed the font via the Embed option in the properties panel it didn't seem to embed the font at all.

    Do you know how I can fix this?

    Many thanks,

    Leo

    Code:
    path = "http://www.stpatrickscommunity.org/admin/text/landline.php"; // this should retrieve the text '+ 353 (0) 71 9620175'
    lv = new LoadVars();
    lv.onLoad = function(){
    str = unescape(this);
    str = str.split("=&onLoad=[type Function]").join("");
    landline.html = true; // landline is instance name of textfield
    landline.htmlText = str;
    };
    lv.load(path);

  2. #2
    Member
    Join Date
    Aug 2006
    Posts
    31
    Have you remembered to use forward slashes when needed? Im not sure if it effects external text, but i know that if you want to use something like a quotation mark is has to be written [ \" ]. But you've been here since 03, i sense i just wasted time with this :P

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    for euro char. - specify the character set in a header
    for + char. - urlencode the string
    PHP Code:
    <?php
    header
    ('Content-type: text/html; charset=utf-8');

    $phone="+353 (0) 71 9620175";

    $str_encoded=urlencode($phone);
    echo 
    "&str1=".$str_encoded."&";

    $str2 "10.35";
    echo 
    "&str2=".$str2."&";
    ?>
    Code:
    path = "http://www.stpatrickscommunity.org/admin/text/landline.php";
    lv = new LoadVars();
    lv.onLoad = function(){
    str1 = lv.str1;  trace(str1); // +353 (0) 71 9620175
    str2 = lv.str2;  trace(str2); // 10.35
    };
    lv.load(path);

  4. #4
    Many thanks again modified dog.

    My dynamic text boxes are now able to display '+' and '&'. I'm still having difficulty displaying '' and accented characters such as ''. Any ideas?

    Also how can I make my Flash dynamic text boxes display nothing rather than 'onLoad=[type Function]' when there is no data in the PHP file the dynamic text box tries to retrieve text from?

    I've attached the actionscript and PHP code I'm currently using here...

    Actionscript
    code:
    path = "http://www.stpatrickscommunity.org/admin/text/landline.php";
    lv = new LoadVars();
    lv.onLoad = function(){
    str = unescape(this);
    str = str.split("=&onLoad=[type Function]").join("");
    landline.html = true;
    landline.htmlText = str;
    };
    lv.load(path);



    PHP
    PHP Code:
    <?php
    header
    ('Content-type: text/html; charset=utf-8');

    mysql_connect("mysql.myhosting.com","stpatri_user","password") or die(mysql_error());
    mysql_select_db("stpatri_table") or die(mysql_error()); 

    $result mysql_query("SELECT * FROM text")
    or die(
    mysql_error());  

    $row mysql_fetch_array$result );

    $str_encoded=urlencode($row['landline']);
    echo 
    "$str_encoded";
    ?>
    Many, many thanks
    Last edited by Leao; 09-21-2006 at 06:56 PM.

  5. #5
    oops, wrote the code above a bit wrong. I've fixed it now... anyone have any ideas about how I can make the text box display nothing when its respective PHP file is empty and also make it display '' and accented characters?

    Leo

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