As3 htmlText problem

I have a dynamic text box for 3 lines of text. I styled part of the text to be bold and part of it to be regular. When i click on the button to display the text it looks right the first time but if i click on it a second time then all of the text shows up bold instead of just the few lines i assigned the bold tag to. Has anyone else had this issue?

thanks kglad,
ok I embedded fonts and it's staying the way it should be but still can't figure out paragraph breaks and leading issue. Not even sure if the way i'm doing it is the best /most efficient way of creating this map?
here is all my code:
var alabama_btnInfo = "<b>John Smith<br>(555) 123-4567</b><br><font size=10>Northern Alabama</font><p><b>Mary Smith<br>(555) 123-4567</b><br><font size=10>Southern Alabama</font>";
var arizona_btnInfo= "<b>Your Name<br>(555) 123-4567</b><br><font size=10>Entire State of Arizona</font>"; and
alabama_btn.addEventListener(MouseEvent.CLICK, showInfo);
arizona_btn.addEventListener(MouseEvent.CLICK, showInfo);
function showInfo(evt:MouseEvent):void {
    stateInfo.htmlText = this[evt.currentTarget.name+"Info"];
and here is what the map looks like now with the spacing issues when i click on alabama-

Similar Messages

  • Load AS2 swf into AS3 swf problem

    I have a flash with AS3 and inside this swf i load in a AS2 swf.
    to load swf works just fine, but the problem is when i load this i want to go to
    a specific part of it, for example i want to go to frame 3 in the loaded swf.
    i must control this from the AS3 swf, does someone know if this is possible?
    thanks in advance

    so can i do like this then to go to frame 3 in my loaded swf?
    MovieClip(ldr.content).gotoAndStop(3); ?
    sorry for being such an airhead
    thanks for helping me out =)
    Date: Sun, 7 Jun 2009 10:25:09 -0600
    From: [email protected]
    To: [email protected]
    Subject: load AS2 swf into AS3 swf problem
    no.
    if, in your loaded swf, you have a function f1() on the loaded swf's main timeline and you load that swf using a loader (say ldr), use:
    MovieClip(ldr.content).f1();   // to call f1() in the loaded swf
    >

  • AS3 SCORM problem

    Hi there,
    Hope someone can assist!
    I am publishing my Captivate 4 project with AS3 settings, as I have created a few animations in AS 3 that are inserted. Now I am publishing it and putting it on our scorm compliant LMS, it is not communicating with the LMS.
    I have also published a file in AS2, which worked just fine in communicating with the LMS. Just took a course with one slide published it with AS2, then tried the same content exactly same settings only selecting AS3 and it didn't work.
    One of the differences is that with AS3 settings it also wants to open a new empty window, which it doesn't do with the AS2 setting.
    I have done some checking with the firebug in Firefox and it looks like it loads just fine, but when it starts playing it misses the communication with the LMS.
    I was wondering if there are any solutions out there...
    Thanks a lot!
    Annemarie

    No such thing as a stupid question....
    Yes I did check those settings... and that seems to be causing the problem.
    I just took an empty, new presentation (just for the process of elimination, no other values/factors involved) set the captivate settings to AS2 published tried it on the LMS, worked fine.
    Then same empty slide, set the captivate settings to AS3, all other settings remained exactly the same, tried it on the LMS, it plays fine, but there is no communication to the LMS.
    It loads all the swf files correctly, then with AS2 published file, it starts the "soaplms.php?op=initialize" and you can see in firebug (net) that the "scorm_support.swf?invokemethod etc" communicates with the LMS every few seconds, so it is reporting my progress and all that I do in the course.
    With the AS3 settings, it never does the "soaplms.php?op=initialize", and actually at that moment it should display this message, it opens a new emtpy window. The course continues to play and all the buttons work, but it doesn't communicate to the LMS what my progress is or what I have done in the course.
    There is a document that talks about the scorm compliance of Captivate and it mentioned that you might need to check that the API can be found, so I did that edited the html file, added the alert,  and the API can be found when launching the AS3 published file.
    I have also tried it on the scorm tracker site from rustici, which is a great resource by the way: http://www.scorm.com/scorm-solved/testtrack/
    You can upload your zip files and see the debug reports so you know exactly what happens in terms of communication to the LMS.
    ActusxReus wrote:
    stupid question, but did you double check that you selected Actionscript 3 in your Captivate preferences?
    ActusXreus, have you succesfully used AS3 settings in a course and published it and used it on an LMS where it did track the results? Or if there is anyone else out there that did use these settings successfully, I would really like to know and maybe see what type of settings you have used in the other areas...
    Thank you so much!
    Best regards from the Bahamas
    Annemarie

  • AS3 comboBox problem.

    Ok, I have a simple ComboBox with instance name of dragonCombo
    A Lable with an instance name of dragonLabel
    Using a an AS3 called Dragon.as
    When the ComboBox is clicked, a picture should pull up.   The problem is, there are no errors, but The ComboBox is not listing any of the Labels I loaded.  This is my AS3 code, maybe someone can see the mistake I have made somewhere.
    package
    import flash.display.MovieClip;
    import flash.display.Loader;
    import fl.controls.ComboBox;
    import fl.data.DataProvider;
    import flash.events.Event;
    import flash.text.TextFieldAutoSize;
    import flash.net.URLRequest;
    import flash.net.navigateToURL;
    import fl.controls.Label;
    public class Dragons extends MovieClip{
    public var dragonCombo:ComboBox;
    public var dragonLabel:Label;
    var comboDP:DataProvider;
    var dragonLoader:Loader;
    public function Dragons() {
    setupComboDP();
    setupdDragonCombo();
    setupLabels();
    private function setupComboDP():void{
    comboDP = new DataProvider();
    comboDP.addItem({ Label:"Fire"});
    comboDP.addItem({ Label:"IceNFire"});
    comboDP.addItem({ Label:"Ghost"});
    private function setupDragonCombo():void{
    dragonCombo.width = 150;
    dragonCombo.prompt = "Choose a Dragon";
    dragonCombo.dataProvider = comboDP;
    dragonLoader = new Loader();
    dragonLoader.x = 200.00;
    dragonLoader.y = 60.00;
    addChild(dragonLoader);
    dragonCombo.addEventListener(Event.CHANGE,loadData);
    public function setupLabels():void{
    dragonLabel.text="";
    dragonLabel.autoSize = dragonLabel.autoSize = TextFieldAutoSize.LEFT;
    public function loadData(e:Event):void{
    dragonLoader.load(new URLRequest("dragons3/"+e.target.selectedItem.Label.toLowerCase()+".png"));

    Your Dragons class is creating its own dragonCombo (it is not the one on the stage)...
           public var dragonCombo:ComboBox;
    that has no association with the combobox you placed on the stage manually as far as I can see.
    Assuming this is not your document class, if all you are doing is importing the Dragons class, then you are not implementing it at all.  You would have to have a line...
         var dragons:Dragons = new Dragons();
    in you fla in order to instantiate the class.  At that point you might start seeing error messages because in doing that your class is trying to target an object that doesn't exist because it only declared the combobox, it did not create an instance of it, as in...
          dragonCombo = new ComboBox();

  • AS3 text problem

    Hi,
    Just playing with some AS3; and encountered the following
    problem (CODE IS ATTACHED):
    Wanted to create a MC button I seen done on the
    gotoandlearn.com site, but wanted to change it from AS2 to AS3;
    Everything works fine, but where I am assigning a value to a
    dynamic text field it not working.
    b1_mc.buttText_mc.buttonText_txt.text = "Lynda.com";
    When I test movie, lynda.com is the text on my MC button, but
    Upon ROLL_OVER etc... it displays the test text, not
    Lynda.com.
    Can someone please help me out here. It would be appreciated.
    Kind Regards,
    Boxing Boom

    Hi,
    Yes. Well spotted. I had the instance name of buttText_mc,
    missing the _mc part on a few frames with motion tweens applied, on
    the button animation. I do not remember renaming it differently ;)
    - must blame tools ;)
    Kind Regards,
    Boxing Boom

  • Tlftextfiled in textarea as3 component problem?

    i customize as3 textarea component (in source : fl.control.TextArea)
    i chnage textField in source to tlfTextFiled and i cand see RTL text in textArea component, but i have a problem , and i can not see affect my change in Direction
    please help me to change direction in this component
    excuse me for my poor english

    i customize as3 textarea component (in source : fl.control.TextArea)
    i chnage textField in source to tlfTextFiled and i cand see RTL text in textArea component, but i have a problem , and i can not see affect my change in Direction
    please help me to change direction in this component
    excuse me for my poor english

  • As3 preloader problem - Captivate5

    Hello all,
    Been searching around for this for a bit in a the forums and cant find anything on it here goes:
    I have a project that i built with a ToC for my company.  And i have a as3 preloader as well.
    Problem:
    Preloader is fine and centered in the middle of my project with out a ToC but when i add the Toc the preloader will not center in my project i have tried to alter it in the html file insterting <center> tags and such and also externalizing the skin or FMR SWF also removing and placing it back in and not getting a fix for it. I realize this maybe a simple fix but i cant find anything in the forums here discribing exactly this issue.
    can anyone help
    thanx
    bobby

    Hi,
    Going out on a stretch here but did you, by any chance, added external swf or widgets that would have set the values of either Stage.scaleMode or Stage.align. That could explain the effects you are seeing.
    Whyves
    www.flash-factor.com

  • AS3, .htmltext,  .embedFont and/or .antiAliasType makes b disappear

    I've been trying to find a solution for this problem for a while and I still can't get a working solution. I've googled the problem and it looks like it's a known issue yet I still can't get a definitive fix that actually works.
    I create a dynamic text field that's populated with html text from an .xml file.  It looks like .embedFont and/or .antiAliasType makes the html <b> formatting disappear. I HAVE to have the bold text per client needs.
    Here's my code that was written based on posts I've seen online by other people with the same issue.
    "fontHelvetica" is a font that is in the .fla's library and it is the linkage name. 
    Every format works except the html <b>.
    How do I make the <b> work?
    Is there a definitive solution or a link to a site that has a working solution?
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.text.TextFieldAutoSize;
    import flash.text.Font;
    var fontIntroDisclaim:Font = new fontHelvetica();
    var introDsclmFrmt:TextFormat = new TextFormat();
        introDsclmFrmt.font = fontIntroDisclaim.fontName;
        introDsclmFrmt.color = 0xFFFFFF;
        introDsclmFrmt.size = 16;
        introDsclmFrmt.letterSpacing = .1;
        introDsclmFrmt.leading = 01;
    var introDsclmTxt:TextField = new TextField();
        introDsclmTxt.width = 1150;
        introDsclmTxt.x = introDsclmTxt.y = 0;
        introDsclmTxt.multiline = true;
        introDsclmTxt.selectable = false;
        introDsclmTxt.wordWrap = true;
        introDsclmTxt.defaultTextFormat = introDsclmFrmt;
        introDsclmTxt.autoSize = TextFieldAutoSize.LEFT;
        introDsclmTxt.antiAliasType = AntiAliasType.ADVANCED;
        introDsclmTxt.embedFonts = true;
    introDsclmTxt.htmlText = ifxLandingDisclaimer;
    introDsclmTxt.setTextFormat(introDsclmFrmt);
    intro1_mc.introDisclaim_mc.addChild(introDsclmTxt);
    Thanks in advance for your response.
    Zak.

    Thanks for the response Kglad. You suggestion helped me to fix the issue.

  • Yet another htmlText problem!

    As I know htmlText has it's plethora of problems, I have been able to work around a few of them. However, after trying many different things, I cannot seem to fix this one:
    <mx:Text htmlText="{_articleText}" width="100%" fontSize="12" color="0x282828" />
    In the script, I set _articleText = "<img src='"+dataProvider.imageURL(_model.account.id)+"' align='"+dataProvider.imageAlignment+"' />"+dataProvider.body;
    This is fine, the image aligns to the left or right and is loaded in correctly, but I notice the element cuts off 3-4 lines of text from the bottom. It just looks like it disappeared, but if you highlight and scroll down you can see that the text is there, but the element is miscalculating the height.
    Apparently it is due to the measure method of text not taking into account leading? How can I work around this?
    Thanks.

    Oh, and one other question..
    Is there any way to put a border on an image in htmltext? I suppose border="1" and padding="2" were too complex to include in the htmlText language for whatever reason, so I was wondering if there is a different way?

  • AS3 oop problem

    I am a beginner with oop. Can anyone help me to understand
    what is wrong
    with this:
    public class MyClass{
    //set some variables in constructor
    public function myMethod():void{
    //my code
    myMethod();
    The line that calls the function generates the error message:
    Call to a possibly undefined method myMethod.
    Why?
    Doug

    Doug,
    > Thanks for that. I've got it working now. I only mention
    > AS3 as I've never used oop techniques with AS2 and I
    > thought it might be different.
    AS3 refers to ActionScript 3.0, a bona fide new version of
    the language
    (in fact, only in beta release, as of yet). See LiveDocs for
    details ...
    http://livedocs.macromedia.com/specs/actionscript/3
    ... the approach you're using, even if you're aiming for OOP,
    is still AS2.
    David
    stiller (at) quip (dot) net
    Dev essays:
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • AS3: Timing problem

    Hey,
    I have an 2 animations that I need to syncronize. The first animation is a projector screen entering stage, the second is few text layers and images.
    I timed the second animation 2.2 sec after the screen animation starts (using timer event) and it worked. When I tested it in other computers and on the internet the screen movment was much slower so the second animation entered the stage too fast.
    I want to order the second animation to enter only when the projector screen reach it's destination on stage. The screen animations has 2 parts, in animation and out animation connected by a stop(); commend in the middle.
    How can I do it without timer events?

    let say you want second_mc to play when first_mc is at frame 10.
    get in first_mc and add actionscript keyframe at frame 10 (you can add another blank script layer for this keyframe)
    to it's as3 code paset:  (root as MovieClip).second_mc.play();
    at frame one of second_mc add stop();
    shuld work now....
    אם אתה לא מסתדר שלח לי במייל את הבאנר ואת הפריים ממנו האנימציה צריכה להתחיל
    [email protected]

  • AS3 Loading problem

    Hello All,
                 I have written a simple AS3 Code to load a SWF File on he Stage. The file is loading properly but the Within the stage. The Width and height of the SWF file change. Like LoaderInfo return file size 200X200 , but after adding child the Width and height changes to 150.23 X150.23. I'm accessing the length of the loader.content property. At what ratio the change is a happening? I have attached the code...  Document property show content radio button clicked.
    stage.scaleMode=StageScaleMode.EXACT_FIT;
    //stage.scaleMode=StageScaleMode.NO_SCALE;
    //stage.scaleMode=StageScaleMode.SHOW_ALL;
    var Clip:Loader = new Loader();
    var req:URLRequest=new URLRequest("1.swf");
    Clip.contentLoaderInfo.addEventListener(Event.INIT,initListener);
    Clip.contentLoaderInfo.addEventListener(Event.COMPLETE,LoadingDone);
    Clip.load(req);
    var info:LoaderInfo;
    function initListener(event:Event):void {
         var SwfClip:Loader=Loader(event.target.loader);
         info=LoaderInfo(SwfClip.contentLoaderInfo);
         trace("File properties :- \n" + "width :- " + info.width + "\nHeight :- " + info.height);
    function LoadingDone(event:Event):void {     
         this.addChild(Clip);          
         trace(Clip.width + "  " + Clip.height + " " + (event.target.content).width + "  " +(event.target.content).height);

    You have stage.scaleMode set to EXACT_FIT which is causing the container to scale... and causing the loaded swf to scale as well. Remove that, or use No_SCALE and it will return the proper size.

  • Style a tag in htmlText problem

    I want to show an anchor as a standard blue underlined text.
    I created a style sheet in the mxml with this line:
    a:link{color:blue}
    and this
    a {color:blue}
    Nothing. All day I've been trying to make a link blue in Flex
    2. Other things in the style sheet work, I changed the
    background-color or the Application in the same style tag. Below
    the anchor I changed Button to color:white.

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.controls.Text;
    private function styleit(txt:TextArea):void
    var style :StyleSheet = new StyleSheet();
    var aLink:Object = new Object();
    aLink.color = "#0000EE";
    aLink.textDecoration="underline";
    aLink.fontSize="14px";
    style.setStyle("a:link", aLink);
    txt.styleSheet=style;
    ]]>
    </mx:Script>
    <mx:TextArea width="500" height="500" id="txt1"
    creationComplete="styleit(txt1)">
    <mx:htmlText>
    <![CDATA[
    <a target="_blank" href="
    http://www.google.com">blue
    underlined 14px</a>
    ]]>
    </mx:htmlText>
    </mx:TextArea>
    </mx:Application>

  • AS3 + FMS2 = problem with "stream" MP3

    I use AS3!
    I can not get mp3 "duration" (Net Stream)
    where event: onID3??????? how it works???? and it works?????
    help plz :)

    My guess is that its to do with your embedding code. Check a)
    you have an id attribute assigned to the resulting object tag from
    whatever embedding method you use and b) for good measure make sure
    its unique in your html page.
    Javascript needs to have a valid reference to return the
    value from the javascript function back to flash. In my experience
    IE is more sensitive to issues here.
    If you get stuck post a test page somewhere.
    Tools to use to help with javascript debugging and view the
    html embed results (e.g. from swfobject or activecontent.js):
    In firefox : Firebug
    In IE: IE Developer Toolbar , Companion JS, and DebugBar are
    all helpful and , combined, get close to Firebug.

  • AS3, htmlText, bold b throwing of letter spacing. letters crashing into each other.

    I have an htmlText field that holds a few paragraphs of text that is pulled from an xml file. There are <b> bold tags within the xml node.
    When a section of bold text is in the middle of normal text, the normal text will crash into the beginning & end of the bold text, see pic:
    I'm assuming that the bold text and the regular text  have different letter spacing so I removed the  ".letterSpacing = .2;" from the font declaration in order to let the text render at it's normal letter spacing. That helped a little in making the crashing a little less but it hasn't cleared it up completely.  Also, depending on the font size, the letter crashing acts differently.
    Is there a way to better control the letter spacing of bold text next to normal text in a dynamic text field?
    Thanks in advance for your reply.
    Zak

    I'm going to try using CSS with my dynamic textfield to see if this solves the letter spacing issue. Has anyone used CSS in dyanmic text field to better control the spacing between bolded & normal text?
    Zak

Maybe you are looking for

  • HP color laserjet CP2025 will not print. Help.

    I have a HP color laserjet CP2025, but it will not print. I installed the driver HP Color LaserJet CP2020 Series PCL 6. I have a Windows Vista Home Premium. There is a message to replace the cyan cartridge, but I assume if the printer has black ink,

  • RFUMSV00 tax report - add column numbers

    Hello Is it possible to add for every column in RFUMSV00 (transaction S_ALR_87012357) a sequential number (which will correspond to numbers in legaslation vat report) ? Something like this: 1               2         3       4 Invoice nr.   Customer 

  • Vista upgrade order doesn't seem to be correct

    Hi there! The instructions in the PDF on the Toshiba Vista Upgrade site (http://uk.computers.toshiba-europe.com/cgi-bin/ToshibaCSG/generic_content.jsp?service=UK&ID=2006-10-Vista-Express-Upgrade-UK) don't seem to be correct. I've bought a Portege M40

  • Smartswipe is available for myWindows OS, but why can't I find it for my Linux OS?

    I have Windows 7 installed, and have the add-on for Smartswipe installed. I just installed Linux Ubuntu to try it out. It comes with Firefox, but I can't find the Smartswipe add-on for it in the list of available add-ons. What happened to it?

  • Firefox Support forum web page doesn't show any text

    All other web pages load perfectly except Firefox Support Forum. It shows only search box and some tag words. When I type into search box, nothing shows but when I hit enter I get only tag words that I typed. I've tried reinstalling FF and started in