PDA

Volledige versie bekijken : Scrollbalk met ease ??


Pascal S.
%Europe/Berlin %556 %2005, 13:21
ik heb thumbnails die uit een xml bestand worden geladen en daarna in een scrollbalk komen nu kan ik wel srollen met een constante snelheid, maar ik wil graag een ease toevoegen zodat het wat geleidelijker gaat.

Ik al gezocht naar het easing gebeuren alleen als ik alles toepas kan ik 1 keer scrollen met een ease maar daarna scrolled ie niet meer. Wie o wie helpt me verder ?

Dit is de code

function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-20)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=(hit_left._x+20)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}

*Erwin*
%Europe/Berlin %624 %2005, 14:59
Bij mij werk dit script goed? Misschien heb je er wat aan. scrollspeed=20
easing = 7;
noscroll=false
// stel de easing-snelheid in.....

Mask._height=Mask._height*1
tt=Mask._height
achtergrond_balk._height = Mask._height - 1;
knop_init = (Mask._height / tekst._height) * Mask._height;
if (knop_init <= Mask._height) {
// TEKST IS LANGER DAN VENSTER; DE KNOP WORDT BEREKEND
knop._height = (Mask._height / tekst._height) * Mask._height;
} else {
// ZORGEN DAT OK NIET MEER MET HET SCROLLWHEEL GESCROLLD KAN WORDEN MET WEINING TEKST
scrollspeed=0
// TEKST IS KORTER DAN HET VENSTER, GEEN SCROLLBALK NODIG EN DUS VER UIT BEELD PLAATSEN
knop._x = 8000;
achtergrond_balk._x = 8000;
}
//SCROLLWHEEL ACTIVEREN STEL DE SNELHEIOD IN MET SCROLLSPEED.
mouseListener = new Object ();
mouseListener.onMouseWheel = function (delta) {
if (delta < 0) {
knop._y = Math.min (knop._y -= delta*scrollspeed, (Mask._height - knop._height));
} else {
knop._y = Math.max (knop._y -= delta*scrollspeed, 0);
}
};
Mouse.addListener (mouseListener);
//BALKJE WORDT HIER AFGELUISTERD EN EVENTUEEL VERPLAATST EN HET SCROLLEN INDIRECT IN WERKING GEZET
knop.onPress = function () {
startDrag (this, false, this._x, 0, this._x, Mask._height - this._height);
};
knop.onRelease = knop.onReleaseOutside = function () {
stopDrag ();
};
tekst.onEnterFrame = function () {
scrollAmount = (this._height - (Mask._height)) / (Mask._height - knop._height);
targY = -knop._y * scrollAmount;
this._y -= (this._y - targY) / easing;
};
// WORDT ER OP DE ACHTERGROND BALK GEKLIKT?
achtergrond_balk.onRelease = function () {
if (_ymouse > knop._y) {
knop._y = Math.min (knop._y + knop._height, (Mask._height - knop._height));
} else {
knop._y = Math.max (knop._y - knop._height, 0);
}
}

Pascal S.
%Europe/Berlin %790 %2005, 18:58
sorry maar ik wordt er niet echt wijzer van

ik snap niet hoe ik die thumbnail_mc moet verwerken met de easing

theFlashWizard
%Europe/Berlin %797 %2005, 19:08
kijk eens op www.gotoAndLearn.com :)

Pascal S.
%Europe/Berlin %876 %2005, 21:02
bedoel je custom easing tool dan ??

theFlashWizard
%Europe/Berlin %515 %2005, 12:21
wat dacht je van scrolling tumbnailpanel.. want volgens mij is dat precies wat je wilt maken..

Pascal S.
%Europe/Berlin %540 %2005, 12:59
hmmm overheen gekeken, maja die gebruikt geen extern geladen dingen hmmmm

thanks anyways

theFlashWizard
%Europe/Berlin %545 %2005, 13:05
heb eens geduld en kijk eens wat verder.. er staat bijv ook een flash & xml slideshow bij.. die gebruikt wel externe bestanden. combineer die 2 en leer ervan.