Jump to content
Search Community

issue on append after appendMultiple...

GeKi test
Moderator Tag

Recommended Posts

hi,

 

I'm trying to use appendMultiple and then append, in the same timeline

 

var timeline:TimelineMax = new TimelineMax();
....
timeline.appendMultiple([
                                    TweenMax.to(movieClip01,1,{x:10}),
                                    TweenMax.to(movieClip02,1,{y:10}),
                                    TweenMax.to(movieClip03,1,{z:10})
                                    ],0,TweenAlign.START,0);

timeline.append(TweenMax.to(movieClip04,1,{alpha:0}));

 

my problem is that the last line, the append, is not executed.

this is only an example. the real case is that any append after appendMultiple is not executed.

the code is working without timeline, only using TweenMax.to ()

 

what similar code to use to execute different animations in the same time and after that, to animate other things ?

I need the animations in a timeline , because I want to stop the timeline, revert, replay, etc...

 

thanks.

Link to comment
Share on other sites

I've analyzed my code and the issue is visible when append in different functions.

For example I have working code with timeline in one function, and then in another function I have the following code

 

//					TweenMax.to(movieContainerDisplayAds,0,{alpha:0,blurFilter:{blurX:20, blurY:20, quality:1}});
//					TweenMax.to(movieContainerDisplayAds,1,{alpha:1,z:2000,rotationY:430,rotationX:340,blurFilter:{blurX:0, blurY:0, quality:1}});
//					TweenMax.to(movieContainerDisplayAds,4,{delay:1,x:800,z:200,rotationY:360,rotationX:360});

				var myTimeline:TimelineMax = new TimelineMax();
				myTimeline.append(TweenMax.to(movieContainerDisplayAds,0,{alpha:0,blurFilter:{blurX:20, blurY:20, quality:1}}));
				myTimeline.append(TweenMax.to(movieContainerDisplayAds,1,{alpha:1,z:2000,rotationY:430,rotationX:340,blurFilter:{blurX:0, blurY:0, quality:1}}));
				myTimeline.append(TweenMax.to(movieContainerDisplayAds,4,{delay:1,x:800,z:200,rotationY:360,rotationX:360}));

				timeline.append(myTimeline);

 

When not using timeline, the animation is working fine, but when I append in the same timeline in another function, the code from the last function is not executed.

 

I coudn't attach my fla file because is too big, but here is the complete .as code

