Hi:
I have a problem with some old flash code for resizing window.
You have a simple window and a button to resize this window (on Drag or OnRelease).
Take a look the example :
RWindow. The button code is:
on (press) {
mini = true;
}
on (release, releaseOutside) {
mini = false;
}
----------------------------------------------------------
and the movie window code is:
onClipEvent (load) {
mini = 0;
}
onClipEvent (mouseDown) {
CpX = _root._xmouse;
CpY = _root._ymouse;
DifX = this._width-(CpX-this._x);
DifY = this._height-(CpY-this._y);
}
onClipEvent (enterFrame) {
if (mini) {
posx = Math.floor(_root._xmouse);
posy = Math.floor(_root._ymouse);
Wini = Math.floor(this._x);
Hini = Math.floor(this._y);
this._width = (posx-Wini)+DifX;
this._height = (posy-Hini)+DifY;
}
}
----------------------------------------------------------------------------
I´ve tried to translate this example on SwishMax, but doesen´t work, have you any idea how I can do?
Maybe Math.floor don´t work on SMax?
Thanks
Page 1 of 1
Resizing Window
#2
Posted 02 September 2003 - 02:06 AM
mario
I posted a bug on this last week, currently _width and _height for any object that uses them is read only (even tho some of them are read/write in Flash player) and they were not being compiled into the script.
use this format as a workaround:
so in your code near the bottom
should change to:
hope that helps.
I posted a bug on this last week, currently _width and _height for any object that uses them is read only (even tho some of them are read/write in Flash player) and they were not being compiled into the script.
use this format as a workaround:
setProperty(object , _width , myNewWidth);
so in your code near the bottom
this._width = (posx-Wini)+DifX; this._height = (posy-Hini)+DifY;
should change to:
setProperty(this , _width , posx-Wini+DifX); setProperty(this , _height , posy-Hini+DifY);
hope that helps.
#3
Posted 02 September 2003 - 05:26 PM
Hi Stu:
, you ´re a SwishScript master.
Thanks, now it works, just swiched
setProperty(this , _width , posx-Wini+DifX);
setProperty(this , _height , posy-Hini+DifY);
instead of:
this._width = (posx-Wini)+DifX;
this._height = (posy-Hini)+DifY;
A question, this will be fixed, on the next releases?
Cheers, mario
Thanks, now it works, just swiched
setProperty(this , _width , posx-Wini+DifX);
setProperty(this , _height , posy-Hini+DifY);
instead of:
this._width = (posx-Wini)+DifX;
this._height = (posy-Hini)+DifY;
A question, this will be fixed, on the next releases?
Cheers, mario
Share your knowledge !!
#4
Posted 02 September 2003 - 08:52 PM
it should be, but I'm not sure when.
edit: confirmation - fixed for next beta
edit: confirmation - fixed for next beta
Share this topic:
Page 1 of 1

Help










