Solved

Multiple Moving Objects

Posted on 1998-11-07
4
194 Views
Last Modified: 2011-10-03
How can you have two(2) objects or layers in motion concurrently?  I can make one layer (text and images) move and reposition on a screen but am unable to develop a script to allow for two(2) or more to move.
0
Comment
Question by:rcarlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 1273728
Javascript has just one "thread". So you'll have to move the layers within the same thread. So you can't really do more things simultaneously. You'll have to make them happen shortly after each other.

I don't know how you move a layer, but if you want to simulate a motion, you probably use a function which, with a setTimeOut calls itself.

If you generalize that function (make the layer and some other things depend on parameters) you could use it to move the other layer too.

For a functionality like this, look at:
http://utopia.knoware.nl/users/sybev/zt/ztnet/bedenken.htm

It is in Dutch. The thing is: if you push the "start" buttons below the text fields, each of the textfields will start displaying different words each second. For that they all use the same function that calls itself with a setTimeOut (called with different parameters).

It looks like each has its own "thread".

Hope this gives you some idea how to continue. If you want a more specific help, you'll have to post some code.




0
 
LVL 10

Accepted Solution

by:
kollegov earned 50 total points
ID: 1273729
I have a script which can moves several layers independently
The example is at my pages:
http://www.geocities.com/siliconvalley/lakes/8620/
Don't hesitste to bother me with qustions if you will need help
with it. You will find e-mail form in geoguide banner at the top
of the page.
0
 
LVL 10

Expert Comment

by:kollegov
ID: 1273730
Just curious, does my script help?
0
 
LVL 10

Expert Comment

by:kollegov
ID: 1273731
Just curious, does my script help?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question