Hyper Card HELP!

If I have a card that is bigger than my monitor, what would the code be to keep the card centered on a moving button???
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

moe10Author Commented:
Adjusted points to 300
Alex CuryloCommented:
It depends on how the button is moving, but the general idea is to track the button's location and move the window reciprocally.

Before the button moves, get the top and left coordinates relative to the window, something like

get the top of cd btn "Mover"
get the left of cd btn "Mover"

move the button, and get them again. Find the differences and apply their reverses to the loc of window "MovingWindow" or whatever by something like.

set the loc of "MovingWindow" to <new loc>

Thus if the window is at 100,100 and the button moves by 5, you'd move the window to 95,100, leaving the button at the same place visually


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
moe10Author Commented:
I tryed doing this:

on idle
put loc of card button mover into wind
set loc of Window to wind
end idle

"mover" is the moving button and "wind" is a container. But in your answer you did not say what the term is for the Window.
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Alex CuryloCommented:
It's just the keyword "window" followed by the name of the window, I believe. That line I posted was wrong, it should be

set the loc of window "MovingWindow" to <new loc>

assuming that "MovingWindow" is the name of the, well, moving window.

I think. It's been several years since I actually did any HyperTalk programming :)
moe10Author Commented:
When I put that code in, it moved the inter window so it would move out of my screen. What I wanted to do is when you have a card that is bigger than your screen you can have a scroll box in the corner of your screen that lets you scoll to the bottom of your card. What I want to do is when the button moves your card will automatically scroll down for you.

      sorry about the confusion.
Alex CuryloCommented:
Oh, you mean you want a control that acts like a scrollbar? Well, here's a generic window scrolling outline:

  put the scroll of the card window into cwscroll
  put item 1 of cwscroll into xscroll
  put item 2 of cwscroll into yscroll
  -- Here, change xscroll (horizontal position) and yscroll (vertical position)
  -- in whatever way makes sense for your control
  set the scroll of the card window to xscroll&","&yscroll

I'm not quite sure what you mean by "button moves". If you mean "clicked on", then you'd just add some small constant. If you mean "the position of the button changes in some fashion", then you'd track the changes and add them to xscroll and/or yscroll as appropriate.
moe10Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.