Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Flash Intro then auto load HTML Home Page

New Here ,
Apr 12, 2010 Apr 12, 2010

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

TOPICS
Server side applications

Views

5.3K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 12, 2010 Apr 12, 2010

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 12, 2010 Apr 12, 2010

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 14, 2010 Apr 14, 2010

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 14, 2010 Apr 14, 2010

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 14, 2010 Apr 14, 2010

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 14, 2010 Apr 14, 2010

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?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 15, 2010 Apr 15, 2010

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines