Why is AS3 underlining certain fonts but not others (all of which are pretty common)?

Hello everyone!
     I have a simple question that hopefully has a simple answer (which mocks me with its elusiveness). In the code below (taken from Gary Rosenzweig's "ActionScript 3.0 Game Programming University" (2nd ed.)), I am declaring a simple style sheet using all AS3 supported tags/attributes to underline an HTML link. My question is this: why won't AS3 underline the chosen font (Arial) but yet it will underline certain other fonts that I substitute it for (such as "Times New Roman" and "Garamond")?
// create a basic format
var myFormat:TextFormat = new TextFormat();
myFormat.font = "Arial";
myFormat.size = 24;
myFormat.bold = true;
var myStyleSheet:StyleSheet = new StyleSheet();
myStyleSheet.setStyle("A",{textDecoration: "underline", color: "#0000FF"});
// create a text field with a Web URL link
var myWebLink:TextField = new TextField();
myWebLink.defaultTextFormat = myFormat;
myWebLink.styleSheet = myStyleSheet;
myWebLink.selectable = false;
myWebLink.htmlText = "Visit <A HREF='http://flashgameu.com'>FlashGameU.com</A>!";
myWebLink.x = 80;
myWebLink.y = 90;
myWebLink.width = 400;
myWebLink.height = 30;
addChild(myWebLink);
var myLink:TextField = new TextField();
myLink.defaultTextFormat = myFormat;
myLink.styleSheet = myStyleSheet;
myLink.selectable = false;
myLink.htmlText = "Click <A HREF='event:testing'>here</A>";
myLink.x = 80;
myLink.y = 190;
myLink.width = 400;
myLink.height = 30;
addChild(myLink);
addEventListener(TextEvent.LINK, textLinkClick);
function textLinkClick(event:TextEvent) {
trace(event.text);

Mr. Murphy,
     You see what I mean? I knew it would be a simple answer - it had to be, right? That way when someone helped me figure it out, I would get the pleasure of kicking myself for not having seen it before. I tried temporarily disabling the default text (thinking maybe it was somehow interfering with the style sheet), ensuring that I had the fonts that I was trying to use embedded in my program, including all the formatting in the actual style sheet rather than some of it resting in the default text statement, and did a couple other things that now escape my memory. What I didn't do was change the font size to see if it was simply cutting off the underscore. Sure I thought about it, but didn't actually follow it up.
     What makes this worse is that, in the book I referenced, the author doesn't say anything about having to change the font size for this particular application and goes further by demonstrating via inline image his "perfect" outputted result using the exact code that I did. I know this threw off other readers as well who tried to emulate his result only to find that the underline magically "disappeared" when they did it.
     Thanks for the help! As always, I appreciate it.

Similar Messages

  • Static during a certain album but not others?

    My iPod Touch 4th generation, with the latest update available,  has static when I play a certain album. I've played other albums and just random songs not from that album and it works just fine, but when I play that certain album it has static. I got the album yesterday via a CD, I had purchased that day and brought it home and put it directly in the computer. I have played it on my computer and it works just fine.

    I did, its still staticy on that one album.

  • Sound works on certain videos, but not others.

    This is not just a Firefox problem, but I'm having no luck on other forums. When viewing videos on any of my browsers (Firefox, Chrome, and Internet Explorer) for some reason there is no sound for some sites like Youtube or ESPN. But if I go to msn.ca (I only found this out on a fluke) I can watch all of their videos with sound.
    Now, please assume I'm not computer illiterate. I've updated my drivers, browsers, flash, uninstalled then reinstalled everything, and done all sorts of other little checks and balances. I've pulled my sound card out, checked to see if it was fried, and put it back in. Properly. I have no freaking clue what is going on, and I'm really close to just wiping my computer.
    Please help.

    Try some of the steps listed here:
    *http://forums.adobe.com/thread/1018071?tstart=0
    You can try Flash 11.2 that you can download via this link:
    * http://fpdownload.macromedia.com/pub/flashplayer/current/licensing/win/install_flash_player_11_plugin_32bit.exe

  • Why can i browse most websites, but not others?

    Basically, I am trying to access few websites and when I try opening them it is constantly loading but won't open.. I could access these websites last night, but for some reason they won't load now. There is no error message, but keeps on loading. I use google chrome, but the same problem persists with Safari and Firefox. I have connection to the internet and I can access a majority of other websites at usual speed. When i leave the 'problem' websites loading for some time i can see that after 10 minutes or so the website partially opens but other parts remain blank and thus remains unusable. I cleared all my cookies, history, cache and everything. Reset my modem. Tried browsing the internet for solutions but nothing seems to work and other solutions are too technical for me to understand.
    Thanks.

    I have connection to the internet
    Assuming you mean wireless rather than through ethernet:
    Try the basics first:
       Change your router channel number.  Most times this works & is all you have to do.
    Disconnect & reconnect your modem.  unplug it for about 10 seconds.  Plug it back in.  Do the same for Apple’s routers.  Wait for everything to reboot.
    System Preferences>Network
    Click the Assist Me button.
    In the next window that pops up, click the Diagnostic button & do the necessary.
    Research Knowledge Base for network problems that pertain to the OS that is currently installed on your computer.   See these basic networking KB Articles:  http://support.apple.com/kb/HT1401 AirPort troubleshooting guide
    http://support.apple.com/kb/HT2712 Using network locations in Mac OS X
    Manually provided DNS server addresses are higher priority than DHCP's
    http://support.apple.com/kb/HT1714 Solutions for connecting to the Internet, setting up a small network, and troubleshooting
    ============================
    What to do when you can't connect to the Internet
    Also, run the Airport Utility app which is located inside the Utilities folder.
    =====================
    If using a  Linksys router, contact LinkSys Customer Support and/or post in their forums.
    If using Apple's Airport, please re-post over in one of the AirPort Forums.
    ==================
    ==================
    Care to share which OS you are using?

  • Firefox opens certain websites but not others, same with google chrome and IE

    Basically a day after installing sc2 my firefox started running really, really slowly and stopped opening sites that ive always opened perfectly fine before. I can open;
    http://eu.battle.net + US website
    http://forums.wow-europe.com/?sid=1 + US website
    Teamliquid.net front page, streams load chance varied
    mmochampion
    No problem with these
    I cannot open;
    youtube
    google 9/10
    yahoo for my emails
    Cynicalbrit.com
    Xfire live
    arena junkies.com
    I have run spyware scanners, virus scanners, checked to make sure my net settings in firefox are fine, nothing works, restarted my router, reinstalled firefox, checked for updates, disabled all plugins, renabled some, cheeck for plug in updates...nothing works.
    If anyone could help that would be awesome.

    The site provides World of Warcraft services for the WoW gaming community. Your character can reach level 85 quickly and safely with our WoW Powerleveling service. While you are busy working, learning in school, or sleeping, the company can help you on: PvP Honor Points Farming, PvP Conquest Points Leveling and Personal Arena Rating , Power Leveling , Justice Points and Valor Points , Instance Dungeon Runs and Loot , PvP Honor Rewards , PvP Arena Rewards , Gold Farming , Profession Tradeskill Leveling .
    http://www.yehforgames.com/

  • Why can I sync a movie but not TV shows on my nano (7th gen)?

    I am using iTunes 11.0 and can sync a movie (Miracle on 34th Street) to my new ipod nano 7th gen but when I try a TV Show (a Planet Earth HD episode) or even a brief video clip taken with my camara I am told that such an action is not permitted on this ipod.  So why can I sync a movie but not TV shows on my nano (7th gen)?  Thank you.

    Before you can sync video files, it must be converted into a format compatible with ipod.  If you can’t sync a video convert it by doing the following:
    In iTunes, select the video you want to convert. Do one of the following then sync again after:
    1) Choose File > Create New Version > Create iPod or iPhone Version.
    2) Choose File > Create New Version > Create iPad or Apple TV Version.
    I hope this works.

  • Why can I receive text messages but not send?

    Why can I receive text messages but not send. This has been happening for about 10 hours.

    Thanks for the response. Must be smart phones. My daughter has a dumb phone and she can send out. I tried deleting my text messages on the Verizon website, but they won’t delete. It must be on their end. Chat line was busy forever, until they shut it down.
    Jennifer

  • Why will the iOS 7 download but not install?

    why will the iOS 7 download but not install?

    IOS 7 stinks wrote:
    I made the mistake go read the internet
    It would take a very long time to read the entire Internet. There are billions of pages.

  • Why can i send imessage texts but not sms texts ?

    why can i send imessage texts but not sms texts ?
    When i try to send an sms text ..i get a 'not delivered' message...no error code...imessage works fine...

        Very strange, [email protected] Let's get this figured out. Make sure that SMS messages are turned on. Go to Settings>Messages>Send as SMS. Please let me know if this works.
    ChaunceyM_VZW
    Follow us on twitter @VZWSupport

  • HT204411 Why are some music artists available to download for some countries (i.e USA) but not others (i.e UK)?

    Why are some music artists available to download for some countries (i.e USA) but not others (i.e UK) on Itunes?
    It's so frustrating!

    Welcome to the Apple Community.
    Because that's the way the music labels want it.

  • Why will icloud update my contacts, but not my calendar (ie birthdays) I have the "show birthday calendar" ticked

    why will icloud update my contacts, but not my calendar (ie birthdays) I have the "show birthday calendar" ticked

    why will icloud update my contacts, but not my calendar (ie birthdays) I have the "show birthday calendar" ticked

  • Why can I make comments on some documents but but not others?

    why can I make comments on some documents but but not others?

    If the PDFs were made from scanned (bitmap) images, they would have no selectable text, and you couldn't add comments to those.

  • I can import some songs from another computer but not others.  All the songs were purchased with the same apple id. Message says "...check connection to network..." Any ideas as to what could be causing this problem?

    Using home share, I can import some songs from my son's  computer but not others.  All the songs were purchased with the same apple id.  Err msg:"There was a problem downloading ... You do not have enouggh access privileges for this operation. Please check that the connection to the network is active and try again."  The network appears to be fine .  I can import other songs from his library.  The same songs cause me a problem each time I try.  My husband had no trouble importing the same songs I have trouble with. I get the same error message if I try to import the same songs from my husbands computer as well.  "Command I" appears to show the same protections on both the songs I can import & the ones I cannot.  My husband and son are both running OS 10.6, while I am running 10.7.  I think I had this problem even before I upgraded, but I am not certain.

    x0SiN0x:
    Welcome to Apple Discussions..
    My first suggestion is to Repair Disk. Here's how:
    Insert Installer disk and Restart, holding down the "C" key.
    Go to Installer menu (Panther and earlier) or Utilities menu (Tiger) and launch Disk Utility.
    Select your HDD (manufacturer ID) in the left panel.
    Select First Aid in the Main panel.
    (Check S.M.A.R.T Status of HDD at the bottom of right panel, and report)
    Click Repair Disk on the bottom right.
    If DU reports disk does not need repairs quit DU and restart.
    If DU reports errors Repair again and again until DU reports disk is repaired.
    If DU reports errors it cannot repair you will need to use a utility like Tech Tool Pro or Disk Warrior
    Please post back and let me know how that goes.
    Here are a few links that may help you to identify the issues:
    Resolving Disk, Permission, and Cache Corruption
    Tuning Mac OS X Performance
    Mac OS X System Maintenance
    Please don't hesitate to post back should you have further questions or comments, or with update.
    Good luck.
    cornelius

  • Flash Player works for Administrator but not other users

    I have Flash Player 10.2.153.1 installed and I am running Windows Vista 32-bit and Windows Internet Explorer 8.  If I am logged in as the Administrator I have no problem watching video previews from the Odeon and other similar websites.  However, if logged on a Standard user account Odeon film previews cannot be seen - all I get is a blank white viewing box with a small square box in the top left corner with the colours red, green and blue in it (it is too vague to make out what the logo is even when zoomed in).  The inability to watch video clips for Standard users seems to be random as some sites work while others do not?  Can anyone help solve this problem?  Why do I have this problems for the standard user accounts on some websites but not at all for the Administrator account on any website ???

    Experienced same problems: http://forums.adobe.com/thread/790415
    Would very much appreciate a solution.
    Glocke

  • Speakerphone problem - lost voice from speakerphone while playing music or gaming youtube, while call or voice recording playing - all works fine, so speakerphone is working but not on all apps. hard reset done - no changes

    or gaming youtube, while call or voice recording playing - all works fine, so speakerphone is working but not on all apps. hard reset done - no changes.
    iphone 4
    SOLVED plugin to charger solved it - so problem was with contacts -- no idea why - phone is new - no water - no havy dust - usual using  
    hope will never return. Thanks

    We checked it with an iPhone 5 in house multiple times and could not reproduce this Problem. Must be something specific to your device. Maybe your speakerphone volume is turned down completely?
    Follow the latest Skype Community News
    ↓ Did my reply answer your question? Accept it as a solution to help others, Thanks. ↓

Maybe you are looking for