hey all,
I have custom inputText class created extending Sprite which works fine and i can asign whatever text format that i want which is stored in an all-static TextValues class.
Now i am trying to create custom labeling class where i do not need anything from Sprite just text and text formating. Followed pretty much the same steps as the previous class that i've created but the text format just doesnt seem to work. Is there any reason why it works while extending Sprite and doesnt work when extending TextField ? Any suggestions? AS below:
GroupLabel class which creates the label that i need.
Code:
package com.Graphics{
import flash.text.*;
import com.Graphics.TextValues;
public class GroupLabel extends TextField{
public var GROUPLABEL:TextField = new TextField();
public function GroupLabel(labelText:String = "Group Lable"):void {
GROUPLABEL.wordWrap = false;
GROUPLABEL.type = TextFieldType.DYNAMIC;
GROUPLABEL.x = 0;
GROUPLABEL.y = 0;
GROUPLABEL.tabEnabled = true;
GROUPLABEL.setTextFormat(TextValues.labelFormat);
}
}
}
TextValues class which stores all of the text formating. As i mentioned before i can asing the formats from this class and it works ok but for some reason the class above just wont asing any of the formating.
Code:
package com.Graphics{
import flash.text.TextFormat;
import com.Graphics.ColorValues;
public class TextValues {
public static var groupFormat:TextFormat = new TextFormat();
groupFormat.font = "Arial";
groupFormat.bold = true;
groupFormat.color = 0x000000;
groupFormat.size = 50;
public static var labelFormat:TextFormat = new TextFormat();
labelFormat.font = "Arial";
labelFormat.bold = true;
labelFormat.color = 0x000000;
labelFormat.size = 12;
}
}
Thanks for any help!