voitek
09-03-2006, 11:30 PM
I wrote a little aid that makes it extremely easy to draw text fields of an exact size.
As every Flash user knows, it is not as straightforward as it should be.
I wrote it as a new tool which you can add to the toolbox (in MX2004 or 8). Just unzip the contents of the attached file to the
[C:]\Documents and Settings\<username>\Local Settings\Application Data\Macromedia\Flash 8\en\Configuration\Tools\
and then choose edit->customize tools panel... option to assign the new tool (called exacText) to a button.
To use it click the tool in the tools panel, click options... to set the desired size, set other options and click on the stage. If the font size is not too big to fit in the size specified, the created text will be exactly of the size you want. Otherwise it will be bigger, so it's better to set the font size to some small value before drawing the text field.
Important!
Please save your work before using my tool! It's my first tool written in js api and even if it does what it should do so far and works fine for me it's not tested anywhere else and it may crash your program.
Maybe someone who is more proficient in writing tools could help me improve it. The main disadvantage is that this tool is being deactivated when it calls the fl.getDocumentDOM().addNewText(...) function to draw the text field. I've also noticed that after I use my tool it shows the hourglass pointer until I click somewhere else. I don't know what it means and how to fix it.
Anyways, I hope you'll like it.
As every Flash user knows, it is not as straightforward as it should be.
I wrote it as a new tool which you can add to the toolbox (in MX2004 or 8). Just unzip the contents of the attached file to the
[C:]\Documents and Settings\<username>\Local Settings\Application Data\Macromedia\Flash 8\en\Configuration\Tools\
and then choose edit->customize tools panel... option to assign the new tool (called exacText) to a button.
To use it click the tool in the tools panel, click options... to set the desired size, set other options and click on the stage. If the font size is not too big to fit in the size specified, the created text will be exactly of the size you want. Otherwise it will be bigger, so it's better to set the font size to some small value before drawing the text field.
Important!
Please save your work before using my tool! It's my first tool written in js api and even if it does what it should do so far and works fine for me it's not tested anywhere else and it may crash your program.
Maybe someone who is more proficient in writing tools could help me improve it. The main disadvantage is that this tool is being deactivated when it calls the fl.getDocumentDOM().addNewText(...) function to draw the text field. I've also noticed that after I use my tool it shows the hourglass pointer until I click somewhere else. I don't know what it means and how to fix it.
Anyways, I hope you'll like it.