2008
09.27

Presentation slides have been a feature of Flash MX 2004 and is still available in Flash 9 (but still used ActionScript 2) – so when designers see it, they think “Oh! oh! We could have Flash styled PowerPoint presentations…” and away they go. All great until they have finished hand tweening all the texts for 50 slides and then at the eleventh hour the client makes a whole load of copy changes and does not quite like the rate or tween effect on the slides.  Oh no, disaster!!!

To avoid such a senario and to keep transitions consistent, here’s a tip “extend the mx.screens.Slide” class and hold your core functionality here for things such as Text tweens and use simple calls within your slides to start your core functionality.

Okay, here we go – start of by creating a class that extends “mx.screens.Slide” :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import caurina.transitions.Tweener;
import caurina.transitions.properties.FilterShortcuts;
import flash.filters.BlurFilter;
import mx.transitions.TransitionManager;

class Presenter extends mx.screens.Slide {

static var timers:Array = new Array();
private var bf:BlurFilter;
// -- constructor
function Presenter() {
super();
bf = new BlurFilter(2,10,2);
FilterShortcuts.init();
}

function fadeBounceTexts(texts:Array):Void{
for(var n=0;n<texts.length;n++){
texts[n].tf._alpha = 0;
texts[n].t = setInterval(this,"fadeBounceText",(texts[n].d * 1000),texts[n]);
timers.push(texts[n].t);
}
}

function fadeBounceText(obj:Object):Void{
clearInterval(obj.t);
var of = obj.tf.filters;
var oY:Number = obj.tf._y;

obj.tf.filters = new Array(bf);
obj.tf._y = obj.tf._y + (obj.tf.textHeight * 0.8);
obj.tf._alpha = 0;
obj.tf._yscale = 80;

Tweener.addTween(obj.tf, {_alpha:100,_yscale:100, _filter:new BlurFilter(0,0,0), _y:oY, time:0.7, transition:"easeOutBack"});
}
}

In the code above I have used Tweener, no point in reinventing the wheel.  So when I call the function “fadeBounceTexts” from each slide, then this will start the text effects:

1
2
3
4
5
6
7
8
9
on(reveal){
_parent.fadeBounceTexts([
{tf:t1, d:1},
{tf:t2, d:1.2},
{tf:t3, d:1.4},
{tf:c1.t1, d:2.2},
{tf:c1.t2, d:2.4}
]);
}

Where “tf” is the instance name of the dynamic textfield and “d” is the delay before the Tween should start and this is all started when the slide is revealed, hence “on(reveal)”. Anyhow, enough gibber jabber, here is a rar file with it all in (and a little extra!)

download

Bookmark and Share

No Comment.

Add Your Comment