ADC Home > Reference Library > Technical Q&As > Legacy Documents > Apple Applications >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

A Method for AMT to "remember" Changes Made on Screen


The Apple Media Tool and Apple Media Tool Programming Environment products have been discontinued. For more information check out: AMT/PE Discontinued.

Q: I'm working on a project that requires the user to make selections on Screen1, then travel to Screen2. But I need AMTPE to "remember" the selections the user made on Screen1. Upon returning to Screen1 from Screen2, the selections initially made on Screen1 must show, for example, that the user moved an object from the default coordinates(100,100) to (150,150). How do I store the new Object Coordinates and have the Object recall the new coordinates instead of the default coordinates when you return to this screen?

Screen1 code looks like this:

object MoveMe is MediaScroller
has
      MouseDown(theX, theY)
              do
                self.moveto(theX, theY);
              end;
 -- stuff here
with
       X is 100, Y is 100 --etc.
end;

When I leave Screen1, then return the object, MoveMe has returned to its initial Coordinates of x=100 and Y=100. Is there a way for AMT to "remember" changes made on a Screen?

A: After you use MoveTo to move your object from 100,100 to 150,150, add these lines:

Self.StartX := Self.X;
Self.StartY := Self.Y;

StartX and StartY determine where the object is initially drawn on the screen. Change them and it should behave the way you want when you return to the screen.

[Aug 01 1995]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.