Skip to main content

JavaFX trigger bug?

1 reply [Last post]
casperlw
Offline
Joined: 2008-03-28
Points: 0

var timeAni = Timeline {
keyFrames: [
KeyFrame {
time: 0s
values: [
imageView.y =>240
]
},
KeyFrame {
time: 2000ms
values: [
imageView.y => 0 tween Interpolator.LINEAR
]
}
]
};

function slideAni(): Void {
timeAni.playFromStart();
var timelineRunning = bind timeAni.running on replace {
println("out here {slideShowTrue} and {timelineRunning}");
if((not timelineRunning) and slideShowTrue)
{
// imageView has binded with image
image=Image {url: fileList[fileIndex++]};
timeAni.playFromStart();
}
}
};

As code up, purpose is to show a looped animation, but unfortunately the loop will stopped after several animation, and from the print log, we have missed one timeAni.running stop when animation finished, any suggestion or it's JavaFX bug? Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jamesj
Offline
Joined: 2009-04-11
Points: 0

I just posted a piece of code that may have a similar cause. (See: 'on replace' stops working sometimes) It is a simple case, you may want to run it and see if it also happens in your environment.

Message was edited by: jamesj