3 Replies Latest reply on Apr 27, 2011 8:44 PM by Jimondo

    font/code problem

    Jimondo Level 1

      I have a button that when clicked it displays a few lines of text. Some of the text is large, bold and some of it is normal and smaller size. The first time I click the button the text displays properly but if I click on it a second time then the text is messed up. I am new to flash and have tried several different things- i know my code must be wrong but i can't figure out how to fix it on my own. Any ideas how to solve this problem? Thanks!

        • 1. Re: font/code problem
          Ned Murphy Adobe Community Professional & MVP

          If yoiu think it might be a coding issue, you should show the code.

          • 2. Re: font/code problem
            Jimondo Level 1

            Hi Ned, this is something  you helped me with before- getting the code setup for my map using dynamic text field. I am having a really hard time understanding the actionscript and getting it to do what I want like for the different fonts. I am new to flash and have no idea what I'm doing when it comes to the code- it makes no sense to me. In the properties i have the font set to Arial regular 14 point. I'm using actionscript 3. If i leave the code the way it is now it works on the first click but if i click on it a second time then the text gets all messed up. Here is what I want it to look like.


            washingtonrep name
            555-123-4567

            small text

             

            washingtonrep name
            555-123-4567

            small text

             

            Here is the code:

             

            var washington_btnInfo = "<b><font size=18>washingtonrep name<br>555-123-4567</b></font><br>small text";

             

            var oregon_btnInfo = "oregon";

             

            washington_btn.addEventListener(MouseEvent.CLICK, showInfo); // assigns a listener to the button
            oregon_btn.addEventListener(MouseEvent.CLICK, showInfo);

             

            // for the above you will do the same for the rest of the state buttons... they can all share the following event handler function because it uses their names to identify the text variable that will be assigned to the textfield

             

            function showInfo(evt:MouseEvent):void {
                stateInfo.htmlText = this[evt.currentTarget.name+"Info"];
            }

            • 3. Re: font/code problem
              Jimondo Level 1

              mapScreenShot.jpg