Hello everyone,
I am trying to set the location of 2 substacks of a main stack to move at the same time in proportionate locations . So if a user clicks and drags a stack to the left (200 pixels for example) the other stack would move 200 pixels to the left ?
Thanks,
Move 2 stacks simultaneously on a screen ??
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 7
- Joined: Thu Mar 05, 2009 9:24 pm
Move 2 stacks simultaneously on a screen ??
Tareq Daher (Tawaiha),
Instructional Technology, Doctoral student , UNL
Instructional Technology, Doctoral student , UNL
Re: Move 2 stacks simultaneously on a screen ??
Hi Tareq,
you can use/script the "movestack" message!
This will be sent continuously when the user moves/drags a stack.
Just put the code into the stack scripts of both stacks that should be moved together.
Something like -> Stack A:
You get the picture
Best
Klaus
you can use/script the "movestack" message!
This will be sent continuously when the user moves/drags a stack.
Just put the code into the stack scripts of both stacks that should be moved together.
Something like -> Stack A:
Code: Select all
on movestack
put the loc of this stack into locA
put the loc of stack "B" into locB ## the OTHER stack
## do the necessary maths to calculate the loc of stack B in relation to the loc of stack A
## set the loc of stack "B" to the_computed_values
end movestack
Best
Klaus
Re: Move 2 stacks simultaneously on a screen ??
Tareq,
Keep in mind that such solutions are very slow and ugly. You'd better re-think your interface.
Best,
Mark
Keep in mind that such solutions are very slow and ugly. You'd better re-think your interface.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 9824
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Move 2 stacks simultaneously on a screen ??
Before v3 they used to be ugly because the moveStack message was only sent when the move was completed on OS X, while on Win the message was sent in real time.
Now that the moveStack message is sent in real time on all platforms, these auxiliary stacks appear to move rather gracefully in synch with the one being dragged, at least here on my modest 2.1GHz Mac.
Now that the moveStack message is sent in real time on all platforms, these auxiliary stacks appear to move rather gracefully in synch with the one being dragged, at least here on my modest 2.1GHz Mac.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Move 2 stacks simultaneously on a screen ??
I think it still looks ugly and slow if you do something like that. Don't do it. Re-think your interface.
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode