![MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Скачать руководство пользователя страница 75](http://html1.mh-extra.com/html/macromedia/flex-developing-components-and-themes/flex-developing-components-and-themes_manual_3388115075.webp)
Using the ModalText example
75
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. You may call more than one if you need to.
invalidateLayout();
}
function get labelPlacement():String
{
return __labelPlacement;
}
var __text:String = "ModalText";
[Inspectable(defaultValue="ModalText")]
function set text(t:String)
{
__text = t;
Содержание FLEX - DEVELOPING COMPONENTS AND THEMES
Страница 1: ...Developing Flex Components and Themes in Flash Authoring ...
Страница 4: ...4 Contents ...
Страница 44: ...44 Chapter 2 Creating Basic Components in Flash MX 2004 ...
Страница 82: ...82 Index ...