Solved

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

Posted on 2006-11-29
3
183 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

813 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now