User Control of Input Text Size

Hey all,

I want to create a button on my root page that can change the size of the font a user is working with in an input text field. I’m not sure if it’s easier to have buttons designated for certain sizes or to increase size by a set amount, but here’s what I’ve tried so far using an online tutorial (didn’t work for me, but…)


on (release) {
	var myformat = new Textformat();
	myformat.size = 20;
	_root.page.textbox.setTextFormat(3, 6, myFormat);
}

(page is the name of the movieclip my textbox, cleverly named “textbox”, is in)

Any ideas why this might be wrong?(-:

That should work. If you are using Flash 8 you might want to change Textformat to TextFormat, because I think it is case sensitive, and the correct identifier is the latter. That set up is working for me in MX. If it still doesn’t work you might want to add trace(_root.page.textbox) to your code so you can see if you are correctly identifying your textbox.

I’ve never used trace before, so I’m not sure if I did it right (prolly not), but I have another button that clears the input text field, and that uses the same path _root.page.textbox

My fla file (or a similar one) is at http://www.pixelmiyu.com/fla (kitties2.fla) if you have time to look at it! I’m still a bit stumped…

Alright, here is the fixed FLA. It ended up that it was working, but you had it set so that only characters 3-6 were being resized in the textbox.

>>Fixed FLA link

Hope this helps!

Thanks so much for your help! One more little problem…the link to the fla seems to be broken! Thanks again:}

Sorry about that :D. The link is fixed now :slight_smile:

GREAT! It works! Lovely…

I looked at the difference between the two files and all I could find was a single extra space between setTextFormat and (myformat)

Man, is actionscript always so picky?

THANK YOU! :angel:

:lol:. Out of all languages, I guarentee you that flash is the least picky. There are a couple more differences in the AS than you mentioned, but not many :slight_smile: