Hjælp til MC-scroll: Til toppen?
Hejsa.Jeg har lavet en scrollfunktion med nedenstående script. Men jeg vil gerne - i bunden af det MC man scroller i - have en "til toppen" knap.
Hvordan kan jeg lave det? Noget med at sætte x-koordinaten til MC’ets udgangspunkt eller? HJÆLP - er ikke stærk i action Scripts! :-)
mvh Lasse
Scriptet:
scrollSpeed = 10;
down_mc.onRollOver = function() {
this.onEnterFrame = function() {
var picH = this._parent.scroll_mc.pic_mc._height;
var maskH = this._parent.scroll_mc.mask_mc._height;
var picY = this._parent.scroll_mc.pic_mc._y;
var maskY = this._parent.scroll2_mc.mask_mc._y;
if (maskY<picY+(picH-maskH)) {
this._parent.scroll_mc.pic_mc._y -= scrollSpeed;
} else {
this._parent.scroll_mc.pic_mc._y = maskH-picH+maskY;
}
};
};
down_mc.onRollOut = function() {
delete this.onEnterFrame;
};
up_mc.onRollOver = function() {
this.onEnterFrame = function() {
var picY = this._parent.scroll_mc.pic_mc._y;
var maskY = this._parent.scroll2_mc.mask_mc._y;
if (0>picY-maskY) {
this._parent.scroll_mc.pic_mc._y += scrollSpeed;
} else {
this._parent.scroll_mc.pic_mc._y = maskY;
}
};
};
up_mc.onRollOut = function() {
delete this.onEnterFrame;
};
