Solved

using tween class between slides as2

Posted on 2010-09-02
1
476 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

688 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