Forum Moderators: open

Message Too Old, No Replies

How to randomize animations

         

zxk105

2:50 am on Sep 14, 2004 (gmt 0)

10+ Year Member



I would like to liven up my site a little bit and make my title in Flash as an animation. So what I have in mind is have the letter flip horizontally, vertically, change in size......whatever. Hopefully I can do this with tweening.

First I was wondering if anyone knows of any good tutorial sites for Flash?

Second I was wondering if you can randomize animation with Flash? I want my title to be animated and these animations to randomly happen and not in sequence all the time. Is this possible or not?

Thanks

benihana

4:44 pm on Sep 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1) yes you can tween them. or script them if you know what your doing.
2) yes. you can use the math.random script to generate random numbers, and then use if statements to play which ever animation you want, or anything else you might wnat to happen.
3)

first few of these [google.com] are quite good

ben

<added> responses are totally in the wrong order but you get what i mean :) </added>

zxk105

3:34 pm on Sep 16, 2004 (gmt 0)

10+ Year Member



I haven't done any research yet and I'm sure I will find tones online. But just one more question......When you say to use math.random script, how does it work? Do I have separate files that are randomly called, or are all animations in one file and math.random is placed in the frame at the beginning of each animation? This will help me start organizing ideas. Thanks.....

benihana

11:32 am on Sep 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



id put each animation in seperate moviecclip, call the 1_mc, 2_mc etc then generate the random number, append _mc to it and do what ever you want with it.

good luck
ben

guitarwez

4:40 pm on Sep 18, 2004 (gmt 0)

10+ Year Member



I did this on a site last year. It randomly chooses between two flash movies I created for the header.

Here's the javascript used (embed it where needed):


<script language=JavaScript>
now=new Date();
seconds= now.getSeconds();
if(seconds % 2 == 0)
{
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=770 HEIGHT=234><PARAM NAME=movie VALUE="/flash/vel-header.swf"> <PARAM NAME=loop VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#ffffff> <EMBED src="/flash/vel-header.swf" loop=false quality=high bgcolor=#ffffff WIDTH=770 HEIGHT=234 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> </EMBED></OBJECT>');
}
else
{
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=770 HEIGHT=234> <PARAM NAME=movie VALUE="/flash/vel-header1.swf"> <PARAM NAME=loop VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#ffffff> <EMBED src="/flash/vel-header1.swf" loop=false quality=high bgcolor=#ffffff WIDTH=770 HEIGHT=234 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> </EMBED></OBJECT>');
}
</script>

Hope that helps!

[edited by: DaveAtIFG at 4:42 pm (utc) on Sep. 19, 2004]
[edit reason] Removed off topic comments [/edit]

guitarwez

4:52 pm on Sep 18, 2004 (gmt 0)

10+ Year Member



Whoops. I just realized you were asking about randomization within the flash movie...

Anyhoo...do do doooo....

zxk105

2:09 am on Sep 19, 2004 (gmt 0)

10+ Year Member



Well any kind of randomization will be fine with me. I will probably use the movie clip option within a movie. But since I am still fairly new wit Flash it will take some self teaching at first.....