Web Design Talks
website design tips and tricks

Random Movement In Flash - Flash Tutorial

May 26, 2008 21:49 by anjel

Create a new file of 550x100 size and make Frame rate 30 frames per second. Draw vertical line the same as vertical size of our clip.

 



Now select that linke and press F8 to get it into movie clip.  The name of the clip is not is not important. Now we have  a movie clip containing our line.



Now select the movie clip and press F9, now you are inside ActionScript. Please make sure that the selection is on movie clip exactly! Now insert the following code:

 

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

 

That is it! Now go to Control > Test Movie or simply press Ctrl+Enter.  

You should get a saltatory line over image like this one:

   


Currently rated 3.0 by 2 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Related posts