I was thinking we could help out n00bs just as the Virtual Camera has done by making a transitions class for them to have easy transitions done via actionscript and API. So if anyone wants to add in little scripts to this (or indeed fix up my otherwise lazy code) feel free
Here is the source so far note that I am ill and I whipped this up in 20 mins
class trans {
public var fps;
// Wipe
public function wipe(color, alp, duration, x, y, xtgt, ytgt) {
_root.createEmptyMovieClip("fader", 999);
with (_root.fader) {
lineStyle(0, 0, 0);
beginFill(color, alp);
var bounds:Object = _root.getBounds(_root);
trace(bounds);
moveTo(0, 0);
lineTo(bounds.xMax, 0);
lineTo(bounds.xMax, bounds.yMax);
lineTo(0, bounds.yMax);
lineTo(0, 0);
endFill();
_x = x;
_y = y;
}
_root.fader.fps = this.fps;
_root.fader.onEnterFrame = function() {
this._x += (xtgt/duration)/fps;
this._y += (ytgt/duration)/fps;
};
}
// Fade
public function fade(color, alp, duration) {
_root.createEmptyMovieClip("fader", 999);
with (_root.fader) {
lineStyle(0, 0, 0);
beginFill(color, alp);
var bounds:Object = _root.getBounds(_root);
trace(bounds);
moveTo(0, 0);
lineTo(bounds.xMax, 0);
lineTo(bounds.xMax, bounds.yMax);
lineTo(0, bounds.yMax);
lineTo(0, 0);
endFill();
_x = _y=0;
}
_root.fader.fps = this.fps;
_root.fader.onEnterFrame = function() {
this._alpha -= (alp/duration)/fps;
trace(this._alpha);
};
}
}
And here is something you can put in frame 1 to test it out
var fadem:trans = new trans();
fadem.fps = 20;
fadem.wipe(0xFFF000, 20, 2,0,0,550,400);