Skip to main content
Known Participant
January 10, 2016
Answered

Does anyone know about the navigateToTime command in the cpAPIInterface?

  • January 10, 2016
  • 1 reply
  • 399 views

I am attempting to seek to a particular time in my captivate project -- basically, I'm using the navigatetoTime command to be able to go to a particular slide.  This works up to a point but, from what I can tell there's a limit -- I'm thinking 100 seconds into the project -- on where the navigateToTime command works.  There is a canNavigateToTime boolean value in the API which is producing a 'false' result at 156000 milliseconds (156 seconds) into the project. Does anyone know why that is, and is there some workaround.  Otherwise, the command is useless for any project over 2.5 minutes long -- no??

Thanks in advance.

-Marc Lee

marc@mlmiultimedia.com

This topic has been closed for replies.
Correct answer TLCMediaDesign

It seems to me you are doing conversions that you don't need; frameNumber to millisecoinds and then the navigateToTime function converts back to frameNumber.

You could just use cpCmndGotoFrameAndResume or cpCmndGotoFrame.or even cp.movie.jumpToFrame()


window.cpAPIInterface.setVariableValue("cpCmndGotoFrameAndResume",270);

or

window.cpCmndGotoFrameAndResume = 270;

1 reply

TLCMediaDesign
Inspiring
January 11, 2016

In my test it always returns false but does navigate. This is the line that is always false where a = a calculated frame:

0 <= a && 1 > a && (a = 1);

1 will never be greater than the frame to jump to unless you are using zero milliseconds

Is there a particular reason you are using this function?

There is some code that is looking at the length of a variable when setting 1E3, which is the divisor when calculating the frame, 1000 in my case. This is converting milliseconds to seconds.

Perhaps there is a quiz you are trying to jump over?

M1rcL33Author
Known Participant
January 11, 2016

Thanks for responding, TLC  I'm building a custom interface/skin for a series of Captivate projects.  It's great to know f someone other than myself is using that API JS interface. 

In my testing I have found that the boolean canNavigateToTime returns false after about 100000 milliseconds. What I do is getCurrentFrame from the interface, multiply it by the frame rate (30) and do some other math adjustments and then navigate to that millisecond in the project in order to go to a certain slide in the project -- or even to replay the current slide.  This works fine except that when you give the navToTime command a millisec value of >100000 it doesn't work and when you test the boolean canNavToTime it returns false when giving it a value >100000.  So if you want to go to a slide that's greater than 100 seconds after the beginning of the project, you can't. At least I can't.

What I did to solve this is to create a 'dispatcher' slide in the Captivate file within the 100 second point in the project.  It's a hidden slide and only functions as a way to pop to any other slide using a short JS script as the only content of this slide.  You feed the JS some value and it goes to which ever slide you want.  It's just a feature we need in our project.  There are other navigational tools such as Next and Prev buttons, a custom menu and other things but we need this feature also. I was surprised by the limit of 100000ms and wondered if others had noticed it also, and what they did about it.

TLC, if you care to, please respond explaining how you are using the common JS interface API for Captivate and what tricks or features you have been able to exploit.

Thanks,

-Marc Lee

Lilybiri
Legend
January 11, 2016

Sorry to pop in, I'm only a newbie with JS but I would like an explanation (am doing everything you do with shared and advanced actions myself, no issues with such a limit in that case). I read this sentence and am puzzled:

'... It's a hidden slide'

AFAIK a slide that is hidden is not present in the published file. JS scripts are executed on runtime; how do you manage to have a JS script running on a slide that is not in the published file?