Skip to main content
Inspiring
January 2, 2012
Answered

font size not working...*&^%$

  • January 2, 2012
  • 1 reply
  • 902 views

Hi all,

I don't know whats going on but my code is not changing the size of my text.

I have a toggle button that works great on everything exept the text size.

I have a text dynamic text field called myText and here is the code I'm using.

function maisLegendaF(e:MouseEvent):void{

          var formatT:TextFormat = new TextFormat();

 

  if(!e.currentTarget.toggle){

  myButton.gotoAndStop(2);

                    formatT.size = 19;

                    myText.setTextFormat(formatT);

          }

  else {

                    myButton.gotoAndStop(1);

  formatT.size = 12;

  myText.setTextFormat(formatT);

          }

          e.currentTarget.toggle = !e.currentTarget.toggle;

}

Can anyone help me out here? PLS?

Thanks in advance!!!

This topic has been closed for replies.
Correct answer yalp_com_br

The code you show works fine for me if I create the supporting elements and test it.  Try recreating it in a separate new file and see if the problem remains.


I don't know what is happening I'm trying on diferent files and nothing works....I solved it using scale on the text box!

thanks a lot!!

1 reply

Ned Murphy
Legend
January 2, 2012

What kind of object is e.currentTarget?  HAve you tried tracing the toggle value to see what it is before it gets tested in your conditional?

Inspiring
January 3, 2012

its a movie clip

Ned Murphy
Legend
January 3, 2012

The code you show works fine for me if I create the supporting elements and test it.  Try recreating it in a separate new file and see if the problem remains.