public
Description: Behavior Injection for Flex - a jQuery-like behavior injection framework for flex
Home | Edit | New

BehaviorSheet

You can use the BehaviorSheet tag to create a BehaviorMap from a css style sheet.

You can set properties, styles and behaviors for any matched components. This supports the full range of Selector and just creates a Set tag for each css rule. It also allows you to associate behaviors by class reference. Note that none of this is unique to BehaviorSheet. BehaviorMap can do anything this can, and much more, but it uses an MXML syntax instead of css.

Please remember that behaviors are associated after creation complete, so using this to set styles will override any inline settings in your app.

Example

Demo
/ Source

Usage

<!-- BehaviorSheetExample.mxml -->
<BehaviorSheet url="styles/test.css" target="{this}"/>
/* test.css */
Button#henry
{
	height: 300;
	font-size: 72;
	label: "I am a button";
}

.panel Button
{
	width: 300;
	behavior: net.seanhess.bifff.behaviors.TestClick;
	behavior: net.seanhess.bifff.behaviors.Trace(message:"hello");
}
Last edited by seanhess, Sat Mar 21 22:14:02 -0700 2009
Home | Edit | New
Versions: