Dynamic text field

ok i have a dynamic text field that gets its content from an xml file, the content is pretty random in width, also the text field will be placed inside a graphic made in flash, i need this graphic to contract and expand according to the width of the content, any ideas, thanks

>> text field will be placed inside a graphic made in flash
it’s in a complicated way, not exact image conceived
http://dnadillo.dn.ua/fla/XML/img-xml.swf
look xml file
http://dnadillo.dn.ua/fla/XML/mur_xml_file_img.xml


[COLOR=#0000ff]<[/COLOR][COLOR=#990000]img[/COLOR] [COLOR=#990000]src[/COLOR][COLOR=#0000ff]="[/COLOR]**http://dnadillo.dn.ua/images/imag/magna_carta_131.JPG**[COLOR=#0000ff]"[/COLOR][COLOR=#990000] width[/COLOR][COLOR=#0000ff]="[/COLOR]**400**[COLOR=#0000ff]"[/COLOR][COLOR=#990000] height[/COLOR][COLOR=#0000ff]="[/COLOR]**270**[COLOR=#0000ff]"[/COLOR][COLOR=#990000] hspace[/COLOR][COLOR=#0000ff]="[/COLOR]**100**[COLOR=#0000ff]"[/COLOR][COLOR=#990000] vspace[/COLOR][COLOR=#0000ff]="[/COLOR]**10**[COLOR=#0000ff]" />[/COLOR] 

[SIZE=2]but img x and y I am [SIZE=2]
incomprehensibly
[COLOR=#990000]hspace it’s [SIZE=2]distance before text
[/SIZE][/COLOR][COLOR=#0000ff][/COLOR]
[/SIZE][/SIZE]

thanks i will take a look