vi spiego nello stage principale ho inserito questo codice:
Codice PHP:
_root.bkg.w = _root.bkg._width;
_root.bkg.h = _root.bkg._height;
myResize = new Object();
function Window()
{
var CDim = _root.bkg.w / _root.bkg.h;
var SDim = Stage.width / Stage.height;
if (SDim < CDim)
{
_root.bkg._height = Stage.height;
_root.bkg._width = _root.bkg.w * Stage.height / _root.bkg.h;
} else {
_root.bkg._width = Stage.width;
_root.bkg._height = _root.bkg.h * Stage.width / _root.bkg.w;
}
_root.bkg._quality = "BEST";
};
myResize.onResize = function()
{
Window();
}
Stage.addListener(myResize);
Window();
bkg è un mc che contiene la texture è una img grande 1024 x 1280
dentro a bkg ho inserito una maschera mask_mc questa maschera è un cerchio che si deve aprire al centro dello stage.. ho inserito questo codice nella timeline di bkg
Codice PHP:
trace(Stage.width);
this.mask_mc._width = 30;
this.mask_mc._height = 30;
this.mask_mc._x = Stage.width / 2;
this.mask_mc._y = Stage.height / 2;
mask_mc.onEnterFrame =function() {
trace(mask_mc._height)
trace(mask_mc._width)
mask_mc._width = mask_mc._width + 45;
mask_mc._height = mask_mc._height + 45;
if ((mask_mc._width == Stage.width) || (mask_mc._height == Stage.height)) {
trace("ok");
delete this.onEnterFrame;
}
}
stop();
questo codice mi dovrebbe ingrandire la maschera fino a raggiungere la larghezza dello stage... lo script funziona più o meno ma non mi centra la maschera mask_mc
qualche aiutino?? :master: