I want to make a website and for the navigation when you click a button, I want the window that is open to fade out and than have the window open that you just clicked on fade in.
how would I do this?
(using flash cs4)
Printable View
I want to make a website and for the navigation when you click a button, I want the window that is open to fade out and than have the window open that you just clicked on fade in.
how would I do this?
(using flash cs4)
The most efficient way of doing this would be with Actionscript. First you want to download GreenSock's TweenLite class and get that set up in your AS folder: http://blog.greensock.com/tweenliteas3/
After you've gotten that, it's just a matter of keeping track of which 'window' is currently open (so you can 'close' it) and which one you want to open, and then trigger the alpha-out and alpha-in events when a nav option is clicked.
How familiar are you with Actionscript 3? I can help you along the way if you're not very adept.
Okay, well let's start simpler then and work our way up. We won't worry about any sort of tweening effects right now, instead you should just get your interface set up so windows disappear/appear.
Assuming your buttons instance names are btn01, btn02, and btn03; and your window instance names are window01, window02, and window03, the code below will add functionality to it all:
Apply this concept to your project, swapping instance names as needed. Post back once you've given this a try.PHP Code:
addEventListener(MouseEvent.CLICK,onClick,false,0,true);
function onClick(e:MouseEvent):void{
switch (e.target){
case btn01:
closeWindows();
window01.visible=true;
break;
case btn02:
closeWindows();
window02.visible=true;
break;
case btn03:
closeWindows();
window03.visible=true;
break;
default:
//do nothing
return;
}
}
function closeWindows():void{
window01.visible=window02.visible=window03.visible=false;
}
Will do!
EDIT: nevermind, I got it working, it just doesn't work if it gets a error xD... how shall i proceed
Uhh.. I can't get it working, could you give me abit of a step-by-step guide?
I got it working like i said, what do i do next jasondefra?
Now you want to go and download TweenLite here: http://tr.im/qGV2
Add it to your Actionscript library (if you don't know how to do that, you can view a tut about it here: http://bit.ly/dtlYP).
Once you have your class set up, you want to add this line to the top of your script:
Now, since you want to fade in/fade out the windows, we're going to ditch the visible property on the windows and just deal with alpha. Let's change the code a bit:PHP Code:import com.gs.TweenLite;
This should give you a good start. I tested this code and it worked, though it'll certainly need some addition conditions in the case that your user click-spams the buttons.PHP Code://first we're making sure none of your content windows are
//being displayed when the movie launches
window01.alpha=window02.alpha=window03.alpha=window04.alpha=0;
//this doesn't change: just listening for mouse clicks
addEventListener(MouseEvent.CLICK,onClick,false,0,true);
//this changes a bit. Rather than dealing with the visible
//property of the windows, we'll be tweening alpha properties
function onClick(e:MouseEvent):void{
switch(e.target){
case btn01:
closeWindows();
TweenLite.to(window01,1,{alpha:1,overwrite:false});//this is a call to
//the TweenLite class you set up earlier: The first parameter is the
//display object you're targeting (window0x), the second param is
//length of time the tween will take to complete in whole seconds
//(1 second), then all properties for the display object are listed in
//the third param within {}, in this case we're changing the alpha
//from 0 to 1 and we don't want this tween call to interrupt/overwrite
//any previous tween calls
break;
case btn02:
closeWindows();
TweenLite.to(window02,1,{alpha:1,overwrite:false});
break;
case btn03:
closeWindows();
TweenLite.to(window03,1,{alpha:1,overwrite:false});
break;
case btn04:
closeWindows();
TweenLite.to(window04,1,{alpha:1,overwrite:false});
break;
default:
return;
}
}
function closeWindows():void{
//for each of these ifs we're looking for the object that is currently
//being displayed (we know this because it's alpha will be equal to 1)
//and then tweening its alpha property down to 0 over 1 second
if(window01.alpha==1) TweenLite.to(window01,1,{alpha:0});
else if(window02.alpha==1) TweenLite.to(window02,1,{alpha:0});
else if(window03.alpha==1) TweenLite.to(window03,1,{alpha:0});
else if(window04.alpha==1) TweenLite.to(window04,1,{alpha:0});
}
Start with this, get the fading in and fading out working, then we can work out the kinks together.
And one more thing, this is all pretty sloppy code; once you get more experience with Actionscript, you will find there are much more efficient ways of handling multiple movieclips and their events, but for now I'm trying to keep this simple. Cheers!
~Jason
EDIT: My comments are way too lengthy
Thank you very much!!
The buttons that open these windows I would like to have a mouse over animation and a mouse out animation, (alpha from 75% to 100%) could you give me a hand with that code?
Well, to do this, you're first going to want the alpha of your buttons set to 75% similar to how we did the windows, but instead of "=0" you're going to do "=.75".
After that, you need to add a MOUSE_OVER and MOUSE_OUT Event Listener to each of the buttons. Then you just have each respective function Tween the alpha to and from 75% much like how we did the windows.PHP Code:btn01.alpha=.75;
And that should just about cover it. Like I said, there are definitely better ways to do this, but the way mentioned above is probably the most straight-forward for AS3 novices.PHP Code:btn01.addEventListener(MouseEvent.MOUSE_OVER,onBtnOver,false,0,true);
btn01.addEventListener(MouseEvent.MOUSE_OUT,onBtnOut,false,0,true);
function onBtnOver(e:MouseEvent):void{
//put the TweenLite code here to go to alpha:1—
//read the comments in my previous post for an
//explanation of the different parameters
}
funciton onBtnOut(e:MouseEvent):void{
//put the TweenLite code here to go to alpha:.75
}
~Jason
I tried to get the button mouseover/mouseout to work and I got this...
1071: Syntax error: expected a definition keyword (such as function) after attribute funciton, not onBtnOut.
nevermind... funciton onBtnOut(e:MouseEvent):void{
function was mis-spelled.
Okay, i'm just trying to get it work with two MCs at the moment.
Here's my code
I get this error.Code:import gs.TweenLite;
btn01.alpha=.50;
btn02.alpha=.50;
btn01.addEventListener(MouseEvent.MOUSE_OVER,onBtnOver,false,0,true);
btn01.addEventListener(MouseEvent.MOUSE_OUT,onBtnOut,false,0,true);
function onBtnOver(e:MouseEvent):void{
TweenLite.to(btn01, 0.9, {alpha:1});
}
function onBtnOut(e:MouseEvent):void{
TweenLite.to(btn01, 0.9, {alpha:0.5});
}
btn02.addEventListener(MouseEvent.MOUSE_OVER,onBtnOver,false,0,true);
btn02.addEventListener(MouseEvent.MOUSE_OUT,onBtnOut,false,0,true);
function onBtnOver(e:MouseEvent):void{
TweenLite.to(btn02, 0.9, {alpha:1});
}
function onBtnOut(e:MouseEvent):void{
TweenLite.to(btn02, 0.9, {alpha:0.5});
}
1021: Duplicate function definition.
How do I go about fixing this?
That error is coming up because you have multiple function with the same name. You only need one "onBtnOver" and "onBtnOut" and just change the first parameter of the TweenLite call:
If "e.target" doesn't work, try using "e.currentTarget" I can never remember which of the two to use.PHP Code:function onBtnOver(e:MouseEvent):void{
TweenLite.to(e.target, 0.9, {alpha:1});
}
function onBtnOut(e:MouseEvent):void{
TweenLite.to(e.target, 0.9, {alpha:0.5});
}
e.target works! :)
I gotta say THANK YOU!!! I really appreciate all of your help -bows-
I'll be putting it all together tonight so hopefully I don't screw something up xD
The only current bug is that when you click on another button while one is still going, they both stay open. I then was curious and clicked the one of the buttons that was open and it closed the window.
Is there any sort of delay we can put it for when someone click a button or something, I dunno =p (I only have the home and products & services working cause I just wanted to start with the 2 and progress to the others)
http://frozen-gecko.net/quicky.htm
You can use a Boolean to control when an event is called. You will toggle the variable on and off depending on whether a window is tweening or not, then you just have to make sure that the call for window tweening is only called when the Boolean is toggled to a certain value. So, something like:
That will toggle the isWindowTweening to true (and will thus prevent the SWITCH statement from getting spammed), so the last thing we want to do is toggle the Boolean back to its normal state after the Tweening is done. So change the TweenLite call in your CASE statements to include an extra parameter to call a function on tween completion.PHP Code:var isWindowTweening:Boolean=false;
onClick(e:MouseEvent):void{
if(!isWindowTweening){//check if isWindowTweening is false
isWindowTweening=true;//first, we want to set the boolean to true so we can't spam-click
switch(e.target){
//all the cases are here
}
}
}
PHP Code:TweenLite.to(window02,1,{alpha:1,overwrite:false,onComplete:resetBool});
The last part should re-enable the clickability of your buttons.PHP Code:function resetBool():void{
isWindowTweening=false;
}
I tried to apply the code but i'm getting lots of 1084 errors. Heres my original code:
Could you add the boolean? I tried for a really long time, but could not get it to work.Code:import gs.TweenLite;
//first we're making sure none of your content windows are
//being displayed when the movie launches
window02.alpha=window03.alpha=window04.alpha=window05.alpha=0;
//this doesn't change: just listening for mouse clicks
addEventListener(MouseEvent.CLICK,onClick,false,0,true);
//this changes a bit. Rather than dealing with the visible
//property of the windows, we'll be tweening alpha properties
function onClick(e:MouseEvent):void{
switch(e.target){
case btn02:
closeWindows();
TweenLite.to(window02,1,{alpha:1,overwrite:false});//this is a call to
//the TweenLite class you set up earlier: The first parameter is the
//display object you're targeting (window0x), the second param is
//length of time the tween will take to complete in whole seconds
//(1 second), then all properties for the display object are listed in
//the third param within {}, in this case we're changing the alpha
//from 0 to 1 and we don't want this tween call to interrupt/overwrite
//any previous tween calls
break;
case btn03:
closeWindows();
TweenLite.to(window03,1,{alpha:1,overwrite:false});
break;
case btn04:
closeWindows();
TweenLite.to(window04,1,{alpha:1,overwrite:false});
break;
case btn05:
closeWindows();
TweenLite.to(window05,1,{alpha:1,overwrite:false});
break;
default:
return;
}
}
function closeWindows():void{
//for each of these ifs we're looking for the object that is currently
//being displayed (we know this because it's alpha will be equal to 1)
//and then tweening its alpha property down to 0 over 1 second
if(window02.alpha==1) TweenLite.to(window02,1,{alpha:0});
else if(window03.alpha==1) TweenLite.to(window03,1,{alpha:0});
else if(window04.alpha==1) TweenLite.to(window04,1,{alpha:0});
else if(window05.alpha==1) TweenLite.to(window05,1,{alpha:0});
}
//BTN STUFF!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
btn01.alpha=.60;
btn02.alpha=.60;
btn03.alpha=.60;
btn04.alpha=.60;
btn05.alpha=.60;
btn06.alpha=.60;
btn01.addEventListener(MouseEvent.MOUSE_OVER,onBtnOver,false,0,true);
btn01.addEventListener(MouseEvent.MOUSE_OUT,onBtnOut,false,0,true);
btn02.addEventListener(MouseEvent.MOUSE_OVER,onBtnOver,false,0,true);
btn02.addEventListener(MouseEvent.MOUSE_OUT,onBtnOut,false,0,true);
btn03.addEventListener(MouseEvent.MOUSE_OVER,onBtnOver,false,0,true);
btn03.addEventListener(MouseEvent.MOUSE_OUT,onBtnOut,false,0,true);
btn04.addEventListener(MouseEvent.MOUSE_OVER,onBtnOver,false,0,true);
btn04.addEventListener(MouseEvent.MOUSE_OUT,onBtnOut,false,0,true);
btn05.addEventListener(MouseEvent.MOUSE_OVER,onBtnOver,false,0,true);
btn05.addEventListener(MouseEvent.MOUSE_OUT,onBtnOut,false,0,true);
btn06.addEventListener(MouseEvent.MOUSE_OVER,onBtnOver,false,0,true);
btn06.addEventListener(MouseEvent.MOUSE_OUT,onBtnOut,false,0,true);
function onBtnOver(e:MouseEvent):void{
TweenLite.to(e.target, 0.8, {alpha:1});
}
function onBtnOut(e:MouseEvent):void{
TweenLite.to(e.target, 0.8, {alpha:0.6});
}
BUMP.
Help? :( I would really like to get this project done ^^
PHP Code:var isTweening:Boolean=false;
function resetBool():void {
isTweening=false;
}
function onClick(e:MouseEvent):void {
if (!isTweening) {
isTweening=true;
switch (e.target) {
case btn02 :
closeWindows();
TweenLite.to(window02,1,{alpha:1,overwrite:false,onComplete:resetBool});//this is a call to
//the TweenLite class you set up earlier: The first parameter is the
//display object you're targeting (window0x), the second param is
//length of time the tween will take to complete in whole seconds
//(1 second), then all properties for the display object are listed in
//the third param within {}, in this case we're changing the alpha
//from 0 to 1 and we don't want this tween call to interrupt/overwrite
//any previous tween calls
break;
case btn03 :
closeWindows();
TweenLite.to(window03,1,{alpha:1,overwrite:false,onComplete:resetBool});
break;
case btn04 :
closeWindows();
TweenLite.to(window04,1,{alpha:1,overwrite:false,onComplete:resetBool});
break;
case btn05 :
closeWindows();
TweenLite.to(window05,1,{alpha:1,overwrite:false,onComplete:resetBool});
break;
default :
return;
}
}
}
I have another question, got would I make a close button for whichever window is open.
I also want to make a small flash gallery, I want to change the code from opacity to scale with a close button, what changes would I make?
I also have another button inside one of the windows and i am getting 1120 errors.
ps. the button inside the windows has to close the window ones you click it, its part of the navigation like the rest of the windows, but you click products then this button is on the products window
does what I said make sense =p?
can anyone help me? I need to get this done soon.
Okay, Ignore the scale idea.
I just need to fixed the problem with my button that is in one of the windows that loads.
Please help asap!! :X
Hey FrozenGecko- you may want to check out greensock's work. The designer has an amazing set of tweening & timeline engines that make it very simple to do the transparency stuff. For the tween & timeline check out http://blog.greensock.com/v11beta/ for just the tween engine check out http://blog.greensock.com/tweenmaxas3/
They come with a couple of swf's that even write the code for you. If you need any help with it just google it the code is every where.
Heya Jasondefra!
Nice and simple code you have there. I was getting it working on a site of mine and though it seems simple I just can't get a response from the buttons. I've checked my instance names, nesting and such. I just can't see it. If you have any insight for me I would be eternally grateful. I had event listeners for a few buttons with ROLL_OVER, ROLL_OUT, CLICK, MOUSE_DOWN, MOUSE_UP and none of them respond. Cheers!
me code:
Man I hope I did that right...Its a bit long.Code:addEventListener(MouseEvent.CLICK, onCLICK,false,0,true);
addEventListener(MouseEvent.MOUSE_OVER, overBTN,false,0,true);
addEventListener(MouseEvent.MOUSE_OUT, outBTN,false,0,true);
addEventListener(MouseEvent.MOUSE_DOWN, downBTN,false,0,true);
addEventListener(MouseEvent.MOUSE_UP, upBTN,false,0,true);
var isTweening:Boolean=false;
function resetBool():void {
isTweening=false;
}
function onCLICK(e:MouseEvent):void {
if (!isTweening) {
isTweening=true;
switch (e.target) {
case homeOn_mc:
closeWindows();
TweenLite.to(homePage_mc,1,{alpha:1,overwrite:false, onComplete:resetBool});
break;
case whoWeAreOn_mc:
closeWindows();
TweenLite.to(whoWeArePage_mc,1,{alpha:1,overwrite:false, onComplete:resetBool});
break;
case makeAnAppointmentOn_mc:
closeWindows();
TweenLite.to(makeAnAppointmentPage_mc,1,{alpha:1,overwrite:false, onComplete:resetBool});
break;
case capabilitiesOn_mc:
// No onclick
break;
case newsOn_mc:
closeWindows();
TweenLite.to(newsPage_mc,1,{alpha:1,overwrite:false, onComplete:resetBool});
break;
default:
//do nothing
return;
} }
}
function overBTN(e:MouseEvent):void {
//if (!isTweening) {
//isTweening=true;
switch (e.target) {
case homeOn_mc:
var homeOverTimeline:TimelineMax = new TimelineMax();
homeOverTimeline.insertMultiple( [ TweenMax.to(homeOn_mc, 0, {tint:0xff9900, onComplete:resetBool}), TweenMax.to(homeOn_mc, 0, {blurFilter:{blurX:3, blurY:3, quality:1}, onComplete:resetBool})], homeOverTimeline.duration );
homeOverTimeline.play();
break;
case whoWeAreOn_mc:
var whoWeAreOverTimeline:TimelineMax = new TimelineMax();
whoWeAreOverTimeline.insertMultiple( [ TweenLite.to(whoWeAreOn_mc, 0, {tint:0xff9900}), TweenMax.to(whoWeAreOn_mc, 0, {blurFilter:{blurX:3, blurY:3, quality:1}, onComplete:resetBool})], whoWeAreOverTimeline.duration);
whoWeAreOverTimeline.play();
break;
case makeAnAppointmentOn_mc:
var makeAnAppointmenOverTimeline:TimelineMax = new TimelineMax();
makeAnAppointmenOverTimeline.insertMultiple( [ TweenLite.to(makeAnAppointmentOn_mc, 0, {tint:0xff9900}), TweenMax.to(makeAnAppointmentOn_mc, 0, {blurFilter:{blurX:3, blurY:3, quality:1}, onComplete:resetBool}) ], makeAnAppointmenOverTimeline.duration);
makeAnAppointmenOverTimeline.play();
break;
case capabilitiesOn_mc:
var capabilitiesOverTimeline:TimelineMax = new TimelineMax();
capabilitiesOverTimeline.append( TweenMax.to(capabilitiesOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) );
capabilitiesOverTimeline.append( TweenLite.to(capabilitiesMenu_mc, 0, { autoAlpha:1, onComplete:resetBool}) );
capabilitiesOverTimeline.play();
break;
case capabilitiesMenu_mc:
var capabilitiesMenuOverTimeline:TimelineMax = new TimelineMax();
capabilitiesMenuOverTimeline.append( TweenMax.to(capabilitiesOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}}) );
capabilitiesMenuOverTimeline.append( TweenLite.to(capabilitiesMenu_mc, 0, { autoAlpha:1, onComplete:resetBool}) );
capabilitiesMenuOverTimeline.play();
break;
case newsOn_mc:
var newsOverTimeline:TimelineMax = new TimelineMax();
newsOverTimeline.insertMultiple( [ TweenLite.to(newsOn_mc, 0, {tint:0xff9900}), TweenMax.to(newsOn_mc, 0, {blurFilter:{blurX:3, blurY:3, quality:1}, onComplete:resetBool})], newsOverTimeline.duration);
newsOverTimeline.play();
break;
default:
//do nothing
return;
} //}
}
function outBTN(e:MouseEvent):void {
//if (!isTweening) {
// isTweening=true;
switch (e.target) {
case homeOn_mc:
var homeOutTimeline:TimelineMax = new TimelineMax();
homeOutTimeline.insertMultiple( [ TweenMax.to(homeOn_mc, 0, {blurFilter:{blurX:3, blurY:3, quality:1, remove:true}}), TweenLite.to(homeOn_mc, 0, {removeTint:true, onComplete:resetBool})], homeOutTimeline.duration);
homeOutTimeline.play();
break;
case whoWeAreOn_mc:
var whoWeAreOutTimeline:TimelineMax = new TimelineMax();
whoWeAreOutTimeline.insertMultiple( [ TweenLite.to(whoWeAreOn_mc, 0, {removeTint:true}), TweenMax.to(whoWeAreOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool})], whoWeAreOutTimeline.duration);
whoWeAreOutTimeline.play();
break;
case makeAnAppointmentOn_mc:
var makeAnAppointmentOutTimeline:TimelineMax = new TimelineMax();
makeAnAppointmentOutTimeline.insertMultiple( [ TweenLite.to(makeAnAppointmentOn_mc, 0, {removeTint:true}), TweenMax.to(makeAnAppointmentOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) ], makeAnAppointmentOutTimeline.duration);
makeAnAppointmentOutTimeline.play();
break;
case capabilitiesOn_mc:
var capabilitiesOutTimeline:TimelineMax = new TimelineMax();
capabilitiesOutTimeline.insertMultiple( [ TweenLite.to(capabilitiesOn_mc, 0, {removeTint:true}), TweenMax.to(capabilitiesOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) ], capabilitiesOutTimeline.duration );
capabilitiesOutTimeline.play();
break;
case newsOn_mc:
var newsOutTimeline:TimelineMax = new TimelineMax();
newsOutTimeline.insertMultiple( [ TweenLite.to(newsOn_mc, 0, {removeTint:true}), TweenMax.to(newsOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) ], newsOutTimeline.duration);
newsOutTimeline.play();
break;
default:
//do nothing
return;
} //}
}
function downBTN(e:MouseEvent):void {
//if (!isTweening) {
// isTweening=true;
switch (e.target) {
case homeOn_mc:
var homeDownTimeline:TimelineMax = new TimelineMax();
homeDownTimeline.append( TweenMax.to(homeOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1}, onComplete:resetBool}) );
homeDownTimeline.play();
break;
case whoWeAreOn_mc:
var Timeline:TimelineMax = new TimelineMax();
Timeline.append( TweenMax.to(whoWeAreOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1}, onComplete:resetBool}) );
Timeline.play();
break;
case makeAnAppointmentOn_mc:
var makeAnAppointmentDownTimeline:TimelineMax = new TimelineMax();
makeAnAppointmentDownTimeline.append( TweenMax.to(makeAnAppointmentOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1}, onComplete:resetBool}) );
makeAnAppointmentDownTimeline.play();
break;
case capabilitiesOn_mc:
// no Mouse_Down
break;
case newsOn_mc:
var newsDownTimeline:TimelineMax = new TimelineMax();
newsDownTimeline.append( TweenMax.to(newsOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1}, onComplete:resetBool}) );
newsDownTimeline.play();
break;
default:
//do nothing
return;
} //}
}
function upBTN(e:MouseEvent):void {
//if (!isTweening) {
// isTweening=true;
switch (e.target) {
case homeOn_mc:
var homeUpTimeline:TimelineMax = new TimelineMax();
homeUpTimeline.append( TweenMax.to(homeOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) );
homeUpTimeline.play();
break;
case whoWeAreOn_mc:
var whoWeAreUpTimeline:TimelineMax = new TimelineMax();
whoWeAreUpTimeline.append( TweenMax.to(whoWeAreOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) );
whoWeAreUpTimeline.play();
break;
case makeAnAppointmentOn_mc:
var makeAnAppointmentUpTimeline:TimelineMax = new TimelineMax();
makeAnAppointmentUpTimeline.append( TweenMax.to(makeAnAppointmentOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) );
makeAnAppointmentUpTimeline.play();
break;
case capabilitiesOn_mc:
// no Mouse_up
break;
case newsOn_mc:
var newsUpTimeline:TimelineMax = new TimelineMax();
newsUpTimeline.append( TweenMax.to(newsOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) );
newsUpTimeline.play();
break;
default:
//do nothing
return;
} //}
}
function closeWindows():void{
//for each of these ifs we're looking for the object that is currently
//being displayed (we know this because it's alpha will be equal to 1)
//and then tweening its alpha property down to 0 over 1 second
if(homePage_mc.alpha==1) { TweenLite.to(homePage_mc,1,{alpha:0}); }
else if(whoWeArePage_mc.alpha==1) { TweenLite.to(whoWeArePage_mc,1,{alpha:0}) }
else if(makeAnAppointmentPage_mc.alpha==1) { TweenLite.to(makeAnAppointmentPage_mc,1,{alpha:0}) }
else if(newsPage_mc.alpha==1) { TweenLite.to(newsPage_mc,1,{alpha:0}) }
}
The stuff thats //'ed out just cause I was desperately testing everything. I'm really new at this too so I hope that code is not too embarassing.