Ciao!
Avrei una domanda un po' strana che non riesco a risolvere...
Ho fatto una gallery dinamica che con il rollOver mi fa scorrere le immagini.
Se uso una risoluzione 1024X768 non ho problemi...
ma se metto la risoluzione a 1280X1024 appena faccio il rollOver mi impazzisce.
L'action che ho usato è la seguente:
this._lockroot = true;
//caricamento prima immagina grande
loadMovie("immagini/grandi/imm1.jpg", "mcLargePhoto");
//txtTitle.text = "Ciao";
//txtDesc.text = "Didascalia";
//-------------------------------
import mx.transitions.*;
var nextX = 0;
var xmlPhotos:XML = new XML();
var initThumb:Object = new Object();
xmlPhotos.onLoad = function() {
for (var i:Number = 0; i<xmlPhotos.firstChild.childNodes.length; i++) {
initThumb.photo = (xmlPhotos.firstChild.childNodes.attributes.photo);
initThumb.desc = (xmlPhotos.firstChild.childNodes.childNodes[0].firstChild.nodeValue);
makeAThumb(i);
nextX += 150;
}
setInterval(_root, "scroller", 50);
};
initThumb.onRollOver = function() {
effettoThumb = new Tween(this, "_alpha", none, 50, 100, .5, true);
};
initThumb.onRollOut = function() {
effettoThumb.yoyo();
};
initThumb.onRelease = function() {
//txtTitle.text = this.photo;
//txtDesc.text = this.desc;
mcLargePhoto.loadMovie("immagini/grandi/"+this.photo+".jpg");
};
function makeAThumb(num) {
thumbName = "mcThumb"+num;
mcScroller.attachMovie("thumb", thumbName, num, initThumb);
mcScroller[thumbName].mcPhoto.loadMovie("immagini/thumbs/"+mcScroller[thumbName].photo+".jpg");
mcScroller[thumbName]._x = nextX;
mcScroller[thumbName]._y = 100;
mcScroller[thumbName]._alpha = 50;
}
function scroller() {
if (this._ymouse>mcScroller._y) {
var scrollSpeed = (this._xmouse-Stage.width/2)/10;
if (Math.abs(scrollSpeed)<1) {
scrollSpeed = 0;
}
mcScroller._x -= scrollSpeed;
if (mcScroller._x>0) {
mcScroller._x = 0;
} else if (mcScroller._x<Stage.width-mcScroller._width) {
mcScroller._x = Stage.width-mcScroller._width;
}
}
}
this.createEmptyMovieClip("mcScroller", this.getNextHighestDepth());
mcScroller._x = 0;
mcScroller._y = 200;//posizione scroller
xmlPhotos.ignoreWhite = true;
xmlPhotos.load("photos.xml");
Il tutto l'ho fatto seguendo un tutorial... ma non capisco perchè cambiando la risoluzione mi impazzisce. Dove dovrei modificare il codice?
Grazie a tutti in anticipo!
Avrei una domanda un po' strana che non riesco a risolvere...
Ho fatto una gallery dinamica che con il rollOver mi fa scorrere le immagini.
Se uso una risoluzione 1024X768 non ho problemi...
ma se metto la risoluzione a 1280X1024 appena faccio il rollOver mi impazzisce.
L'action che ho usato è la seguente:
this._lockroot = true;
//caricamento prima immagina grande
loadMovie("immagini/grandi/imm1.jpg", "mcLargePhoto");
//txtTitle.text = "Ciao";
//txtDesc.text = "Didascalia";
//-------------------------------
import mx.transitions.*;
var nextX = 0;
var xmlPhotos:XML = new XML();
var initThumb:Object = new Object();
xmlPhotos.onLoad = function() {
for (var i:Number = 0; i<xmlPhotos.firstChild.childNodes.length; i++) {
initThumb.photo = (xmlPhotos.firstChild.childNodes.attributes.photo);
initThumb.desc = (xmlPhotos.firstChild.childNodes.childNodes[0].firstChild.nodeValue);
makeAThumb(i);
nextX += 150;
}
setInterval(_root, "scroller", 50);
};
initThumb.onRollOver = function() {
effettoThumb = new Tween(this, "_alpha", none, 50, 100, .5, true);
};
initThumb.onRollOut = function() {
effettoThumb.yoyo();
};
initThumb.onRelease = function() {
//txtTitle.text = this.photo;
//txtDesc.text = this.desc;
mcLargePhoto.loadMovie("immagini/grandi/"+this.photo+".jpg");
};
function makeAThumb(num) {
thumbName = "mcThumb"+num;
mcScroller.attachMovie("thumb", thumbName, num, initThumb);
mcScroller[thumbName].mcPhoto.loadMovie("immagini/thumbs/"+mcScroller[thumbName].photo+".jpg");
mcScroller[thumbName]._x = nextX;
mcScroller[thumbName]._y = 100;
mcScroller[thumbName]._alpha = 50;
}
function scroller() {
if (this._ymouse>mcScroller._y) {
var scrollSpeed = (this._xmouse-Stage.width/2)/10;
if (Math.abs(scrollSpeed)<1) {
scrollSpeed = 0;
}
mcScroller._x -= scrollSpeed;
if (mcScroller._x>0) {
mcScroller._x = 0;
} else if (mcScroller._x<Stage.width-mcScroller._width) {
mcScroller._x = Stage.width-mcScroller._width;
}
}
}
this.createEmptyMovieClip("mcScroller", this.getNextHighestDepth());
mcScroller._x = 0;
mcScroller._y = 200;//posizione scroller
xmlPhotos.ignoreWhite = true;
xmlPhotos.load("photos.xml");
Il tutto l'ho fatto seguendo un tutorial... ma non capisco perchè cambiando la risoluzione mi impazzisce. Dove dovrei modificare il codice?
Grazie a tutti in anticipo!