>>You usually wouldn't have a startMovie handler in a behavior, but you
>>could use beginSprite:
>
>Why is that? Aren't they all events?
Yes, they're both events, but we usually use beginSprite for sprite
initialization, and beginMovie for more global stuff. For one thing,
beginSprite happens before startMovie (surprised? I was.) It makes sense to
get all your sprites initialized before the movie begins.
>Then what did you mean when you wrote this line in the earlier post:
>
>>>exit repeat. You can exit when you reach a number, when a condition
>>>becomes
>true (or not true).
There are a couple basic ways to exit a loop. One is when a condition
becomes true (or false), and the other is when a counter reaches a certain
number. So, a repeat could be like this:
i = 1
repeat while i < 100
i = i + 1
end repeat
or, a less efficient, but equivalent:
i = 1
hellFreezesOver = FALSE
repeat until hellFreezesOver
i = i + 1
if i = the maxInt then hellFreezesOver = TRUE
end repeat
or, you could do something like this:
rightKey = FALSE
repeat while NOT rightKey
if the keyCode = 27 then
rightKey = TRUE
end if
end repeat
>Sorry, I thought that men of senior age do no ski?
Oh, I ski, much to my doctor's dismay. Not well, but I ski. I fall down a
lot, I laugh, I get back up and ski some more. It's a lot like programming.
>>I would say to loop on frame >events when you want to (or don't mind
>>being) tied to Director's frame rate.
>
>That means being very slow?
Not necessarily. If you're going to see Harry Potter, like I am, you'll be
seeing 24 frames per second. That's more than enough for the eye to
perceive continuous motion (the threshold is about 20).
Fast or slow is relative. Some things you need to do as quickly as
possible. Some things are better done at a more stately pace.
This is a recurrent theme in our conversations. You are looking for yes/no
answers, and there often are no yes/no answers in programming. More often,
it depends on what fits.
>I think the code should be written like this:
>
>repeat with i = 1 to 100
>--what should be the command here? GoTo? I am not sure.
>repeat with sprNum = 1 to 20
>end repeat
>set the LocH of sprite sprNum = (the LocH of sprite sprNum)-i
>end repeat
>end
I think I'm going to throw that one back at you. The critical point is,
where do you set the locH of the sprite? Did you run this through the
debugger? Did you analyze the logic?
I don't mean to be unhelpful, or rude, but you won't develop as a
programmer until you figure these things out for yourself. I'm going on
vacation next week, and you'll be on your own then. And, for most of your
programming career, you will need to figure things out.
>Is there a limit to the number of properties to be set? Or can Director
>handle a limitless number of properties?
I'm not aware of a limit. If there is one, it is likely to be millions, or
billions--more than the memory of a typical computer can handle.
>What advanced exercise is that?
I meant the writing of behaviors using getPropertyDescriptionList. You have
to understand a number of things about Director and Lingo when you tackle a
getPropertyDescriptionList. That doesn't mean you shouldn't try. It just
means you should be prepared for some frustrations.
>accessible only by the initiate'
>
>Are you by chance one of them?
Hardly. I'm just a journeyman programmer. There are lots of people on the
list who know Director far better than I.
>When I create property lists, I am defining properties for each item. I an
>thus storing values for each item? So if I use a whole range of values, I
>need to 'string' them?
I *think* I understand what you're asking. I'm not being intentionally
obtuse, but 'string' can have two meanings. One is to convert something to
a string--e.g., string(10) returns the string "10" instead of the number
10. That may not seem particularly important, but it is.
What I think you are asking, though, is if you need to set up a series of
property declarations in your getPropertyDescriptionList handler. If that's
your question, yes, if you intend to have some properties pre-initialized,
you do it through a list of property lists. You might consider that
stringing them together.
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!]