# Help with creating an ending to a scene

**URL:** <https://forum.kirupa.com/t/help-with-creating-an-ending-to-a-scene/11415>\
**Category:** Uncategorized\
**Created:** [January 16, 2003, 9:12pm UTC](https://forum.kirupa.com/t/help-with-creating-an-ending-to-a-scene/11415 "2003-01-16T21:12:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![craschnburn](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@craschnburn](https://forum.kirupa.com/u/craschnburn)\
**Post date:** [January 16, 2003, 9:12pm UTC](https://forum.kirupa.com/t/help-with-creating-an-ending-to-a-scene/11415/1 "2003-01-16T21:12:28Z")

</div>

Hello Everyone: :crazy:

I need help from all you masters of the universe. It seems that there is nothing that you guys can’t answer.

I am trying to create an ending of a scene. For example, I have two links in my menu on my site. We’ll call them “link 1” and “link 2”. When I click on “link 1”, using loadmovienum I load a movie unto my site, which glides in from the left. Now when I click on “link 2”, I would like for the movie to glide away and gliding in would be “link 2” movie.

I hope that I’ve explained well enough. Please help. I greatly need you guys.

Thank you.

tom  
:trout:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 17, 2003, 12:53am UTC](https://forum.kirupa.com/t/help-with-creating-an-ending-to-a-scene/11415/2 "2003-01-17T00:53:37Z")

</div>

Umm… Well…

When you first click on the one link… Or if you click on the second link for that matter. You will need a variable to hold a true or false statement…

This variable will say… Is there a window open right now? Cause if there is… You will need to clsoe that window before opening another…

Then… You’ll wnat to make 2 functions… glideIn and glideOut… These two functions will be placed when you want the certain movie to either glide in or glide out.

The simple gliding statement can be covered by a for loop…

```auto

for(i=5;i<=300;i+=5)
{
     this._x -= i;
}

```

That should handle the glide in… Just change the 300 to however long you want the window to glide in to… As for the glideout… Just change this.\_x -= i; to this.\_x += i;.

Now… Here is what the function should look like:

```php

// This should be placed in the main timeline

MovieClip.prototype.glideIn = function()
{
     for(i=5;i<=300;i+=5)
     {
          this._x -= i;
     }
     windowOpen = true;
     currentWindowOpened = this;
}
MovieClip.prototype.glideOut = function()
{
     for(i=5;i<=300;i+=5)
     {
          this._x += i;
     }
     windowOpen = false;
}

// These lines of code should be placed
// whereever you put the button code at

if(windowOpen == true)
{
     currentWindowOpened.glideOut();
     _root.window1.glideIn();
} else {
     _root.window1.glideIn();
}

```

Anyways… This should work out pretty good for you…

Take Care and Good Luck

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 17, 2003, 11:49pm UTC](https://forum.kirupa.com/t/help-with-creating-an-ending-to-a-scene/11415/3 "2003-01-17T23:49:35Z")

</div>

:pirate: Hey Playa. Thanks for your response. I got the sliding of the windows in and out of the site down pretty well. But the thing that I’m kind of shady about is the outtro of a movie or movie when a new link is clicked.

I looked at a lot of different threads regarding this matter, but I need a little more clarification on it. If you can explain it to me a little more that’d be really cool.

For example:  
Shouldn’t there be an outtro for each external movie?

Please help. Cause you kow I’m still a PLAYA!!! Thanks bro.

Craschnburn
