Hi All,
I have two buttons in a buttonbar, and in one button I have to make a
triangle in upward direction and in other a triangle in downward direction to
show up and down directions. I tried the following code but was not able to get
the triangle.
Here is what i did:
var a:Array = new Array();
var temp:Object = new Object();
temp["labelField"] = "First";
temp["iconField"] = TriangleDownSkin;
a.push(temp);
temp = new Object();
temp["labelField"] = "Second";
temp["iconField"] = TriangleUpSkin;
a.push(temp);
buttonBar.labelField = "labelField";
buttonBar.iconField = "iconField";
buttonBar.dataProvider = a;
and "TriangleUpSkin" class is implemented as below:
public class TriangleUpSkin extends ProgrammaticSkin
{
public function TriangleUpSkin()
{
super();
}
override protected function updateDisplayList(w:Number, h:Number):void{
var g:Graphics = graphics;
g.moveTo(w / 2,h/4);
g.lineTo((3*w)/4, (3*h)/4);
g.lineTo(w / 4,(3*h)/4);
g.lineTo(w / 2,h/4 );
g.endFill();
}
}
i cannot embed any file, is there anyway i can create triangle?
____________________________________________________________________________________
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front