# Flash CS$4/ action script 3.0

**URL:** <https://forum.kirupa.com/t/flash-cs-4-action-script-3-0/283259>\
**Category:** flash\
**Created:** [March 4, 2009, 7:21am UTC](https://forum.kirupa.com/t/flash-cs-4-action-script-3-0/283259 "2009-03-04T07:21:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BaddieSana](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@BaddieSana](https://forum.kirupa.com/u/BaddieSana)\
**Post date:** [March 4, 2009, 7:21am UTC](https://forum.kirupa.com/t/flash-cs-4-action-script-3-0/283259/1 "2009-03-04T07:21:53Z")

</div>

Dear Experts, i have a class that will not run in Flash CS4  
myLabel.autoSize = TextFieldAutoSize.CENTER

i have tried everything to get it to work, here is the code, i am runing it from flash with a class called main, if i comment the culprit line it the rest of it works.

## error : 1120: Access of undefined property TextFieldAutoSize.

package {  
import flash.display.Sprite;  
import flash.text.TextField;  
import flash.text.TextFieldType;  
import flash.text.StyleSheet;  
import flash.text.TextFormat;  
import fl.controls.Label;  
import fl.controls.Label.textField;  
public class InputField extends Sprite {  
public function InputField(setX:Number,setY:Number,setType:Number,setHeight:Number,setWidth:Number,setText:String) {  
if (setType==1) {  
drawLabel(setX,setY,setHeight,setWidth,setText);  
}  
}  
private function drawLabel(setX,setY,setHeight,setWidth,setText){  
//var myFont:Font = new MyFont();  
var myTextFormat:TextFormat = new TextFormat();  
[//myTextFormat.font](https://myTextFormat.font) = myFont.fontName;  
myTextFormat.size = 18;  
myTextFormat.align=“left”;  
myTextFormat.color=“0x00CC00”;  
myTextFormat.font=“Arial”;  
var myLabel:Label = new Label();  
[COLOR=red][//myLabel.autoSize](https://myLabel.autoSize) = TextFieldAutoSize.CENTER[/COLOR]  
myLabel.y=setY;  
myLabel.setStyle(“textFormat”, myTextFormat);  
addChild(myLabel);

}  
}  
}

I welcome any help! Thaks  
BaddieSana
