First off I am fairly new to flash. My problem is getting the pixel width of a
autosized textbox which is part of a button. This will be part of a navigation
system which first reads the data from a xml file and then creates the
navigation bar. I can get the length of the charaters in the textbox with no
problem, but i cant seem to get the width of the textbox.
The top level buttons are set up using the var "title" to populate their text
from the xml.
Below is a sniplet of the code I am using:
for(i=0;i<no_sections;i++){
var lenStr = 0;
var sub_yval = 25;
duplicateMovieClip("navbar.clip","clip"+i,i+lenStr);
eval("navbar.clip"+i).title = root_element.childNodes.attributes.title;
//This portion gets the characters in the textbox, but is really not even
needed.
var ThisStr =
root_element.childNodes.attributes.title;
lenBox = Length(ThisStr);
eval("navbar.clip"+i)._x = xval;
eval("navbar.clip"+i).title.autoSize = "center";
//I should be able to get the width
of the textbox now that it has been populated and autosized.
//var lenStr = eval("navbar.clip"+i).nbutton.textnbutton._width;
eval("navbar.clip"+i).nbutton._width = lenStr;
Any assistence would be much appreciated. I have searched all over trying to
find a solution to this problem. Thanks.