Java Reference
In-Depth Information
arcWidth: 8
arcHeight: 8
fill: grayGradient
strokeWidth: 2
stroke: Color.web("#339afc");
}
insert track into group.content;
var playhead = Circle{
translateY: 4
translateX: bind calculateLocation(soundPlayer.currentTime,dragLocation);
radius: 8
fill: grayGradient
strokeWidth: 2
stroke: Color.web("#339afc");
}
insert playhead into group.content;
}
var mouseIsDragging:Boolean = false;
var dragLocation:Number;
function calculateLocation(currentTime:Duration,dragX:Number):Number{
var rawLocation:Number;
if (mouseIsDragging){
rawLocation = dragX;
} else{
rawLocation = currentTime/soundPlayer.songDuration*300;
}
if (rawLocation < 0){
return 0
} else if (rawLocation > 300){
return 300
} else {
return rawLocation
}
}
function buttonClicked():Void{
if (soundPlayer.isPlaying()){
soundPlayer.pause();
playButton.text = "Play";
} else {
soundPlayer.play();
playButton.text = "Pause";
}
}
function mouseReleased(event:MouseEvent):Void{
mouseIsDragging = false;
soundPlayer.setTime(event.x/300.0*soundPlayer.songDuration);
Search WWH ::




Custom Search