Avatar

Level 3

got it...there was 1 small typo in that script. its the last line it should be: TextField1.font.size = newSizeInt + "pt";

I know thats what you meant...your comments in the scripts were really helpful and explained your method...Thanks heaps!

So just to wrap it up again, this is code that I am using and it works:

/This code is for the "+" button

// get font size

var currentSize = TextField1.font.size;

// get location of the "pt" string

var ptPlace = currentSize.indexOf("pt");

// get the part of the string that is just numbers

var currentSizeInt = currentSize.substr(0,ptPlace);

// parse that new string as an integer and add 1

var newSizeInt = parseInt(currentSizeInt,10)+1;

// set that as the new font size ( adding the "pt" back on)

TextField1.font.size = newSizeInt + "pt";

Thanks again Malcolm!