# Fade out page into another page

**URL:** https://forum.kirupa.com/t/fade-out-page-into-another-page/259933
**Category:** Uncategorized
**Created:** [May 10, 2008, 12:37pm UTC](https://forum.kirupa.com/t/fade-out-page-into-another-page/259933 "2008-05-10T12:37:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![papalazarou78](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@papalazarou78](https://forum.kirupa.com/u/papalazarou78)
#### Post date: [May 10, 2008, 12:37pm UTC](https://forum.kirupa.com/t/fade-out-page-into-another-page/259933/1 "2008-05-10T12:37:46Z")

</div>

Hi

It’s been a while since I’ve been here…

I usually build flash site all within a main flash file and other loading into it, but I want to do my current site with 5 pages and 5 html pages. But I don’t want to just click on the menu and the new page replaces the current page, I want the current page to undo and fade first.

I can get my head round telling it to go to an ‘out’ frame on a button press, but then at the end of the timeline I need another action for loading the relevant page, but how do I specify which page.

So if I have **home** , **about** , **services** , **portfolio** and **contact** as my sections. If I’m in **about** and click **services** , which then goes to a frame ‘out’ in **about** , how does it then know what to load??

Hope this make sense??

---

<div class="post-metadata">

### Author: ![pablo\_2006](https://avatars.discourse-cdn.com/v4/letter/p/c67d28/32.png) [@pablo\_2006](https://forum.kirupa.com/u/pablo_2006)
#### Post date: [May 10, 2008, 11:06pm UTC](https://forum.kirupa.com/t/fade-out-page-into-another-page/259933/2 "2008-05-10T23:06:50Z")

</div>

Sounds like you’re using timelines, so the easy way is to put a fade-in tween at the start of each page, with a stop in the middle, followed by a fade-out tween.

You’ll need to monitor frame progress, so flash can load in the new ‘page’ after the fade out has completed.

```auto

//You'll need to add your 5 buttons
menuButton1.onRelease = function() {
    loadPage("page1.swf");
};

//Load your 'pages' into a container mc
function loadPage(pageName) {
    portfolioContainer.gotoAndPlay("out");

    this.onEnterFrame = function() {
        if (portfolioContainer._currentframe == portfolioContainer._totalframes) {
            delete this.onEnterFrame;
            portfolioContainer.loadMovie(pageName);       
        }
    };
}

```

---

<div class="post-metadata">

### Author: ![papalazarou78](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@papalazarou78](https://forum.kirupa.com/u/papalazarou78)
#### Post date: [May 11, 2008, 7:56am UTC](https://forum.kirupa.com/t/fade-out-page-into-another-page/259933/3 "2008-05-11T07:56:16Z")

</div>

Thanks for your reply.

I was going to put each swf into a seperate html, but your way of loading into a container and keeping within 1 html would probably work better… I will give it a try.

Thanks

---

<div class="post-metadata">

### Author: ![pablo\_2006](https://avatars.discourse-cdn.com/v4/letter/p/c67d28/32.png) [@pablo\_2006](https://forum.kirupa.com/u/pablo_2006)
#### Post date: [May 11, 2008, 8:43am UTC](https://forum.kirupa.com/t/fade-out-page-into-another-page/259933/4 "2008-05-11T08:43:15Z")

</div>

You can do the same with html, just pass in the page.htm name. If you want to ‘fade’ an entire html page, you’ll need javascript instead.

```auto

//You'll need to add your 5 buttons
menuButton1.onRelease = function() {
    loadPage("page1.htm");
};

//Play your movie 'out' and load html page when complete
function loadPage(pageName) {
    myPageMovie.gotoAndPlay("out");

    this.onEnterFrame = function() {
        if (myPageMovie._currentframe == myPageMovie._totalframes) {
            delete this.onEnterFrame;
            
            getURL(pageName , "_self ");
        }
    };
}

```
