I have a project that requires a skip button and to go to a specified url in the same window once the animation is complete. The button works, however the navigatetourl in the last frame is not behaving.
Here is the code I've placed in the last frame:
//Start your custom code
// This example code displays the words "Entered frame" in the Output panel.
navigateToURL(new URLRequest("http://www.student.nvcc.edu/home/amlayne/ite170/dreamweaver/graded_ass ignments/index.html"), "_self");
// End your custom code
I've tried moving it to an earlier frame, placing a stop in the earlier frame, moving the stop command to after and so on. No matter what I do, the new url opens in a new window and is in a constant state of refresh. I also have the loop turned off but the animation begins to load the first frame again anyway. Please help. I've tried many fixed listed in forums that are all about the same with no different results. You can view my animation here: http://www.student.nvcc.edu/home/amlayne/ite170/flash/graded%20assignm ents/myintro.html
NOTE: You will have to close the browser to get the refresh to stop.
I've been working on this one issue two days and am at a complete loss.
the enterframe event is repeatedly dispatched multiple times per second (equal to your frame rate) and that's not what you want.
replace all your posted code with:
navigateToURL(new URLRequest("http://www.student.nvcc.edu/home/amlayne/ite170/dreamweaver/graded_*** ignments/index.html"), "_self");
Any thoughts on why my button now won't open in the same window? I'm getting a sense the built in code snippets don't work as they should, or I'm just making silly mistakes. Here's the code:
// Start your custom code
// This example code displays the words "Mouse clicked" in the Output panel.
navigateToURL(new URLRequest("http://www.student.nvcc.edu/home/amlayne/ite170/dreamweaver/graded_ass ignments/index.html"), "_self")
// End your custom code
there's no problem with that code.
you just need an object with reference btnSkip1 to exist at the time that code executes AND the same object needs to exist when you click it.
there are a few ways that can be screwed-up and only two to ensure it's done correctly:
1. create that object with actionscript and never null it.
2. create it in the ide when some frame plays, execute that code in the same frame and do not remove btnSkip1 thereafter.