Originariamente inviato da frifrini
mouseListener = new Object ()
mouseListener.onMouseWhell (delta) {
text_mc._y += delta*5;
}
Mouse.AddListener (mouseLIstener);
Insomma il codice della guida in linea...
beh ... aggiornati la guida perche' onMouseWhell non esiste, casomai e' onMouseWheel e AddListener neanche, casomai e' addListener ( case sensitive ... )
comunque prova cosi'
codice:
var mouseListener:Object = new Object();
mouseListener.onMouseWheel = function(delta:Number) {
if(text_mc.maxScroll == undefined) {
text_mc.minScroll = text_mc.maxScroll = text_mc._y;
text_mc.maxScroll += text_mc._height;
}
var newPosition:Number = new Number(delta * 5);
if(newPosition < 0 && (text_mc._y + newPosition) < -text_mc.maxScroll)
text_mc._y = -text_mc.maxScroll;
else if(newPosition > 0 && (text_mc._y + newPosition) > text_mc.minScroll)
text_mc._y = text_mc.minScroll;
else
text_mc._y += newPosition;
};
Mouse.addListener(mouseListener);