>The purpose of using 'repeat while not the mouse Down' is so that a 
>mouseDown event would interrupt the repeat  loop.
>
>I mustn't do this?

No, that's fine. I just wasn't sure what you were doing.

>You mean write it like this:
>
>On MouseUp me
>repeat with myIndex = 1 to 100
>   setMoveAmt = setAt(gMoveAmt, myIndex)
>end repeat
>end

Is setAt a handler you wrote? If not, it behaves like the example you found 
in the Lingo dictionary. I don't think it's what you want here.

I'm not quite following the logic. Is this a handler for a behavior your 
are going to attach to your scrolling sprites? What are you going to do 
with the variable setMoveAmt? As your code is there, all it is doing is 
setting the value of setMoveAmt over and over, but again, I'm not sure what 
setAt does for you.

>I'm not trying to build a list, I'm trying to move sprites. Many times, I 
>have difficulty trying to create what I want. It's tough.

Programming's tough ^_^

Like I said, I'm not quite following your logic. Do you have a clear 
picture of the steps you want to program? I'm asking because it's essential 
that you be clear in your mind how you are going to do something--get your 
algorithm clear, then the syntax will follow.


>Is this the way to use the getAt function?
>
>On MouseUp me
>Repeat with myIndex = 1 to 100
>gMoveAmt .getAt( )
>end repeat
>end

No, not really. You have to have a list to retrieve the values from.


>In Lingo in a Nutshell,  Pg 331, Bruce Epstein has thoroughly confused me:
>
>'Property variables  are used instead of  global variables. Properties 
>can  contain a different value for each instance of the object (that is, 
>each timer). If we used global, multiple timers would trample the values 
>held in the globals.'

Bruce is talking about one specific application of properties, in a timer. 
You use properties when you want to encapsulate something--for example, a 
particular sprite's screen position. That would be specific for each 
sprite. Make it a property in a behavior attached to the sprite, and each 
sprite keeps track of its own position. That's the essence of object 
oriented programming.

Globals are used for data that you want to share globally, among all objects.

>Can I safely say that a property is a characteristic of an object and in 
>your example  above MyLocH  is the property?

Exactly!

>When is it used to excess?

When they become confusing. Sorry, but that's the best I can do. There is 
no set rule. I have an almost pure OOP program that has 30-40 global 
variables. Things like the machine speed, some paths that I use, names of 
objects, etc. Some OOP purists would be horrified at that many globals, but 
I've seen programs with 300 or more globals. That's too much.

>on getPropertyDescriptionList
>  if the currentSpriteNum = 0 then exit
>
>  return \
>[ \
>#pMoveAmt: \
>[ \
>  #comment: "Distance to move? ", \
>  #format:  #integer, \
>  #default:  5 \
>] \
>]
>end getPropertyDescriptionList
>
>I'm sorry, but I don't think  you initialized variables in the example above?

It's initialized, but you can't see it. Remember, 
getPropertyDescriptionList is a very special handler in Director. Notice 
the line that says #default: 5? If you don't change that number when you 
attach the behavior, it's initialized to 5. Otherwise, it's initialized to 
the new value you type in.

>When I use the getPropertyDescriptionList handler, am I going into Object 
>Oriented programming?

You're heading there. When you get the hang of it, you'll find OOP much 
easier than linear programming.

Cordially,

Kerry Thompson


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to