AllExperts > Experts 
Search      

Macromedia Director

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Macromedia Director Answers
Question Library

Ask a question about Macromedia Director
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Arvind
Expertise
I can answer questions on creating simple games using Director 8 and Director 8.5. Please no questions on 3D aspects. Lingo questions welcomed.

Experience
I am at University and have completed an HND in Computing and Mathematical Sciences, and a BSc in Multimedia Technology. Below is my dissertation which is on Interactive Gaming: -

G@ME-i 2
 
   

You are here:  Experts > Computing/Technology > Web Design > Macromedia Director > Scroller

Topic: Macromedia Director



Expert: Arvind
Date: 4/21/2004
Subject: Scroller

Question
Hi,

heres the source code:

on mouseUp me
 repeat with countSP = 1 to 5
   sprite(countSP).locH = sprite(countSP).locH - 8
   if sprite(5).locH < sprite(6).locH + 35 then
     sprite(5).locH = sprite(6).locH + 35
end if
end repeat
end

This code appears in one of the 'arrows' (sprite 5) to slide the pictures to the left.
So sprites 1 to 4 are pictures.
So when the last picture gets to the point where the arrow is then I want all the pictures to stop moving, meaning there are no more pictures to slide.

Thanks.

Answer
Hi Milan,
        I've had a look at your code and only come up with one possible answer.  What you could do is this: -

Add an extra sprite - a verticle line would do - at the point where the arrow is (this is the point where u want the pictures to stop moving).
Then add some more code to your on mouseUp me: -

--
 if sprite X intersects Y then
   alert "no more pictures"
   pause
 end if
--

Sprite X would be your extra sprite that you added, and sprite Y would be your last picture.

You can also miss out the alert function altogether, so the movie will just pause when the sprites have intersected.

I hope ive been of assistance to you!

From Arvind


Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.