Solved

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

Posted on 2006-11-29
3
165 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
Comment Utility
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
Comment Utility
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
Comment Utility
U welcome



Thanks for the points











FLAASHER
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
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.

744 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

8 Experts available now in Live!

Get 1:1 Help Now