text_mc.move(0, 0);
}
else
{
mode_mc.move(0, 0);
text_mc.move(mode_mc.width, 0);
}
}
/*** i) implement draw
// Set flags when things change so we only do what we have to.
private var bTextChanged:Boolean = true;
// Set text if it changed, and draw a border.
function draw():Void
{
clear();
if (bTextChanged)
{
bTextChanged = false;
text_mc.text = text;
}
// Draw a simple border around everything.
drawRect(0, 0, width, height);
}
/*** j) add methods, properties, metadata ***/
// The general pattern for properties is to specify a private
// holder variable.
private var __labelPlacement:String = "left";
// Create a getter/setter pair so you know when it changes.
[Inspectable(defaultValue="left", enumeration="left, right")]
function set labelPlacement(p:String)
{
// Store the new value.
__labelPlacement = p;
// Add invalidateSize(), invalidateLayout(), or invalidate(), depending on
// what changed.
invalidateLayout();
}
function get labelPlacement():String
{
return __labelPlacement;
}
var __text:String = "ModalText";
[Inspectable(defaultValue="ModalText")]
function set text(t:String)
{
__text = t;
***/
You may call more than one if you need to.
Using the ModalText example
75
Need help?
Do you have a question about the FLEX - DEVELOPING COMPONENTS AND THEMES and is the answer not in the manual?
Questions and answers