ciao a tutti nel mio filmato principale carico all'interno della mia clip "vuota" un swf esterno che vorrei far scorrere sull'asse y attraverso cinque btn (button1_btn...) situati nel file principale.
Ho usato il seguente script ma non funge quando carico il filmato esterno!
_global.targetX = 108;
_global.targetY = 638;
initWindow();
_root.menu.menu.vuotamovie.gallery.onEnterFrame = moveCamera;
function initWindow() {
var c = 0;
for (i=1; i<7; i++) {
myClip = _root.menuinfo["clip"+i];
if (i%2>0) {
myClip._x = c*-299;
myClip._y = 0;
c++;
} else {
myClip._x = _root.gallery["clip"+(i-1)]._y;
myClip._y = 0;
}
}
}
function moveCamera() {
friction = 0.15;
distanceX = (targetX-this._x)*friction;
distanceY = (targetY-this._y)*friction;
this._x += distanceX;
this._y += distanceY;
}
function updateTargets(x, y) {
targetX = x;
targetY = y;
}
_root.menu.menu.vuotamovie.button1_btn.onRelease = function() {
updateTargets(108,150);
};
_root.menu.menu.vuotamovie.button2_btn.onRelease = function() {
updateTargets(108, 638);
};
_root.menu.menu.vuotamovie.button3_btn.onRelease = function() {
updateTargets(505, -1);
};
button4_btn.onRelease = function() {
updateTargets(539, -1);
};
};