>>Are there other ways to interrupt repeat loops?
>
>exit repeat. You can exit when you reach a number, when a condition becomes
>true (or not true).
>
Your true  = 1 and false = 0 ?
Something like this?


     property  pFlag

  on StartMovie
  pFlag = 0
end


on enterFrame  me
if pFlag = 0  then

--do what I want here once only

end if

pFlag = 1

end


Are there any  other numbers that I can use, besides true/false?

>
>You have a series of pictures you want to scroll across the screen. I think
>you want to initiate the scroll on some action--let's say a button click.
>You want to be able to interrupt it with a mouse down.
>
>So, you need two basic scripts. One is a behavior to attach to the button.
>The other is a behavior to attach to each of the scrolling sprites.
>
>The button behavior should do this:
>
>When it is clicked, it sends a message to all the scrolling sprites telling
>them to get going.
>
>The sprite behavior should do this:
>
>When it receives a message from the button, it scrolls a certain number of
>pixels left or right. This may take it off screen (left?) or on screen
>(from the right?)
>
>Does that summarize what you want your code to do?

Yes. On hindsight, however , a mouse down may not be such a good idea.

And you helped me  by giving me the commands �Send Sprites and  �Send All 
Sprites�.

I�m grateful.

However, there are several ways to do things, I believe. I�m trying to 
figure it how to do it . You have told me that I do need to write my own 
code, and then in debugging the rubbish I write, hopefully I learn how to 
write better code.

Please allow me to this.


>I can, however, spot code errors and tell that it's probably *not* what you 
>want to do.


Thank you. I appreciate that � very much.


>>I'm still trying to figure out how to redo it.  I gathered from what you
>>have written that it is not advisable to have a loop within a loop
>
>Actually, I said it depends on the situation. You can use nested loops to 
>good effect in the right situation.
>

Sorry, you did say that plus the inefficiency of the code that I had 
written.


>If you follow the logic there, you're getting one item, paying for it, 
>taking out to the car, then going back into the store for another. It would 
>be much more efficient to do this:
>
>repeat with store = 1 to 10
>   goToStore
>   repeat with items = 1 to 5
>     getItem
>   end repeat
>   payForItem
>   takeToCar
>end repeat
>
>Do you see how much more efficient that is?

I�m trying to.


>>If you do not follow it, do you think I will be able to do so?
>
>You *have* to if you're going to succeed as a programmer. Algorithm + data 
>= code. You have to understand the problem and figure out the solution. We 
>can help you with the syntax, but the other end is your job.



So, it doesn�t matter if no one else understands my code, as long as I 
myself can understand it?



>It's hard to generalize. Repeat loops do hog the cpu, but there are times 
>when you do want to use them. If you loop on the exitFrame handler, then 
>your loop executes at the movie's frame rate. Sometimes that's what you 
>want, sometimes not.

If I ask you why, you won�t become frustrated?



>>At the rate I'm going, it's going to take me 10,000 light years?
>
>No :-)
>
>You're catching on.
>
>It only took Armstrong, Collins, and Aldrin 3 days to get to the moon. But 
>they spent 5 years preparing.


In your opinion, how long a preparation time do I require?


May I also ask :

1. In using the getPropertyDescriptionList, I need to keep track of all
the sprites I animate?

2. You used the getPropertyDescriptionList  solely for the purpose of 
setting the distance to move?

3. When I use the property list, I have to concatenate strings?


Thanks very much.  I apologize if I have offended you in any way.

Genevieve


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


[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