-
Changing the color the cells of The data grid
Hello there,
Is it possible to guide me for making a reference to Items in the data grid in order to change its properties when they wanna add to stage ?
Thank you
-
Senior Member
Here is a script I made for a component, which has a datagrid:
PHP Code:
package biz.Flashscript.helper
{
import fl.controls.listClasses.CellRenderer;
import flash.text.TextFormat;
public class MyCellRenderer_0 extends CellRenderer
{
public var customProperty:String = "foo";
public function MyCellRenderer_0 ()
{
var mydisTextFormat:TextFormat = new TextFormat ();
mydisTextFormat.align = "left";
mydisTextFormat.font = "Arial";
mydisTextFormat.size = 12;
mydisTextFormat.color = 0x000000;
var myTextFormat:TextFormat = new TextFormat ();
myTextFormat.align = "left";
myTextFormat.font = "Arial";
myTextFormat.size = 12;
myTextFormat.color = 0x000000;
var originalStyles:Object = CellRenderer.getStyleDefinition();
setStyle ("disabledSkin",BlueBackground);
setStyle ("upSkin",BlueBackground);
setStyle ("downSkin",GreenBackground);
setStyle ("overSkin",OrangeBackground);
setStyle ("selectedUpSkin",originalStyles.selectedUpSkin);
setStyle ("selectedDownSkin",originalStyles.selectedDownSkin);
setStyle ("selectedOverSkin",originalStyles.selectedOverSkin);
setStyle ("disabledTextFormat",mydisTextFormat);
setStyle ("textFormat",myTextFormat);
setStyle ("textPadding",10);
}
}
}
In the fla file add this:
myDG.setStyle ("cellRenderer", MyCellRenderer_0);
Then create a folder "Cellrenderer" and Movieclips with the name:
BlueBackground, GreenBackground, OrangeBackground
and make little squares with the colors you want.
- The right of the People to create Flash movies shall not be infringed. -
-
nice one cancerinform, thanx for sharing
-
thank you so much
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|