Copy link to clipboard
Copied
I have an HTML5 project that links out to another URL page on about 5 slides. Jim was kind eough to inform me that there is a known issue about Captivate linking to URLs that are not hand typed. All of the URLs are hand typed, and all advanced actions are set up so that on the last click fo the button, the slide should advance to the next one, and the URL should open in a new tab (in that order) . This happens perfectly on the first set, but the second set doesn't advance the slide, it just opens the new window. If you return to the captivate window and click the next button it respawns the new window, never going to the next slide. I've cleared the project on my webserver, forced slides to be-recreated, rebuilt the advanced action, all with no effect. Anybody else running into anything simiilar?
This is a bit of a show stopper for me since I don't want to just have to code a button - my hope was to make this run like a native iPad app, but if I can't take away the chrome because users have to have it to navigate it can't be done.
Add this to your existing JS code at the bottom:
forward();
open_win();
Copy link to clipboard
Copied
Try using a bit of Javascript to do the advancement instead doing the assignment throught the advanced actions panel.
So in your advanced action get rid of:
Assign cpCmndNextSlide = 1
and do an execute JavaScript action and use this bit of JavaScript:
cpCmndNextSlide = 1;
Publish for HTML5 and test on a real web server. I typically do testing on my local web server.
Hope that helps,
Jim Leichliter
Copy link to clipboard
Copied
Thanks Jim! Sorry for being a pain - my project is due at 11:59 and I wasn't thinking this would be an issue since the first one worked. whoops! I'm doing all of my testing on a live server - the CS major kindly gives everyone a small webspace for use during school, even if they aren't CS majors (which I'm not). For this javascript, can I combine it with my window.open function? or does it need to be separate?
Copy link to clipboard
Copied
Try including it. It does not need to be separate.
Copy link to clipboard
Copied
ok - since my brain is scrambled from working with jQuery and I'm not really any better at javascript, here's what I have in the script window :
function open_win()
{
window.open("http://cs.franklin.edu/~heinem01/quizpages/wings.html")
}
function forward()
{
cp.SetVariable("cpCmndNextSlide","1");
}
did I wrongly assume it doesn't need script tags or anything?
Copy link to clipboard
Copied
When you publish for HTML5, you have a whole new JavaScript API available to you and the captivate movie control variables are actually global JS variables. So it would be something like this:
function forward() {
cpCmndNextSlide = 1;
}
Copy link to clipboard
Copied
well, I changed it to -
function open_win()
{
window.open("http://cs.franklin.edu/~heinem01/quizpages/wings.html")
}
function forward() {
cpCmndNextSlide = 1;
}
the first part worked (it opened the new window) but it didn't forward the slide.
Copy link to clipboard
Copied
Try navigating to the next slide first, then open the new window...
Copy link to clipboard
Copied
ok, switched them around and realized two things, one , I was looking at the slide previously where the advanced action is functioning properly, and two, that means that the window.open command is not working either. So the advanced action on the previous slide with the go to next slide/page URL on the last step is working. It then transitions to this slide, the advanced action shows/hides the three text boxes on click, but once the last click is reached with the javascript command on it, nothing.
Copy link to clipboard
Copied
Try viewing in Chrome with the console open (CTL + SHIFT + J). Are you getting any errors? Always debug and troubleshoot with the console in Chrome, or with Firebug in FireFox. It will tell you exactly what's going on... and you can even step through the JS code to see the order of operations.
Copy link to clipboard
Copied
Thanks Jim! I've been doing all of my testing in Safari since I'm on an iMac and on my iPad 3. Luckily I do have Chrome and Firefox on the mac - I just learned about firebug this weekend but haven't had a chance to get it installed/figure out how it works.
I'm not getting any errors in the Chrome console as I step through the project. The first advanced action is working again, but the second is still not if anything being activated it appears. But the text boxes are showing as designed. IF it would help, the most current version of the project is here:
Copy link to clipboard
Copied
What does the JS look like in your advanced action? (need screenshot).
Copy link to clipboard
Copied
sure thing!
Copy link to clipboard
Copied
Looks like you've defined the functions, but have not called them.
//call functions
forward();
open_win();
Copy link to clipboard
Copied
are they called in the javascript first, or somewhere ele on the slide? one of those times I wish I wasn't such a noob.:)
Copy link to clipboard
Copied
Add this to your existing JS code at the bottom:
forward();
open_win();
Copy link to clipboard
Copied
Jim, you've made my week! Thank you so much!! It works like a champ now! so I've got two hours to hopefully figure out how to get a message box to appear in a jQuery window and test to see if this bad boy will work without chrome on the iPad now.
Copy link to clipboard
Copied
Glad to hear it Rhybeka! I wish you success on your project!
Copy link to clipboard
Copied
Looks like I spoke too soon - it works fantastic on the iMac - still looping on the iPad. I wonder what the difference is besides Safari?
Copy link to clipboard
Copied
just in case!