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)
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…
: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