Salve, ho preso e modificato questo codice per creare una slide di immagini lette da xml.
Il codice va in loop , premendo il pulasnte avanti o indietro il loop si ferma e scorro le immagini con i pulsanti.
Volevo che oltre a questo passando con il mouse sopra le immagini il loop si fermasse (e questo l'ho fatto) mentre quando faccio il rollout riprendesse a scorrere (ovviamente se premo i pulsanti questo non avviene più) Il problema è che quando faccio il rollout le immagini riprendono ma non mi trova piu la fine delle foto, praticamente premendo i pulsanti il movieclip va avantoi anche se lfoto sono finite.

Posto il codice

var easing = true;
var auto = true;
var mouseWheel = true;
var mouseCoord = false;
var barVisual = true;
var space = 0;
var path = "xml/collezione.xml";

loader = new MovieClipLoader();
loader.addListener(this);

//++++++++++++xml parse function+++++++++++++++++++++
var myxml = new XML();
myxml.ignoreWhite = true;
myxml.onLoad = function(success) {
var item = this.firstChild.childNodes;
if (success) {
for (var i:Number = 0; i<item.length; i++) {
var temp_mc = contentMain.attachMovie("item", "item"+i, i);
temp_mc._x += i*(temp_mc._width+space);
temp_mc.thumb = item[i].firstChild.firstChild.nodeValue;
loader.loadClip(temp_mc.thumb, temp_mc.item_thumb);

}
scrolling(easing, auto, mouseWheel, mouseCoord, barVisual);
} else {
trace("error");
}
};
myxml.load(path);

//++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++
//scroll function
//++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++
contentMain.createEmptyMovieClip("back_mc", this.getNextHighestDepth());
contentMain.setMask(maskedView);
function scrolling(easing) {
//you can modify scroll speed.
var moveSpeed = 10;
//you can modify easing speed.
var easingSpeed = 10;
var scrollHeight = scrollbg._width;
//you donnot need modify the fellowing code.if you are a AS coder you can do .
var scrollable = contentMain._width-maskedView._width+(maskedView._width-scrollbg._width+space);
var top_scroll = contentMain._x;
var left = scrollbg._x+1;
var top = scrollbg._y+2;
var right = scrollbg._x+scrollbg._width-dragger._width-1;
var bottom = scrollbg._y+2;
if (scrollable<0) {
dragger._visible = false;
btnup._alpha = 0;
btndown._alpha = 0;
scrollbg._alpha = 0;
btnup.enabled = false;
btndown.enabled = false;
return;
}
//update scroll content.
function updateContentPos() {
var percent_scrolled = (dragger._x-btnup._x-btnup._width)/(scrollHeight-dragger._width);
contentMain.newX = Math.round(top_scroll-(scrollable*percent_scrolled));

}
contentMain.onEnterFrame = function() {
if (!easing || easing == undefined) {
this._x = this.newX;
} else {
this._x += (this.newX-this._x)/easingSpeed;
}
};
//dragger function
dragger.onPress = function() {
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
updateContentPos();
};
};
dragger.onRelease = dragger.onReleaseOutside=function () {
stopDrag();
delete this.onEnterFrame;
};
btnup.onPress = function() {
this.onEnterFrame = function() {
dragger._x = Math.max(left, dragger._x-moveSpeed);
if (auto == true) {
onEnterFrame = function () {
auto=false;



};
}
updateContentPos();

};
};
btnup.onRelease = function() {
delete this.onEnterFrame;
};

btndown.onPress = function() {
this.onEnterFrame = function() {
dragger._x = Math.min(right, dragger._x+moveSpeed);
scrollable = contentMain._width-maskedView._width+(maskedView._width-scrollbg._width+space);

onEnterFrame = function () {
auto=false;
velina._visible=0


};



updateContentPos();

};
};
btndown.onRelease = function() {

delete this.onEnterFrame;

};
updateContentPos();
//++++++++++++++++++++++++++++++++++++++++++
//AutoScroll code
if (auto == true) {
onEnterFrame = function () {
if (dragger._x<right) {
dragger._x = dragger._x+0.3;
updateContentPos();
} else {
dragger._x = left;
}
};
}
//+++++++++++++++++++++++++++++++++++++++++++
//mouseWheel code
if (mouseWheel == true) {
var mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
if (dragger._x<right) {
dragger._x -= delta+3;
updateContentPos();
} else {
dragger._x = right-5;
}
if (dragger._x>left) {
dragger._x -= delta;
updateContentPos();
} else {
dragger._x = left+1;
}
};
Mouse.addListener(mouseListener);
}
//++++++++++++++++++++++++++++++++++++++++++++
//Mouse coordinate
if (mouseCoord == true) {
maskedView.onEnterFrame = function() {
//trace(this.hitTest(_xmouse, _ymouse, false));
if (this.hitTest(_xmouse, _ymouse, false)) {
dragger._x = _xmouse;
updateContentPos();
if (dragger._x>right) {
dragger._x = right;
updateContentPos();
}
if (dragger._x<left) {
dragger._x = left;
updateContentPos();
}
}
};
}
//+++++++++++++++++++++++++++++++++++++++++++
//scroll bar hid setup
if (barVisual == false) {
dragger._visible = false;
btnup._alpha = 0;
btndown._alpha = 0;
scrollbg._alpha = 0;
btnup.enabled = false;
btndown.enabled = false;
}

}
//++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++
//preloading function
//++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++

function onLoadStart(target){
target._parent.enabled = false;
target._parent.content_background._visible = false;
target._parent.item_content_mc._visible = false;

}

function onLoadProgress(target, bytes_loaded, bytes_total) {
target.stop();
target._visible = false;
target._parent.preloader_mc.value = bytes_loaded/bytes_total;

}

function onLoadComplete(target) {
trace("complete");
// show content
target.play();
target._visible = true;
target.alphaTo(100,1,'easeoutExpo');
target._parent.preloader_mc.stop();
target._parent.preloader_mc._visible = 0;
target._parent.play();
target._parent.enabled = true;
target._parent.content_background._visible = true;
target._parent.item_content_mc._visible = true;

}


// error function
function onLoadError(target, error_code) {
preloader_mc.removeMovieClip();
trace(error_code);
}






MENTRE PER IL ROLLOVER E ROLLOUT

velina.useHandCursor = false;
velina.onRollOver = function() {
onEnterFrame = function () {
auto=false;
}

};

velina.onRollOut = function() {
onEnterFrame = function () {
scrolling(easing)


if (dragger._x<right) {
dragger._x = dragger._x+0.3;
updateContentPos();
} else {
dragger._x = left;
}
};
}