Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-20-2003, 02:21 PM   #1
Registered User
Join Date: Oct 2003
Posts: 36
Default screen borders to stop draggable windows!

Err, need some help here... i'm working on my final year project and i've come across a problem! I have draggable mini windows on the stage, but how do i stop the sides from going out of the stage area???

For eg, i want the right-hand side of a draggable window to stop when i reach across the righ-hand side of the screen area, but it should still be abale to drag up or down or left...

My draggable windows are separate MCs. I have a feeling that i need to initialise some boundary codes on the _root (like left_wall = 0;, etc???). Any ideas?

Thanks, GK
gk26 is offline   Reply With Quote
Old 10-20-2003, 03:26 PM   #2
Senior Member
binkyboo's Avatar
Join Date: Mar 2002
Location: Madison, Wisconsin
Posts: 1,312
Send a message via MSN to binkyboo

ActionScript Code:
on (press) {     startDrag(this, false, leftCoordinates, topCoordinates, rightCoordinates, bottomCoordinates); }

Just fill in the proper coordinates. You're constraining the draggable item to a rectangle. In your case the stage.
binkyboo is offline   Reply With Quote
Old 10-21-2003, 09:36 AM   #3
Registered User
Join Date: Oct 2003
Posts: 36
Default nice one!

Cheers! I going to try it so if it doesn't work i'll get back to you!...
gk26 is offline   Reply With Quote
Old 06-09-2004, 12:59 PM   #4
I Love Stockholm
Join Date: Oct 2003
Posts: 206


just wondering how can i get the exact bottomedge position and rightedge position.

The stage is 800 x 600 and i have this.

ActionScript Code:
on (press) {   startDrag (this, false, 0, 0, 800, 600); }

somehow the right and bottom position aint stickin to the edges.
Skinner is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 10:27 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.