3 Replies Latest reply on Jun 26, 2008 1:32 PM by clbeech

    movement of object with action script

    sameeer767
      Hi,

      Im kinda new to action script so I have a very simple question. I wanted to move object (lines) from one point to another with the help of action script. also these lines should duplicate and change their thickness and their transparencies (alpha values) while they move. Please help.

      Thanks In Advance.
        • 1. Re: movement of object with action script
          clbeech Level 3
          well there are a variety of ways to do this - it depends on the use. you can move items using the Tween class - or using a onEnterFrame loop or Interval to update the x/y position of the item, this could also be achieved using the drawing API and literally redrawing the lines in a new position on each iteration. As for duplication, that can be handled by a loop, that 'drops' a new instance of the line symbol from the library, you would want to do it this way i think considering the following - I'm assuming here that you're looking for a 'trailing' effect and would want the lines to 'fade' out after a certain amount of time. also 'how' would the motion be initiated? does it just animate on it's own, or will it be based on user input, like the mouse position/movement - or key controls like the arrow keys?
          • 2. Re: movement of object with action script
            sameeer767 Level 1
            Hey Thanks a lot for your help. I want to initiate the motion on its own.Not a mouse position/movement. Actually its a background of my home page. I wanted to move different vertical lines moving across the page. I know its quite easy with tweening. but I want to use action script which can duplicate a single horizontal bar and can move from one one point to another, say from left to right and vice versa. can you help me with that? thanks again.
            • 3. Re: movement of object with action script
              clbeech Level 3
              well it's ease enough to 'move' the item using the Tween class - like this: