-
using below code
Error is :1180: Call to a possibly undefined method FStyleFormat.
PHP Code:
private function customizeRooms()
{
trace("called");
// create a new format object
var myStyleFormat:Object = new FStyleFormat();
// set your style preferences
myStyleFormat.shadow = 0x0000ff;
myStyleFormat.background = 0x000020;
myStyleFormat.selection = 0x0000cc;
myStyleFormat.scrollTrack = 0x000044;
myStyleFormat.face = 0x000066;
myStyleFormat.arrow = 0xffff00;
myStyleFormat.textColor = 0xffffff;
myStyleFormat.textFont = "Eurostile";
myStyleFormat.textSize = 16;
myStyleFormat.textLeftMargin = 3;
// apply the style to the listbox
myStyleFormat.addListener(mainRef.roomList_lb);
myStyleFormat.applyChanges();
}
-
Well, what is FStyleFormat? If it's a class you're using from another package you will have to import it before you can use it.
-
oh hmm. I thought something built in.
Can you tell me how to customize the listbox like changing background. Nothing working for me right now. any example..
Thanks
-
Nope. Neither ListBox nor FStyleFormat is in the asdocs that I have bookmarked. http://help.adobe.com/en_US/AS3LCR/Flash_10.0/
If they are part of a 3rd party package, you should look at the documentation they provide. If they're part of some adobe thing I don't know about, please post a link to it.
-
oh I am sorry about all this confusion. FStyleFormat was something built in for MX. I got the code and material while googling. I post the working example of listbox. Trying to find it.
You can see the thread here
http://www.actionscript.org/forums/s...d.php3?t=24777
Actually I want to customize list component. Like changing background, row color etc.
Any help or I am asking wrong?
Thanks
-
I still don't know what ListBox is, but if it's a UIComponent then setStyle seems like the right method, but you'll have to find the right properties to set for that component.
-
I am talking about this
http://help.adobe.com/en_US/ActionSc...5b32-7f41.html
I used code below but its not working at all.
mainRef.roomList_lb.setStyle("backgroundColor", 0xE3FFD6);
mainRef.roomList_lb.setStyle("alternatingRowColors ", 0xE3FFD6);
mainRef.roomList_lb.setStyle("borderStyle", "none");
thanks
-
http://help.adobe.com/en_US/AS3LCR/F...l#styleSummary
I believe you need to mess with the skin properties or the cell renderer. But I'm unfamiliar with this whole thing.
-
What do you use when you have to display data in rows? . Like grid or list where you need to style the rows.
I am stuck and dont know how to customize the look of a Grid/List.
Any suggestion to look into?
thanks
-
I haven't had to.
But if i did, I'd probably start by looking at DataGrid.
-
DataGrid looks very good and I am going to explore it more.
Thanks
-
Senior Member
customized datagrid skins once or twice and it's always an ugly process.
This is the pattern I use to do alternating colors by row. You need to know that CellRenderer_upSkinA, etc. are actually Library objects in Library/Component Assets/CellRendererSkins ...basically they all start off as a copy of CellRenderer_upSkin or CellRenderer_downSkin, and you customize them as necessary.
To use this code, you have to say
myDatagrid.setStyle("cellRenderer",AlternatingRend erer);
and make sure you've got items in your library, exported for actionscript, that correspond to the names of all those skins.
Code:
package {
import fl.controls.listClasses.CellRenderer;
import fl.controls.listClasses.ICellRenderer;
public final class AlternatingRenderer extends CellRenderer implements ICellRenderer {
public function AlternatingRenderer():void {
super();
}
public static function getStyleDefinition():Object {
return CellRenderer.getStyleDefinition();
}
override protected function drawBackground():void {
if (_listData.index % 2 == 0) {
setStyle("upSkin",CellRenderer_upSkinA);
setStyle("overSkin",CellRenderer_upSkinAOver);
setStyle("downSkin",CellRenderer_upSkinAOver);
} else {
setStyle("upSkin",CellRenderer_upSkinB);
setStyle("overSkin",CellRenderer_upSkinBOver);
setStyle("downSkin",CellRenderer_upSkinBOver);
}
//ed: ignore these two lines, they don't go together:
//setStyle("embedFonts",true);
//setStyle("textFormat",new TextFormat("Arial",10));
super.drawBackground();
}
}
}
-
thanks for the reply. Have you managed to align datagrid columns to center?. if yes than How?
Thanks
-
Senior Member
If you look at those two lines in my code I commented out, basically that's how you get each cell in the datagrid to set its textformat. So if you make it a textformat where align="centered" then, at least in theory, they should be centered. I've never actually tried that, but I don't see why it wouldn't work.
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
|