I have a movieClip that changes position using code. How can control its speed also?

This is the code that goes on the movieClip:

onClipEvent (enterFrame) {
 _x = random(551);
 _alpha = random(101);
 }

I just need to control its "position changing" speed, by changing a single value/variable.
I need the extra code!


Thanks
alex nexus
alexnexusAsked:
Who is Participating?
 
FLAASHERConnect With a Mentor Commented:
use this code in the frist frame of ur movie


function flaasher() {
      myMC._x = random(551);
      myMC._alpha = random(101);
}
setInterval(_root,"flaasher",1000);



where "myMC" is the instance name of ur movie
AND
"1000" in setinterval line is one second ..... for more spped use 500 and for more use 200 and so on





FLAASHER
0
 
alexnexusAuthor Commented:
Hi FLAASHER!

It worked!
I tweak it a bit to make it work on a movieClip event.

The code ended up looking like this:

onClipEvent (load) {
      function flaasher() {
            _x = random(551);
            _alpha = random(101);
      }
      setInterval(this, "flaasher", 100);
}

Thanks!
alex nexus
0
 
FLAASHERCommented:
U welcome



Thanks for the points











FLAASHER
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.