Here is one fairly simple method of dragging a window around on the screen.
1. Set up window with initial dimensions of your choice and resize the window to those dimensions:
aini:=100 --Depth bini:=300 --Width ResizeWindow(bini, aini) -- width, depth
2. Place a hotspot over the object or area you wish to act as the dragging "handle" (for example, a window's title bar).
3. This hotspot (set to single click) activates a map icon which contains three icons, as follows:
a) A calc that captures the X and Y coordinates where the single click occurs
xini:=ClickX yini:=ClickY
b) A decision icon that repeats sequentially until ~MouseDown
c) A calc icon off the decision icon. This needs contain only a single line of code:
MoveWindow(WindowTop-(yini-CursorY)-38, WindowLeft-(xini-CursorX))
That's it. The constant "38" in that final line of code is a "jump factor." Without it, the window will jump 38 pixels vertically when you initially click inside the hotspot. What's more, this behavior is different depending on whether the file is packaged or not. So it's probably better to use a custom variable instead of a constant and control it with something like
if FileType(FileLocation^FileName)=2 then jFac:=38 else jFac:=0
Frankly I don't understand this jumping effect. If anyone has any insight into it, I'd love to see an explanation. But the method does work. If anyone would like an example file, just let me know.
George Hawrysch
On Mon, 9 Apr 2001, Danny Engelman wrote:
> Been struggling with this way to long. > > Does anyone have code to drag the presentation around the screen? > So if the user clicks on a graphic inside the presentation and drag the mouse > the whole presentation window has to move (MoveWindow) > > > -- > Danny Engelman <Danny@FlashFactory.nl> > eLearning developer > FlashFactory.NL > > -- > The AWARE List > http://www.e-media.nl/aware/index.html > > Search the Archives > http://www.e-media.nl/aware/search.html > > Netiquette: > - Use descriptive subject fields > - Use subject prefixes (A5 , A5Mac , A5Web , KO , UCD , OT) > > > >
-- The AWARE List http://www.e-media.nl/aware/index.html
Search the Archives http://www.e-media.nl/aware/search.html
Netiquette: - Use descriptive subject fields - Use subject prefixes (A5 , A5Mac , A5Web , KO , UCD , OT)