Solved

using tween class between slides as2

Posted on 2010-09-02
1
447 Views
Last Modified: 2012-05-10
Hi

Rather than creating tweens manually on the timeline is it possible to create tweens using AS2 between presentation slides.

My timeline is setup with folders containg several layers for each slide. So i have a folder for slide1, slide 2 and so on. The layers within these folders contain the assets for each slide which are movieclips etc

How can i use the tween class to create a fade effect when navigating between slides? I have set up a navigation menu that loads the appropraite slide by playing the right frame

Cheers
0
Comment
Question by:coolispaul
1 Comment
 
LVL 18

Accepted Solution

by:
Antonio Estrada earned 500 total points
ID: 33669303
Something like this should work:

You'd need to change your gotoAndStop calls to gotoAndStopTween.

<code>

If you need this to be more specific, please post your fla.

Good luck,

-V
import mx.transitions.Tween;

import mx.transitions.easing.Strong;



var seconds:Number = 1;



gotoAndStopTween(2);



function gotoAndStopTween(frame):Void {

	var square:MovieClip = _root.createEmptyMovieClip("square", _root.getNextHighestDepth());

	square.beginFill(0x000000, 100);

	square.lineTo(Stage.width, 0);

	square.lineTo(Stage.width, Stage.height);

	square.lineTo(0, Stage.height);

	square.lineTo(0, 0);

	square.endFill();

	square._alpha = 0;

	var tween:Tween = new Tween(square, "_alpha", Strong.easeOut, 0, 100, seconds, true);

	tween.onMotionFinished = function():Void {

		var tweenOut:Tween = new Tween(square, "_alpha", Strong.easeOut, 100, 0, seconds, true);

		gotoAndStop(frame);

		tweenOut.onMotionFinished = function():Void {

			removeMovieClip(square);

		}

	}

}



stop();

Open in new window

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now