package
{
import flash.display.MovieClip;

import flash.events.MouseEvent;
import flash.events.NetStatusEvent;
import flash.events.Event;	

import flash.net.NetStream;
import flash.net.NetConnection;

import flash.media.Video;

import com.greensock.*;
import com.greensock.easing.*;	

public class zontera extends MovieClip
{		
	private var ns:NetStream;
	private var video:Video;
	private var metaObject:Object;

	private var videoID:int;

	private var isMoviePlaying:Boolean;		

	private var X1:X1AS3 = new X1AS3(stage);

	private var timeline:TimelineMax = new TimelineMax();


	public function zontera()
	{				
		// init flv video player
		InitVideo();

		ShowReplayScreen(false);

		ShowWords(false);

		buttonDisplay.addEventListener(MouseEvent.CLICK,onClickButtonDisplay);		
		buttonVideo.addEventListener(MouseEvent.CLICK,onClickButtonVideo);
		buttonText.addEventListener(MouseEvent.CLICK,onClickButtonText);
		buttonMobileRss.addEventListener(MouseEvent.CLICK,onClickButtonMobileRSS);

		// start animating Part One
		AnimatePartOne();
	}

	private function ShowWords(b:Boolean)
	{
		wordDisplay.visible = b;
		wordVideo.visible = b;
		wordText.visible = b;
		wordMobileRSS.visible = b;
	}

	private function HideAll()
	{
		ShowReplayScreen(false);

		if(ns)
		{
			ns.pause();
			ns.seek(0);
		}

		textAdsDisplay.visible = false;
		textAdsInText.visible = false;
		textAdsInVideo.visible = false;
		textAdsMobileRSS.visible = false;

		displayPageMask.visible = false;

		pageContainerInVideoAds.visible = false;
		pageContainerInTextAds.visible = false;

		bannerDisplay.visible = false;
		bannerInText.visible = false;
		bannerInVideo.visible = false;
		bannerMobileRSS.visible = false;

		textDisplayAds.visible = false;
		textInTextAds.visible = false;
		textInVideoAds.visible = false;
		textMobileRSSAds.visible = false;

		movieContainerMobileAds.visible = false;
		movieContainerDisplayAds.visible = false;
		movieContainerRSSAds.visible = false;
		movieContainerInTextAds.visible = false;
		movieContainerInVideoAds.visible = false;
	}

	private function onClickButtonDisplay(e:MouseEvent)
	{			
		HideAll();						
//			AnimateSectionDisplay();
	}

	private function onClickButtonVideo(e:MouseEvent)
	{
		HideAll();		
//			AnimateSectionInVideo();
	}

	private function onClickButtonText(e:MouseEvent)
	{
		HideAll();
//			AnimateSectionInText();
	}

	private function onClickButtonMobileRSS(e:MouseEvent)
	{
		HideAll();
//			AnimateSectionMobileRSS();
	}

	private function ShowSectionsButtons(b:Boolean)
	{
		buttonDisplay.visible = b;
		buttonVideo.visible = b;
		buttonText.visible = b;
		buttonMobileRss.visible = b;
	}

	private function AnimatePartOne()
	{
		displayPageMask.visible = false;
		ShowSectionsButtons(false);

		wordAdsTechnology.x = 257.05;
		wordAdsTechnology.y = 109.75;

		timeline.appendMultiple(TweenMax.allTo([wordAdsTechnology,wordDisplay,wordVideo,wordText,wordMobileRSS],0,{alpha:0,visible:true,z:1000,blurFilter:{blurX:20, blurY:20, quality:1}},0));
		timeline.appendMultiple(TweenMax.allTo([wordAdsTechnology,wordDisplay,wordVideo,wordText,wordMobileRSS],1,{alpha:1,z:0,ease:Cubic.easeOut,blurFilter:{blurX:0, blurY:0, quality:1}},1));
		timeline.appendMultiple([
								 TweenMax.to(wordAdsTechnology,0.5,{alpha:0,z:0,ease:Cubic.easeOut,blurFilter:{blurX:20, blurY:20, quality:1}}),
								 TweenMax.to(wordDisplay,0.5,{alpha:0,z:0,ease:Cubic.easeOut,blurFilter:{blurX:20, blurY:20, quality:1}}),
								 TweenMax.to(wordVideo,0.5,{alpha:0,z:0,ease:Cubic.easeOut,blurFilter:{blurX:20, blurY:20, quality:1}}),
								 TweenMax.to(wordText,0.5,{alpha:0,z:0,ease:Cubic.easeOut,blurFilter:{blurX:20, blurY:20, quality:1}}),
//									 TweenMax.to(wordMobileRSS,0.5,{alpha:0,z:0,ease:Cubic.easeOut,blurFilter:{blurX:20, blurY:20, quality:1},onComplete:AnimateSectionDisplay})
								 TweenMax.to(wordMobileRSS,0.5,{alpha:0,z:0,ease:Cubic.easeOut,blurFilter:{blurX:20, blurY:20, quality:1}})
								 ],0,TweenAlign.START,0);

		AnimateSectionDisplay();
	}

	private function AnimateSectionDisplay()
	{
		trace("AnimateSectionDisplay");

//			ShowSectionsButtons(true);

		textAdsDisplay.visible = true;
		bannerDisplay.visible = true;
		textDisplayAds.visible = true;
		movieContainerDisplayAds.visible = false;
		movieContainerInVideoAds.visible = false;
		movieContainerInTextAds.visible = false;
		movieContainerMobileAds.visible = false;
		movieContainerRSSAds.visible = false;

		AnimateSection(textDisplayAds,textAdsDisplay,bannerDisplay,OnCompleteAnimateDisplayAdsPage,null,1);
	}

	private function AnimateSectionInVideo()
	{
		ShowSectionsButtons(true);

		textAdsInVideo.visible = true;
		pageContainerInVideoAds.visible = true;
		bannerInVideo.visible = true;
		textInVideoAds.visible = true;
		movieContainerDisplayAds.visible = false;
		movieContainerInVideoAds.visible = false;
		movieContainerInTextAds.visible = false;
		movieContainerMobileAds.visible = false;
		movieContainerRSSAds.visible = false;


		AnimateSection(textInVideoAds,textAdsInVideo,bannerInVideo,OnCompleteAnimateInVideoAdsPage,pageContainerInVideoAds,0);
	}

	private function AnimateSectionInText()
	{
		ShowSectionsButtons(true);

		textAdsInText.visible = true;
		pageContainerInTextAds.visible = true;
		bannerInText.visible = true;
		textInTextAds.visible = true;
		movieContainerDisplayAds.visible = false;
		movieContainerInVideoAds.visible = false;
		movieContainerInTextAds.visible = false;
		movieContainerMobileAds.visible = false;
		movieContainerRSSAds.visible = false;

		AnimateSection(textInTextAds,textAdsInText,bannerInText,OnCompleteAnimateInTextAdsPage,pageContainerInTextAds,0);
	}

	private function AnimateSectionMobileRSS()
	{
		ShowSectionsButtons(true);

		textAdsMobileRSS.visible = true;
		bannerMobileRSS.visible = true;
		textMobileRSSAds.visible = true;
		movieContainerDisplayAds.visible = false;
		movieContainerInVideoAds.visible = false;
		movieContainerInTextAds.visible = false;
		movieContainerMobileAds.visible = false;
		movieContainerRSSAds.visible = false;

		AnimateSection(textMobileRSSAds,textAdsMobileRSS,bannerMobileRSS,OnCompleteAnimateMobileAdsPage,null,2);
	}

	private function AnimateSection(mainText,subTexts,standardBanner,onCompleteFunction,pageContainer,type)
	{
		trace("AnimateSection");

		mainText.x = stage.stageWidth;
		mainText.y = stage.stageHeight;

		timeline.append(TweenMax.to(mainText,0,{alpha:0,z:100,blurFilter:{blurX:20, blurY:20, quality:1}}));
//			timeline.append(TweenMax.to(mainText,1,{alpha:1,z:0,x:stage.stageWidth/2,y:stage.stageHeight/2,ease:Cubic.easeOut,blurFilter:{blurX:0, blurY:0, quality:1}}));

//			timeline.append(TweenMax.to(subTexts,1,{alpha:1,z:0,x:30,y:stage.stageHeight/2,ease:Cubic.easeOut,blurFilter:{blurX:0, blurY:0, quality:1}}));

		timeline.appendMultiple([
								 TweenMax.to(mainText,1,{alpha:1,z:0,x:stage.stageWidth/2,y:stage.stageHeight/2,ease:Cubic.easeOut,blurFilter:{blurX:0, blurY:0, quality:1}}),
								 TweenMax.to(subTexts,1,{alpha:1,z:0,x:30,y:stage.stageHeight/2,ease:Cubic.easeOut,blurFilter:{blurX:0, blurY:0, quality:1}})
								 ],0,TweenAlign.START,0);

		standardBanner.x = 400;
		standardBanner.y = stage.stageHeight/2;

//			TweenMax.to(standardBanner,0,{alpha:0,blurFilter:{blurX:20, blurY:20, quality:1}});
		timeline.append(TweenMax.to(standardBanner,0,{alpha:0,blurFilter:{blurX:20, blurY:20, quality:1}}));

		if(type == 0)
		{
//				pageContainer.z = 0;
//				pageContainer.rotationX = 0;
//				pageContainer.rotationY = 0;

//				pageContainer.x = stage.stageWidth/2 + pageContainer.width - 50;
//				pageContainer.y = stage.stageHeight/2;				

//				TweenMax.to(pageContainer,0,{alpha:0,blurFilter:{blurX:20, blurY:20, quality:1}});
//				timeline.append(TweenMax.to(pageContainer,0,{alpha:0,blurFilter:{blurX:20, blurY:20, quality:1}}));
//				TweenMax.to(mainText,1,{delay:2,z:1000,x:-600,y:-300,ease:Strong.easeOut});
//				timeline.append(TweenMax.to(mainText,1,{delay:2,z:1000,x:-600,y:-300,ease:Strong.easeOut}));
//				TweenMax.to(standardBanner,1,{delay:2,alpha:1,blurFilter:{blurX:0, blurY:0, quality:1}});								
// 		    	TweenMax.to(pageContainer,1,{delay:2,alpha:1,rotationY:400,rotationX:300,blurFilter:{blurX:0, blurY:0, quality:1}});

//				TweenMax.to(pageContainer,2,{delay:3,rotationX:340,ease:Cubic.easeOut,onComplete:onCompleteFunction});
		}
		else if(type == 1)
		{
//				TweenMax.to(mainText,1,{delay:2,z:1000,x:-600,y:-300,ease:Strong.easeOut});
//				timeline.append(TweenMax.to(mainText,1,{z:1000,x:-600,y:-300,ease:Strong.easeOut}));
//				TweenMax.to(standardBanner,1,{delay:2,alpha:1,blurFilter:{blurX:0, blurY:0, quality:1},onComplete:onCompleteFunction});
//				timeline.append(TweenMax.to(standardBanner,1,{alpha:1,blurFilter:{blurX:0, blurY:0, quality:1},onComplete:onCompleteFunction}));

			timeline.appendMultiple([
									 TweenMax.to(mainText,1,{z:1000,x:-600,y:-300,ease:Strong.easeOut}),
									 TweenMax.to(standardBanner,1,{alpha:1,blurFilter:{blurX:0, blurY:0, quality:1},onComplete:onCompleteFunction})
									 ],0,TweenAlign.START,0);
		}
		else if(type == 2)
		{
			TweenMax.to(mainText,1,{delay:2,z:1000,x:-600,y:-300,ease:Strong.easeOut});
			TweenMax.to(standardBanner,1,{delay:2,alpha:1,blurFilter:{blurX:0, blurY:0, quality:1},onComplete:onCompleteFunction});
		}
		else if(type == 3)
		{			
			pageContainer.z = 0;
			pageContainer.rotationX = 0;
			pageContainer.rotationY = 0;

			pageContainer.x = stage.stageWidth/2 + pageContainer.width - 50;
			pageContainer.y = stage.stageHeight/2;				

			TweenMax.to(pageContainer,0,{alpha:0,blurFilter:{blurX:20, blurY:20, quality:1}});
			TweenMax.to(mainText,1,{delay:2,z:1000,x:-600,y:-300,ease:Strong.easeOut});
			TweenMax.to(standardBanner,1,{delay:2,alpha:1,blurFilter:{blurX:0, blurY:0, quality:1}});
 		    	TweenMax.to(pageContainer,1,{delay:2,alpha:1,rotationY:400,rotationX:300,blurFilter:{blurX:0, blurY:0, quality:1}});

			TweenMax.to(pageContainer,2,{delay:3,rotationX:340,ease:Cubic.easeOut,onComplete:onCompleteFunction});
		}
	}

	private function InitVideo()
	{
		var connection:NetConnection = new NetConnection();
           connection.connect(null);
		ns = new NetStream(connection);
		ns.addEventListener(NetStatusEvent.NET_STATUS, OnNetStatusEvent);

		video = new Video();	
		video.smoothing = true;			

		var client:Object = new Object();
		client.onMetaData = metadataHandler;

		ns.client = client;	

		video.attachNetStream(ns);			
	}

	private function OnCompleteAnimateDisplayAdsPage()
	{
		trace("OnCompleteAnimateDisplayAdsPage");

		videoID = 1;
		PlayVideo(movieContainerDisplayAds,X1.GetBannerHttpDir() + "Zontera_Expand.flv");
	}

	private function OnCompleteAnimateInTextAdsPage()
	{
		videoID = 2;
		PlayVideo(movieContainerInTextAds,X1.GetBannerHttpDir() + "Zontera_Underline_Only_Banner.flv");
	}

	private function OnCompleteAnimateInVideoAdsPage()
	{
		videoID = 3;
		PlayVideo(movieContainerInVideoAds,X1.GetBannerHttpDir() + "Zontera_In-Stream_Only_Player.flv");
	}

	private function OnCompleteAnimateMobileAdsPage()
	{
		videoID = 4;
		PlayVideo(movieContainerMobileAds,X1.GetBannerHttpDir() + "Zontera_Mobile_Only_Banner.flv");
	}

	private function onCompleteAnimateRSSAdsPage()
	{
		videoID = 5;
		PlayVideo(movieContainerRSSAds,X1.GetBannerHttpDir() + "Zontera_RSS_Only_Banner.flv");			
	}


	private function PlayVideo(pageContainer:Object,videoFile:String)
	{			
		pageContainer.addChild(video);
		ns.pause();
		ns.seek(0);
		ns.play(videoFile);
		isMoviePlaying = true;
	}		

	private function metadataHandler(metadataObj:Object):void
	{
		metaObject = metadataObj;			

		video.width = metadataObj.width;
		video.height = metadataObj.height;

		video.x = - metadataObj.width/2;
		video.y = - metadataObj.height/2;														
	}

	private function OnNetStatusEvent(event:NetStatusEvent):void
	{			
		switch (event.info.code) 
		{				
			case "NetStream.Play.Start" :
			{
				OnPlayEvent();
			}
			break;

			case "NetStream.Play.Stop" :
			{									
				OnStopEvent();					
			}
			break;					
		}
	}		

	private function OnPlayEvent()
	{
		switch(videoID)
		{
			case 1:
			{
				displayPageMask.visible = true;

				movieContainerDisplayAds.visible = true;

				movieContainerDisplayAds.rotationX = 0;
				movieContainerDisplayAds.rotationY = 0;
				movieContainerDisplayAds.z = 9000;											

				movieContainerDisplayAds.x = 1580;
				movieContainerDisplayAds.y = stage.stageHeight/2;														

//					TweenMax.to(movieContainerDisplayAds,0,{alpha:0,blurFilter:{blurX:20, blurY:20, quality:1}});
//					timeline.append(TweenMax.to(movieContainerDisplayAds,0,{alpha:0,blurFilter:{blurX:20, blurY:20, quality:1}}));
//					TweenMax.to(movieContainerDisplayAds,1,{alpha:1,z:2000,rotationY:430,rotationX:340,blurFilter:{blurX:0, blurY:0, quality:1}});
//					timeline.append(new TweenMax(movieContainerDisplayAds,1,{alpha:1,z:2000,rotationY:430,rotationX:340,blurFilter:{blurX:0, blurY:0, quality:1}}));
//					TweenMax.to(movieContainerDisplayAds,4,{delay:1,x:800,z:200,rotationY:360,rotationX:360});

				var myTimeline:TimelineMax = new TimelineMax();
				myTimeline.append(TweenMax.to(movieContainerDisplayAds,0,{alpha:0,blurFilter:{blurX:20, blurY:20, quality:1}}));
				myTimeline.append(TweenMax.to(movieContainerDisplayAds,1,{alpha:1,z:2000,rotationY:430,rotationX:340,blurFilter:{blurX:0, blurY:0, quality:1}}));
				myTimeline.append(TweenMax.to(movieContainerDisplayAds,4,{delay:1,x:800,z:200,rotationY:360,rotationX:360}));

				timeline.append(myTimeline);
			}
			break;

			case 2:
			{										
				movieContainerInTextAds.visible = true;

				movieContainerInTextAds.rotationX = 340;
				movieContainerInTextAds.rotationY = 400;
				movieContainerInTextAds.z = 1200;

				movieContainerInTextAds.x = 1190;
				movieContainerInTextAds.y = stage.stageHeight/2 - 105;

				TweenMax.to(movieContainerInTextAds,0,{alpha:0,blurFilter:{blurX:20, blurY:20, quality:1}});
				TweenMax.to(movieContainerInTextAds,2,{alpha:1,ease:Cubic.easeOut,x:770,y:movieContainerInTextAds.height/2 + 80,z:-100,rotationX:360,rotationY:360,blurFilter:{blurX:0, blurY:0, quality:1}});
			}
			break;

			case 3:
			{
				movieContainerInVideoAds.visible = true;

				movieContainerInVideoAds.x = 1330;
				movieContainerInVideoAds.y = stage.stageHeight/2 + 50;
				movieContainerInVideoAds.rotationX = 340;
				movieContainerInVideoAds.rotationY = 400;
				movieContainerInVideoAds.z = 2000;
				movieContainerInVideoAds.alpha = 0;

				TweenMax.to(movieContainerInVideoAds,2,{alpha:1,ease:Cubic.easeOut,x:750,y:stage.stageHeight/2,z:-100,rotationX:360,rotationY:360});							
			}
			break;

			case 4:
			{
				movieContainerMobileAds.visible = true;

				movieContainerMobileAds.rotationX = 0;
				movieContainerMobileAds.rotationY = 0;
				movieContainerMobileAds.z = 2000;

				movieContainerMobileAds.x = 980;
				movieContainerMobileAds.y = stage.stageHeight/2+30;

				TweenMax.to(movieContainerMobileAds,0,{alpha:0,blurFilter:{blurX:20, blurY:20, quality:1}});
				TweenMax.to(movieContainerMobileAds,1,{alpha:1,x:700,z:0,rotationY:430,rotationX:340,blurFilter:{blurX:0, blurY:0, quality:1}});
				TweenMax.to(movieContainerMobileAds,4,{delay:1,z:-350,rotationY:360,rotationX:360});							
			}
			break;


			case 5:
			{
				movieContainerRSSAds.visible = true;

				displayPageMask.visible = true;

				movieContainerRSSAds.rotationX = 0;
				movieContainerRSSAds.rotationY = 0;
				movieContainerRSSAds.z = 9000;

				movieContainerRSSAds.x = 1000;
				movieContainerRSSAds.y = stage.stageHeight/2;

				TweenMax.to(movieContainerRSSAds,0,{alpha:0,blurFilter:{blurX:10, blurY:10, quality:1}});
				TweenMax.to(movieContainerRSSAds,1,{alpha:1,z:1000,rotationY:430,rotationX:340});
				TweenMax.to(movieContainerRSSAds,4,{delay:1,x:1050,z:200,rotationY:360,rotationX:360,blurFilter:{blurX:0, blurY:0, quality:1}});
			}
			break;
		}
	}

	private function OnStopEvent()
	{		
		trace("stop film");
		ns.pause();
		ns.seek(0);			
		isMoviePlaying = false;

		switch(videoID)
		{
			case 1:
			{
				TweenMax.to(movieContainerDisplayAds,3,{ease:Strong.easeInOut,x:1580,y:stage.stageHeight/2 + 50,z:2000,rotationX:340,rotationY:440});
				TweenMax.to(movieContainerDisplayAds,2,{delay:2,ease:Strong.easeInOut,x:-500,y:stage.stageHeight/2 + 50,z:-1000,rotationX:0,rotationY:0,onStart:onStartMovieDisplayAds,onComplete:onCompleteMovieDisplayAds});
			}
			break;

			case 2:
			{
				TweenMax.to(movieContainerInTextAds,2,{alpha:0,ease:Strong.easeInOut,x:1190,y:stage.stageHeight/2 - 105,z:1200,rotationX:340,rotationY:400,onComplete:onCompleteMovieInTextAds});
			}
			break;

			case 3:
			{
				TweenMax.to(movieContainerInVideoAds,2,{alpha:0,ease:Strong.easeInOut,x:1100,y:stage.stageHeight/2,z:1200,rotationX:340,rotationY:400,onComplete:onCompleteMovieInVideoAds});
			}
			break;

			case 4:
			{
				TweenMax.to(movieContainerMobileAds,3,{ease:Strong.easeInOut,x:1000,y:stage.stageHeight/2 + 50,z:1000,rotationX:340,rotationY:440});
				TweenMax.to(movieContainerMobileAds,2,{delay:2,ease:Strong.easeInOut,x:2500,y:stage.stageHeight/2 + 50,z:-1000,rotationX:0,rotationY:0,onComplete:onCompleteMovieMobileAds});
			}
			break;

			case 5:
			{
				TweenMax.to(movieContainerRSSAds,3,{ease:Strong.easeInOut,x:1000,y:stage.stageHeight/2 + 50,z:1000,rotationX:340,rotationY:440});
				TweenMax.to(movieContainerRSSAds,2,{delay:2,ease:Strong.easeInOut,x:2500,y:stage.stageHeight/2 + 50,z:-1000,rotationX:0,rotationY:0,onStart:onStartMovieRSSAds,onComplete:onCompleteMovieRSSAds});
			}
			break;
		}
	}					

	private function ShowReplayScreen(b:Boolean)
	{
		endFrame.visible = b;
		replayBtn.visible = b;
		if(
			replayBtn.addEventListener(MouseEvent.CLICK,onClickReplayBtn);			
		else
			replayBtn.removeEventListener(MouseEvent.CLICK,onClickReplayBtn);			
	}

	private function onClickReplayBtn(e:Event)
	{
		ShowReplayScreen(false);

		AnimatePartOne();
	}

	private function onStartMovieRSSAds()
	{
		TweenMax.to(textAdsMobileRSS,2,{alpha:0});
		TweenMax.to(bannerMobileRSS,2,{alpha:0});				
	}

	private function onStartMovieDisplayAds()
	{
		TweenMax.to(textAdsDisplay,2,{alpha:0});
		TweenMax.to(bannerDisplay,2,{alpha:0});			
	}		

	private function onStartMovieInTextAds()
	{
		TweenMax.to(textAdsInText,2,{alpha:0});
		TweenMax.to(bannerInText,2,{alpha:0});													
	}


	private function onCompleteMovieDisplayAds()
	{					
		displayPageMask.visible = false;						
		AnimateSectionInVideo();			
	}				

	private function onCompleteMovieInVideoAds()
	{

		trace("onCompleteInVideoadsMovie");

		displayPageMask.visible = false;

		TweenMax.to(textAdsInVideo,2,{alpha:0});
		TweenMax.to(bannerInVideo,2,{alpha:0});			

		TweenMax.to(pageContainerInVideoAds,2,{delay:0.5,z:-1000,rotationX:0,rotationY:0,ease:Cubic.easeOut,onComplete:AnimateSectionInText});

	}		

	private function onCompleteMovieInTextAds()
	{
		trace("onCompleteInTextAdsMovie");

		displayPageMask.visible = false;

		TweenMax.to(textAdsInText,2,{alpha:0});
		TweenMax.to(bannerInText,2,{alpha:0});													

		TweenMax.to(pageContainerInTextAds,2,{delay:0.5,z:-1000,rotationX:0,rotationY:0,ease:Cubic.easeOut,onComplete:AnimateSectionMobileRSS});			
	}		

	private function onCompleteMovieMobileAds()
	{
		onCompleteAnimateRSSAdsPage();
	}

	private function onCompleteMovieRSSAds()
	{
		displayPageMask.visible = false;
		ShowReplayScreen(true);
	}				
}
}

Link to comment
Share on other sites

I don't have time to analyze all of your code right now (that was a lot), but I'm wondering if it may just be a timing issue with when you are appending your stuff. Are you expecting the TimelineLite/Max to play fully, then stop at the end, and then if/when you append another tween, it picks up from there? If so, that's not how it works - every TimelineLite/Max has a parent timeline (by default, it's the TweenLite.rootTimeline) and each one has a specific startTime on that parent. So imagine a virtual playhead zooming across the parent timeline, playing your TimelineLite/Max as it goes. If it reaches the end of your TimelineLite/Max, it keeps going. So let's say it reached the end of your TimelineLite and has proceeded 5 seconds after it and then you append() a 2-second tween to your TimelineLite/Max - you'll never see it play because the virtual playhead has already blown past the ending of your TimelinLite/Max by 5 seconds. See what I mean? Of course you can always restart() your TimelineLite or jump to a specific spot with gotoAndPlay() or by setting the currentTime property. Those essentially adjust its startTime according to the parent's currentTime.

 

I also noticed that a lot of your tweens are not in the TimelineLite/Max, so watch for overwriting. If, for example, you're tweening myObject's x property in the timeline (which is running currently) and then you fire off a standalone tween of myObject's x property - if both are trying to fight over the same property of the same object, the newest one will overwrite the other(s).

 

Hope that helps.

Link to comment
Share on other sites

now I understood how the timeline is working.

indeed It was a timing issue. I was expecting to view something that I've added after the playhead was reached the end of the timeline.

In the attached code, only few lines are on timeline, because i did't manage to add them all with the expected result.But the TweenMax lines are not executed in the code. anyway ignore it because

I've managed to solve the problem in other ways than using TimelineMax/Lite.

Thanks for your time!

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...