playToLabel complete function


New member
I was wondering if there is the possibility to call the complete function also when the playToLabel is currently on the right position.

I registered some click events with the "playToLabel". When the "playToLabel" has finished I want to fadein a div.
This is however working, but not in all cases.

I got 4 buttons:
-button 1 plays to label "frame01" and fades in "highlight01"
-button 2 plays to label "frame02" and fades in "highlight02" ---> From 1 to 2 this works
-button 3 plays to label "frame01" and fades in "highlight02" ---> when I click this button after I clicked button 1 nothing happends, because playToLabel never completes
-button 4 plays to label "frame02" and fades in "highlight04"

This is a simplified version of what I'm using
api.images.playToLabel("frame01", 2, function(){

Any ideas how I can fix this?


Active member
I see, hmmm.. For now I suggest to call api.images.getCurrentImageIndex() before calling playToLabel and compare it with the "playTo" index you need which should be pretty simple?


Active member
Right.. :) I assumed you would know the index upfront but I saw your example in the email today and it's pretty involved (great job!) so I guess we will have to fix playToLabel as per your comment as knowing the indexes upfront is not feasible in your app exactly! Will follow up via email.