Jump to content
Search Community

Instances not disappearing

Martagnan test
Moderator Tag

Recommended Posts

Hello,

I can't work this out. I'm hoping somebody with more understanding might see where i'm going wrong.

 

My problem is with mc_screen1, mc_screen2, mc_screen3, mc_screen4. These clips should replace each other over the time of the movie, but alpha:0 doesn't seem to be working and i'm left with 1 or more of the mc's still showing at the end!

 

Here is my full code so far...

 


package {

import flash.display.MovieClip;
import com.greensock.*;
import com.greensock.easing.*;
import flash.events.Event;


public class mhhq extends MovieClip {



//mc instances on stage
public var mc_phone1:MovieClip;
public var mc_screen1:MovieClip;
public var mc_defyTM:MovieClip;
public var mc_lifeproof:MovieClip;
public var mc_justgotbetter:MovieClip;
public var mc_screen2:MovieClip;
public var mc_faster:MovieClip;
public var mc_1ghz:MovieClip;
public var mc_smarter:MovieClip;
public var mc_smarterGlow:MovieClip;
public var mc_screen3:MovieClip;
public var mc_android:MovieClip;
public var mc_richer:MovieClip;
public var mc_screen4:MovieClip;
public var mc_movies:MovieClip;
public var mc_angledphone:MovieClip;
public var mc_opaquebox:MovieClip;
public var mc_defySecond:MovieClip;
public var mc_fasterSmarter:MovieClip;
public var mc_exclusive:MovieClip;
public var mc_lifeEmpowered:MovieClip;



public var timeline:TimelineLite;


public function mhhq() {
		addEventListener(Event.ADDED_TO_STAGE, init);
	}

private function init(e:Event):void{

		removeEventListener(Event.ADDED_TO_STAGE, init);

		timeline = new TimelineLite();


		timeline.insert( TweenLite.to( mc_lifeEmpowered, 0, {alpha:0} ));
		timeline.insert( TweenLite.to( mc_screen2, 0, {alpha:0} ));
		timeline.insert( TweenLite.to( mc_1ghz, 0, {alpha:0} ));
		timeline.insert( TweenLite.to( mc_smarterGlow, 0, {alpha:0} ));
		timeline.insert( TweenLite.to( mc_screen3, 0, {alpha:0} ));
		timeline.insert( TweenLite.to( mc_android, 0, {alpha:0} ));
		timeline.insert( TweenLite.to( mc_movies, 0, {alpha:0} ));
		timeline.insert( TweenLite.to( mc_screen4, 0, {alpha:0} ));
		timeline.insert( TweenLite.to( mc_angledphone, 0, {alpha:0} ));
		timeline.insert( TweenLite.to( mc_exclusive, 0, {alpha:0} ));



		//create the tweens
		timeline.insert( TweenLite.to( mc_phone1, .35, {x:95} ));
		timeline.insert( TweenLite.to( mc_screen1, .35, {x:108} ));
		timeline.insert( TweenLite.to( mc_phone1, .25, {x:180, delay:1.5} ));
		timeline.insert( TweenLite.to( mc_screen1, .25, {x:193, delay:1.5} ));
		timeline.append( TweenLite.to( mc_defyTM, .25, {x:15} ), -.25);
		timeline.append( TweenLite.to( mc_lifeproof, .25, {x:15} ), -.1);
		timeline.append( TweenLite.to( mc_defyTM, .25, {x:-210, delay:1} ));
		timeline.append( TweenLite.to( mc_lifeproof, .25, {x:-210, delay:.1} ), -.2);
		timeline.append( TweenLite.to( mc_justgotbetter, .25, {x:15} ), -.15);
		timeline.append( TweenLite.to( mc_justgotbetter, .25, {x:-210, delay:1} ));
		timeline.append( TweenLite.to( mc_phone1, .25, {x:15} ), -.2);
		timeline.append( TweenLite.to( mc_screen1, .25, {x:28} ), -.25);
		timeline.append( TweenLite.to( mc_screen2, .25, {x:27, alpha:1} ), -.25);
		timeline.append( TweenLite.from( mc_screen1, 0, {alpha:0} ));
		timeline.append( TweenLite.to( mc_faster, .25, {x:125} ), -.1);
		timeline.append( TweenLite.to( mc_1ghz, 1, {alpha:1} ));
		timeline.append( TweenLite.to( mc_faster, .25, {x:320, delay:1} ));
		timeline.append( TweenLite.to( mc_1ghz, .25, {x:320} ), -.25);
		timeline.append( TweenLite.to( mc_smarter, .25, {x:125} ),-.1);
		timeline.append( TweenMax.to( mc_smarterGlow, .5, {alpha:1, repeat:1, yoyo:true} ));
		timeline.append( TweenLite.to( mc_screen3, .5, {alpha:1} ), -1.2);
		timeline.append( TweenLite.from( mc_screen2, 0, {alpha:0} ));
		timeline.append( TweenLite.to( mc_android, 1, {alpha:1} ), -.5);
		timeline.append( TweenLite.to( mc_smarter, .25, {x:320, delay:1} ));
		timeline.append( TweenLite.to( mc_android, .25, {x:320} ), -.25);
		timeline.append( TweenLite.to( mc_richer, .25, {x:130} ),-.1);
		timeline.append( TweenLite.to( mc_screen4, .5, {alpha:1} ), -.25);
		timeline.append( TweenLite.from( mc_screen3, 0, {alpha:0} ));
		timeline.append( TweenLite.to( mc_movies, 1, {alpha:1} ), -.2);
		timeline.append( TweenLite.to( mc_richer, .25, {x:320, delay:1} ));
		timeline.append( TweenLite.to( mc_movies, .25, {x:320} ), -.25);
		timeline.append( TweenLite.to( mc_angledphone, .25, {x:180, y:28, alpha:1} ), -.25);
		timeline.append( TweenLite.from( mc_screen4, .15, {alpha:0} ));
		timeline.append( TweenLite.to( mc_phone1, .15, {alpha:0} ));





		timeline.append( TweenLite.to( mc_opaquebox, .25, {x:0} ));
		timeline.append( TweenLite.to( mc_defySecond, .3, {x:15} ));
		timeline.append( TweenLite.to( mc_fasterSmarter, .25, {x:15} ));
		timeline.append( TweenLite.to( mc_exclusive, .5, {alpha:1, delay: .5} ));
		timeline.append( TweenLite.to( mc_lifeEmpowered, .5, {alpha:1, delay: .5} ));


	}		


}

}

 

Any guidance would be appreciated.

 

Many thanks

Link to comment
Share on other sites

i can't seem to find where you are tweening screen 1 2 or 3 TO alpha:0 you seem to be using FROM alpha:0 which is probably the problem.

 

change

 

 timeline.append( TweenLite.from( mc_screen3, 0, {alpha:0} ));

 

to

 

timeline.append( TweenLite.to( mc_screen3, 0, {alpha:0, immediateRender:false} ));

 

immediateRender:false will prevent the tween from rendering as soon as it is created. 0 duration tweens are technically completed the instant they are created.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...