SWiSHzone.com Support Forums: Resizing Window - SWiSHzone.com Support Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Resizing Window

#1 User is offline   mario 

  • Advanced Member
  • PipPipPip
  • Group: New Members
  • Posts: 64
  • Joined: 04-August 03

Posted 02 September 2003 - 12:37 AM

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
Share your knowledge !!
0

#2 User is offline   Stuart Wilson 

  • Advanced Member
  • PipPipPip
  • Group: New Members
  • Posts: 864
  • Joined: --

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:

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.
0

#3 User is offline   mario 

  • Advanced Member
  • PipPipPip
  • Group: New Members
  • Posts: 64
  • Joined: 04-August 03

Posted 02 September 2003 - 05:26 PM

Hi Stu:
:D , 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
Share your knowledge !!
0

#4 User is offline   Stuart Wilson 

  • Advanced Member
  • PipPipPip
  • Group: New Members
  • Posts: 864
  • Joined: --

Posted 02 September 2003 - 08:52 PM

it should be, but I'm not sure when.

edit: confirmation - fixed for next beta
0

#5 User is offline   mario 

  • Advanced Member
  • PipPipPip
  • Group: New Members
  • Posts: 64
  • Joined: 04-August 03

Posted 04 September 2003 - 06:49 PM

Hi:
Fine !!
Thanks.
Share your knowledge !!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users