Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-20-2002, 10:28 PM   #1
Kahlil
Poor Righteous Teacher
 
Kahlil's Avatar
 
Join Date: Jun 2002
Location: MEXICO-Boston
Posts: 33
Send a message via ICQ to Kahlil Send a message via Yahoo to Kahlil
Talking Randomize


I want to randomize the loading of images and movies. I want to know if there is a way to load the links into arrays and randomize the variable to load.

What would be the ideal script to achieve this, either movies or graphics. I want that each times it reloads I am able to to see a different image-movie-or animation.
Kahlil is offline   Reply With Quote
Old 06-21-2002, 05:26 AM   #2
overjoyed
soli Deo gloria
 
overjoyed's Avatar
 
Join Date: Jun 2002
Location: Geneseo, IL
Posts: 20
Default

If you use Math.random(#) where "#" is the highest number of random variations you want, you can use this for mutiple things: go to a random frame in a movie clip, go to a random scene, load a random movie clip, etc.

For more information, check out these tutorials:
http://www.actionscript.org/tutorial...ip/index.shtml
http://www.actionscript.org/tutorial...ns/index.shtml

::/ overjoyed /::
overjoyed is offline   Reply With Quote
Old 06-21-2002, 05:44 PM   #3
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
Default

jesse's done the code for you:
http://www.actionscripts.org/showMovie.php?id=48
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 06-21-2002, 07:43 PM   #4
Kahlil
Poor Righteous Teacher
 
Kahlil's Avatar
 
Join Date: Jun 2002
Location: MEXICO-Boston
Posts: 33
Send a message via ICQ to Kahlil Send a message via Yahoo to Kahlil
Default So the magic line would be...

So the magic line would be something like

Onloadmovie(Math.randomize("bob1"+"bob2"))
Kahlil is offline   Reply With Quote
Old 06-21-2002, 08:22 PM   #5
overjoyed
soli Deo gloria
 
overjoyed's Avatar
 
Join Date: Jun 2002
Location: Geneseo, IL
Posts: 20
Default

Actually, it would be more like this:
Code:
this.onEnterFrame = function() {
     bobNum = Math.random(2)+1;
     loadMovie("bob"+bobNum+".swf",_root.bobMovie);
};
Every time you go to the frame that includes this code it loads a random external .swf into the target: _root.bobMovie. Either "bob1.swf" or "bob2.swf" respectively.

For more help, you can also check out the official Macromedia Flash dictionary here:
http://www.macromedia.com/support/fl...athrandom.html

::/ overjoyed /::
overjoyed is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Randomize an array and compare Getin2NoAScript ActionScript 1.0 (and below) 4 12-08-2005 09:17 PM
randomize part of an array? alpineedge3 ActionScript 2.0 1 06-08-2004 07:01 AM
Randomize 5 xy coordinates speedy ActionScript 1.0 (and below) 1 11-16-2002 12:13 AM
How to randomize to play a mc in flash 4? coala Simple Stuff (Newbies) 1 09-25-2002 02:43 PM
Randomize Animation clip Kahlil ActionScript 1.0 (and below) 2 09-23-2002 10:09 PM


All times are GMT. The time now is 05:04 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.