Advanced Examples to JavaFX |
|
|
* @author Amit
*/
var mediaplyr = MediaPlayer {
autoPlay: false
repeatCount: 3
media: bind Media {
source: “{__DIR__}/../resources/Intro.avi”
}
}
var image1= Image {
url: “{__DIR__}/../images/play.gif”
}
var image2= Image {
url: “{__DIR__}/../images/pause.gif”
}
var opaque:Number=1;
var transparent:Number=0.5;
var opactyPlay:Number = transparent;
var opactyPause:Number = transparent;
SwingFrame {
title: “Media Application”
width: 650
height: 550
resizable:false
closeAction: function() {
java.lang.System.exit( 0 );
}
visible: true
content : Canvas{
content :[MediaView {
mediaPlayer: mediaplyr
},ImageView {
image:image1
x:20
y:420
opacity: bind opactyPlay;
onMouseMoved: function( e: MouseEvent ):Void {
opactyPlay = opaque;
}
onMouseExited: function( e: MouseEvent ):Void {
opactyPlay = transparent;
}
onMouseClicked: function( e: MouseEvent ):Void {
mediaplyr.play();
}
},ImageView {
image: image2
x:520
y:420
opacity: bind opactyPause;
onMouseMoved: function( e: MouseEvent ):Void { |
|
Aug 2008 | Java Jazz Up | 46 |
|
|
|
Pages:
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63, Download PDF |
|
|
|