Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 130

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

}
}
}
}
}
In this example, the setter method checks that the specified font size is less than the
predefined limit of 30 pixels. If the font size is greater than the limit, it sets it to the limit.
Creating a default property
You can define a default property for your ActionScript components by using the
[DefaultProperty]
child tag of the component tag without specifying the property name. For more information
on using the default property, including an example, see "Setting the default property" in Flex
2 Developer's Guide.
130
Creating Simple Visual Components in ActionScript
case 73 :
if (currentFontSize < maxFontSize) {
currentFontSize = currentFontSize + 1;
setStyle('fontSize', currentFontSize);
}
break;
// Was Ctrl-M pressed?
case 77 :
if (currentFontSize > minFontSize) {
currentFontSize = currentFontSize - 1;
setStyle('fontSize', currentFontSize);
}
break;
default :
break;
metadata tag. You can then use the default property in MXML as the

Advertisement

Table of Contents
loading

Table of Contents