# \[AS2\] holder\_mc tween

**URL:** <https://forum.kirupa.com/t/as2-holder-mc-tween/254106>\
**Category:** Uncategorized\
**Created:** [March 8, 2008, 12:57am UTC](https://forum.kirupa.com/t/as2-holder-mc-tween/254106 "2008-03-08T00:57:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spiz85](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@Spiz85](https://forum.kirupa.com/u/Spiz85)\
**Post date:** [March 8, 2008, 12:57am UTC](https://forum.kirupa.com/t/as2-holder-mc-tween/254106/1 "2008-03-08T00:57:38Z")

</div>

Hey folks…  
having a bit of trouble sorting this one out…  
I’m just doing a little test.

Bascially, there’s a holder\_mc in the “main.swf”, which is there to load the 2 external swf files…

2 buttons…

when I click the ‘about’ button, it loads the ‘one.swf’ in the holder\_mc with an “\_alpha 0 to 100”.

when I click the 'news button, it load the ‘two.swf’ in the holder\_mc with an “\_alpha 0 to 100”…

now…  
what I’m wanting it to do is…

if the one.swf is loaded in the holder\_mc, and I click on the ‘news’ button, I want the one.swf to go from alpha 100 to 0, and then it would load the two.swf alpha 0 to 100, and vise versa.

does that make sense?

here’s the code I got at the moment…, It seems to be skipping the if statement and going directly to the loadMovie… what do i need to do so it goes through the IF statement first before entering the loadMovie.

```auto
[COLOR=#000000][COLOR=#0000bb][FONT=Courier New]stop[/FONT][/COLOR][FONT=Courier New][COLOR=#007700](); [/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000bb]import mx[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]transitions[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Tween[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; [/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000bb]import mx[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]transitions[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]easing[/COLOR][/FONT][FONT=Courier New][COLOR=#007700].*; [/COLOR][/FONT]
 
 
[FONT=Courier New][COLOR=#0000bb]loadMovie[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"one.swf"[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]holder_mc[/COLOR][/FONT][COLOR=#007700][FONT=Courier New]); [/FONT][/COLOR]
 
 
[FONT=Courier New][COLOR=#007700]var [/COLOR][COLOR=#0000bb]varName[/COLOR][COLOR=#007700]:[/COLOR][COLOR=#0000bb]Boolean [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]true[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; [/COLOR][/FONT]
 
 
[FONT=Courier New][COLOR=#0000bb]about_btn[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]onRelease [/COLOR][/FONT][FONT=Courier New][COLOR=#007700]= function(){ [/COLOR][/FONT]
[FONT=Courier New][COLOR=#007700] if([/COLOR][COLOR=#0000bb]varName [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000bb]true[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]){ [/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000bb]Tween3 [/COLOR][COLOR=#007700]= new [/COLOR][COLOR=#0000bb]Tween[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]holder_mc[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"_alpha"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]Strong[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]easeOut[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]100[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb].5[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]true[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]); [/COLOR][/FONT]
[FONT=Courier New][COLOR=#007700]} [/COLOR][/FONT]
 
[FONT=Courier New][COLOR=#0000bb]loadMovie[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"one.swf"[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]holder_mc[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]); [/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000bb]Tween1 [/COLOR][COLOR=#007700]= new [/COLOR][COLOR=#0000bb]Tween [/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]holder_mc[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"_alpha"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]Strong[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]easeIn[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]100[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb].5[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]true[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]); [/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000bb]varName [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]true[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; [/COLOR][/FONT]
[FONT=Courier New][COLOR=#007700]} [/COLOR][/FONT]
 
[FONT=Courier New][COLOR=#0000bb]news_btn[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]onRelease [/COLOR][/FONT][FONT=Courier New][COLOR=#007700]= function(){ [/COLOR][/FONT]
[FONT=Courier New][COLOR=#007700] if([/COLOR][COLOR=#0000bb]varName [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000bb]true[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]){ [/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000bb]Tween3 [/COLOR][COLOR=#007700]= new [/COLOR][COLOR=#0000bb]Tween[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]holder_mc[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"_alpha"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]Strong[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]easeOut[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]100[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb].5[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]true[/COLOR][/FONT][COLOR=#007700][FONT=Courier New]); [/FONT][/COLOR]
[FONT=Courier New][COLOR=#007700]} [/COLOR][/FONT]
[FONT=Courier New][COLOR=#ff8000] loadMovie("two.swf",holder_mc);
  Tween1 = new Tween (holder_mc, "_alpha", Strong.easeIn, 0, 100, .5, true);
     varName = true;
} [COLOR=#000000]
[/COLOR][/COLOR][/FONT][/COLOR][COLOR=#000000][FONT=Courier New][COLOR=#007700][/COLOR][/FONT][/COLOR] 
 

```

Hope someone can help… I’m eager to find this one out.
