Java Reference
In-Depth Information
Figure 8-3. Simple linear
Note how only one end of the rectangle changes. This is because only one of the two Stops is being
changed by the animation. Listing 8-5 shows how this is implemented.
Listing 8-5. simpleLinear
function simpleLinear():Void{
delete group.content;
var red = 0.0;
var rect = Rectangle{
translateX: 640/2-350/2;
translateY: 480/2-50
width: 350
height: 50
fill: bind createLinearGradient([
Stop{color:Color.BLUE, offset:0.0},
createStop(createColor(red, 0, 0, 1.0), 1.0)
]);
}
insert rect into group.content;
Search WWH ::




Custom Search