I have been adding simple transitions to a site Im making. They simply scroll up from the bottom on loading. One file uses a scroller I found a link to here on kirupa.com(from some rock band site).
Heres the tweens, non working onComplete and scroller script.
import caurina.transitions.Tweener
content_mc._alpha = 0;
content_mc._y = 475;
setY = function(mc, newY) { mc._y = newY; }
Tweener.addTween(content_mc, {_y:15, time:2, transition:"easeOut", rounded:true});
Tweener.addTween(content_mc, {_alpha:100, time:1, transition:"linear"});
Tweener.addTween(content_mc, {_blur_blurY:50});
Tweener.addTween(content_mc, {_blur_blurY:0, time:2, onComplete:setY, onCompleteParams:[content_mc, 15]});
fscommand("allowscale", "false");
bar.useHandCursor = dragger.useHandCursor=false;
space = 20;
friction = 0.9;
speed = 4;
y = dragger._y;
top = content_mc._y;
bottom = content_mc._y+mask_mc._height-content_mc._height-space;
dragger.onPress = function() {
drag = true;
this.startDrag(false, this._x, this._parent.y, this._x, this._parent.y+this._parent.bar._height-this._height);
dragger.scrollEase();
};
dragger.onMouseUp = function() {
this.stopDrag();
drag = false;
};
bar.onPress = function() {
drag = true;
if (this._parent._ymouse>this._y+this._height-this._parent.dragger._height) {
this._parent.dragger._y = this._parent._ymouse;
this._parent.dragger._y = this._y+this._height-this._parent.dragger._height;
} else {
this._parent.dragger._y = this._parent._ymouse;
}
dragger.scrollEase();
};
bar.onMouseUp = function() {
drag = false;
};
moveDragger = function (d) {
if ((dragger._y>=y+bar._height-dragger._height && d == 1) || (dragger._y<=y && d == -1)) {
clearInterval(myInterval);
} else {
dragger._y += d;
dragger.scrollEase();
updateAfterEvent();
}
};
up_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, -1);
};
down_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, 1);
};
up_btn.onMouseUp = down_btn.onMouseUp=function () {
clearInterval(myInterval);
};
MovieClip.prototype.scrollEase = function() {
this.onEnterFrame = function() {
if (Math.abs(dy) == 0 && drag == false) {
delete this.onEnterFrame;
}
r = (this._y-y)/(bar._height-this._height);
dy = Math.round((((top-(top-bottom)*r)-content_mc._y)/speed)*friction);
content_mc._y += dy;
};
};
Everything works fine except the onComplete which I simply want to set the _y pos of the mc to 15 after the transitions are complete so that the scroller script doesnt think the mc is at a _y position of 475.
I think I have the syntax for the onComplete and my setY function added correctly. Can anyone see the problem with this? Or another way to acheive what Im looking for?
TIA