# \[FMX\] Know anything about alpha and inertia? (a way to do page transitions)

**URL:** <https://forum.kirupa.com/t/fmx-know-anything-about-alpha-and-inertia-a-way-to-do-page-transitions/7512>\
**Category:** flash\
**Created:** [November 1, 2002, 10:45pm UTC](https://forum.kirupa.com/t/fmx-know-anything-about-alpha-and-inertia-a-way-to-do-page-transitions/7512 "2002-11-01T22:45:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmb597](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jmb597](https://forum.kirupa.com/u/jmb597)\
**Post date:** [November 1, 2002, 10:45pm UTC](https://forum.kirupa.com/t/fmx-know-anything-about-alpha-and-inertia-a-way-to-do-page-transitions/7512/1 "2002-11-01T22:45:40Z")

</div>

Hi, I am creating a flash site and I wanted to have a cool transition between pages. I like this tutorial affect but need to change to it what I need as far as editing the actionscript. Take a look at this first and then please read what I need below:

[http://www.kirupa.com/developer/mx/alpha\_fade.asp](http://www.kirupa.com/developer/mx/alpha_fade.asp)

Does anyone know how to control how/what the images change to with buttons? (The image would change according to which button was pushed. ) Also, I would be working with 6 images that are 700 x 500. I just really love that affect, how the images start to fade out while another fades in at the same time. I want to use actionscript and understand it.

Dan, who made that tutorial, tried to help me a long time ago. However, I wasn’t able to get it to work right. My images were different sizes than his and I had 6 images instead of 5. I can’t write script that well. The script I have is:

/\*  
||== Title: Alpha Graphic Button Fade ==||  
||== Author: dan4885 (Dan Alu) ==||  
||== Site: [www.macromotive.com](http://www.macromotive.com) ==||  
||== Date: 8/12/02 ==============||  
\*/

//Creates a new movie clip on the ‘\_root’  
//timeline which is named ‘script\_clip’  
\_root.createEmptyMovieClip(“script\_clip”, 0);  
script\_clip.onLoad = function() {  
//Makes variable to store inertia.  
mosx = 0;  
//Makes variable to store inertia.  
mosy = 0;  
};  
//Starts a movie clip loop that executes  
//the code everytime the play head enters  
//a frame and this only works in Flash MX  
script\_clip.onEnterFrame = function() {  
//Subtracts the total of the button result and ‘mosx’ and 8 determines the speed of the effect.  
mosx += (\_root.remoteX - mosx) \* .3;  
//Subtracts the total of the button result and ‘mosy’ and 8 determines the speed of the effect.  
mosy += (\_root.remoteY - mosy) \* .3;  
//Used to control the \_alpha setting of ‘graphic1’ with dependency of the button result and inertia.  
\_root.graphic1.\_alpha = (mosx / 4) - (mosy / 4);  
//Used to control the \_alpha setting of ‘graphic2’ with dependency of the button result and inertia.  
\_root.graphic2.\_alpha = 100 - (mosx / 4) - (mosy / 4);  
//Used to control the \_alpha setting of ‘graphic3’ with dependency of the button result and inertia.  
\_root.graphic3.\_alpha = (mosy / 4) - 100 + (mosx / 4);  
//Used to control the \_alpha setting of ‘graphic4’ with dependency of the mouse position and inertia.  
\_root.graphic4.\_alpha = (mosy / 4) - (mosx / 4);  
};  
\_root.graphic5.\_alpha = (mosy / 4) - 100 + (mosx / 4);

button1.onPress = function() {  
remoteX = 0;  
remoteY = 0;  
}  
button2.onPress = function() {  
remoteX = 400;  
remoteY = 0;  
}  
button3.onPress = function() {  
remoteX = 400;  
remoteY = 400;  
}  
button4.onPress = function() {  
remoteX = 0;  
remoteY = 400;  
}  
button5.onPress = function() {  
remoteX = 200;  
remoteY = 200;  
}

Any help would be appreciated!! Thanks so much!

Jill:)
