Question:

Actionscript object movement?

by  |  earlier

0 LIKES UnLike

i's using Flash mx. I currently have two movie clip symbols onscreen and they are both moving to the right. I am using the following code, repeated, for both symbols:

splicer1.dx=5;

splicer1.onEnterFrame=function(){

splicer1.move();

splicer1.checkBoundaries();

}

splicer1.move=function(){

splicer1._x += splicer.dx;

}

splicer1.checkBoundaries=function(){

if (splicer1._x>stage.width){

splicer1._x=0;

}

if (splicer1._x<0){

splicer1._x=stage.width;

}

}

i want one of the symbols to move to the left. what do i change in the code to do so?

the symbol that i want to move left is "splicer1"

 Tags:

   Report

1 ANSWERS


  1. Instead of adding to _x, you want to subtract:

    splicer1.move=function(){

    splicer1._x -= splicer.dx;

    }

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.