uhm ma dove ce lo metto
codice scroll, con tutta la descrizione di oringe
Codice PHP:
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
////BLUR SCROLL v 0.1
////copyright (c) 2006 Benjamin Wong
////http://www.oringe.com
////
////NOTICE:
////Feel free to re-use and modify, but if you do use it, please link
////back to [url]www.oringe.com[/url]! Thank you!
////
//////////////////////////////////////////////////////////////////////
//MODIFY the below variables to suit your needs:
//
//set your flash stage width here:
initStageWidth = 550;
//
//set how many pixels you want your content to move when you move
//the mousewheel here:
mouseWheelIncrement = 90;
//////////////////////////////////////////////////////////////////////
//DO NOT TOUCH the below code
//unless, of course, you want to change the script and
//workings of this code.
////////////////////////////
//import the blur filter (requires Flash 8 & actionscript 2)
import flash.filters.BlurFilter;
blur = new BlurFilter(0, 3, 4);
////////////////////////////
//create a listener for the mouse wheel so the mouse wheel works
mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
if (delta < 0) {
mainTargetY -= mouseWheelIncrement;
if (mainTargetY < Stage.height - main._height) {
mainTargetY = Stage.height - main._height;
}
}
if (delta > 0) {
mainTargetY += mouseWheelIncrement;
if (mainTargetY > mainInitY) {
mainTargetY = mainInitY;
}
}
}
Mouse.addListener(mouseListener);
mainInitY = main._y;
scrollbarInitY = scrollbar.scrollbutton._y;
scrollOn = false;
mainTargetY = mainInitY;
scrollbarTargetY = scrollbarInitY;
scrollbar.scrollbutton.useHandCursor = false;
scrollbar.scrollbutton.onRollOver = function() {
if (!scrollOn) {
this.gotoAndPlay("over");
}
}
scrollbar.scrollbutton.onDragOver = scrollbar.scrollbutton.onRollOver;
scrollbar.scrollbutton.onRollOut = function() {
this.gotoAndPlay("out");
}
scrollbar.scrollbutton.onPress = function() {
scrollOn = true;
this.startDrag(false, this._x, scrollbarInitY, this._x, scrollbarInitY + scrollAreaHeight);
}
scrollbar.scrollbutton.onMouseUp = function() {
if (scrollOn) {
scrollOn = false;
this.stopDrag();
if (!scrollbar.scrollbutton.hitTest(_xmouse, _ymouse)) {
scrollbar.scrollbutton.gotoAndPlay("out");
}
}
}
scrollbar.scrollbutton.onEnterFrame = function() {
if (scrollOn) {
mainTargetY = mainInitY-(main._height-Stage.height)*(scrollbar.scrollbutton._y - scrollbarInitY)/scrollAreaHeight;
} else {
scrollbarTargetY = -(main._y - mainInitY)*scrollAreaHeight/(main._height - Stage.height) + scrollbarInitY;
if (Math.abs(scrollbar.scrollbutton._y - scrollbarTargetY) > 0.2) {
scrollbar.scrollbutton._y += (scrollbarTargetY - scrollbar.scrollbutton._y)/2;
}
}
if (Math.abs(main._y - mainTargetY) > 0.2) {
//this is where we calculate the blur distance
mainOldY = main._y;
main._y += Math.ceil((mainTargetY - main._y)/2);
mainMovement = mainOldY - main._y;
blur.blurY = Math.floor(Math.abs(mainMovement));
main.filters = [blur];
}
}
Stage.align = "T";
Stage.scaleMode = "noScale";
resizer = new Object();
resizer.onResize = function () {
scrollbar._x = Stage.width-scrollbar._width;
scrollAreaHeight = Stage.height - scrollbarInitY*2 - scrollbar.scrollbutton._height;
}
Stage.addListener(resizer);
resizer.onResize();
// originale tolto da me scrollbar._x = Math.ceil((Stage.width - initStageWidth)/2 + initStageWidth - scrollbar._width);