Solved

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

Posted on 2006-11-29
3
191 Views
Last Modified: 2010-04-03
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
0
Comment
Question by:alexnexus
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
FLAASHER earned 500 total points
ID: 18041079
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
 

Author Comment

by:alexnexus
ID: 18041246
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
 
LVL 13

Expert Comment

by:FLAASHER
ID: 18041272
U welcome



Thanks for the points











FLAASHER
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Suggested Solutions

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

830 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