Copy link to clipboard
Copied
I have created a Flash Intro that I have published as HTML and SWF. I
have placed this into my HTML file. I need to know how to call up my home page HTML after the SWF file ends. I can call up the page
or watch the movie but I can't get the page to call up after the movie is over. What do I need to do to (automatically load) call the HTML from the end of
the Flash movie?
Operating System:
Thank You.
Doug
Doug@countrymorningfarms.com
Copy link to clipboard
Copied
Hi
You would do this using actionscript by placing a loadPage action in the last frame of your swf/fla file.
PZ
Copy link to clipboard
Copied
When I use the code:
stop();
loadPage ("www.countrymorningfarms.com/cmfhome.html");
I get an error "call to a possibly undefined method"
I am using Flash CS4.
Any help you can give me would be appreciated. I would also like to know if I have to post this to a live web host to test properly or if I can test it locally.
Thanks,
Doug
Copy link to clipboard
Copied
Hi
Sorry for the delay in replying but I was away yesterday.
When I said loadPage this was a pseudo code function not a real actionscript function, try -
var url:String = "http://site";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, '_blank'); // second argument is target
} catch (e:Error) {
trace("Error occurred!");
}
Replace the stop() function with this, don't forget to replace the http://site with the address for the page you wish to load.
PZ
Copy link to clipboard
Copied
Thanks for the help. I really appreciate it. I will give that code a try. Question.
Will that code work if I am testing on a local server or will it need to be a live test site for the URL to work?
I don't currently have a live test site available.
Thanks Doug
Copy link to clipboard
Copied
Hi
You will have to point it to your local file for testing then change it again for the live version.
PZ
Update: or use site relative links.
Message was edited by: pziecina
Copy link to clipboard
Copied
PZ,
Thanks for the help. Here is the code that finally worked.
var url:String = "http://file:///C:/Website_Design/Test_Files/";
var request:URLRequest = new URLRequest("cmfHome.html");
try {
navigateToURL(request, '_parent'); // second argument is target
} catch (e:Error) {
trace("Error occurred!");
}
I have been trying to solve this problem for a week. Well done.
Doug
PS What is a site relative link?
Copy link to clipboard
Copied
Hi
It's also known as a document relative link, and is probably how your links to images, etc. are inserted into your files, as an example -
If your flash intro file is called index.html and the page you wish to go to after the flash intro is startpage.html place both these files in the same position in your file structure, so you would have -
Folder for images
Folder for scripts
index.html
startpage.html
Then the link in the actionscript would only nead to be - var url:String = "startpage.html";
PZ