Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scaling Dynamic Text?

Status
Not open for further replies.

zeveck

Programmer
Jun 6, 2005
142
US
I am using Flash MX.

I am trying to scale a dynamic text field so that I display an arbitrarily large number in a set region of the screen.

I have tried setting ._xscale, but it seems to just be reducing the width of the text field and cutting off the text instead of scaling it. What am I doing wrong?
 
_yscale is the height

but your question suggests you want a higher/lower font size depending on the number


always best to give your existing code as its then clearer what you are trying to do and then someone will post a fix


 
Well, the code is very simple:

Code:
    // update money display
    moniesTXT.text = Math.currencyFormat(player1.money);

    if (1000 < player1.money) {
        moniesTXT._xscale = 75;
    } else {
        moniesTXT._xscale = 100;
    }
 
Is it possible to change other properties of a text field such as _alpha and _rotation using this script or a similar script?

_____
Alex
 
Odd. No, no settings work.

Then I went and found the Character button in Flash MX and selected Embed Font Outlines For All Characters. However, I thought I had already done this, because I already set the font to an imported and named font and already have the code moniesTXT.embedFonts = true.

What is the difference between these settings? Do I have to do all these things to get font effects to work? Or...?
 
Alex is stumped and has been for a long long time about this

_____
Alex
 
Would this work if the text was under a mask layer or had _alpha properties?

_____
Alex
 
I don't actually have a flash file with this situation, but if I knew how to do it it would certainly broaden my flash abilities

_____
Alex
 
As far as I can tell nesting it within a MovieClip doesn't help. When I tried scaling down the MC the text just cut cut off.

That said, once I was embedding the font correctly and had it figured out such that it worked right with the textfield iself, then it also worked by manipulating the containing MC.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top