Load Random .swf
I have a blank .swf that I want to randomly load several other .swf files. here's the script I am using, but i do not know why it is not working
ActionScript Code: a = ["index1.swf", "index2.swf", "index3.swf", "index4.swf", "index5.swf", "index8.swf"];r = a[random(a.length)];loadMovie(r, 0);
I though that was right, but I am obviously mistaked. help?
thanks
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 01-23-2004, 05:27 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
PLEASE HELP - URGENT Load Random Swfs From Individual Random Sets
I have two target mcs I would like to load different random swfs into
I have eight folders (a-h), each with 12 swfs (001-012)
I need to load a random swf (001-012) from a random folder (a-h) into the "card1" mc
I have figured out how to specify which one I want:
loadMovie("a/a001.swf","card1")
stop();
however, I need it randomized....
then, I need to load another random swf into my "card2" mc (001-012) from another random folder (a-h, ...except for the folder from which the first swf was loaded)
can somebody please help??????
Load Random Swfs From Two Differnet Random Sources
I am in the process of creating a VS Card game in Flash. It is basically a game where you can choose either one card or another, each randomly pulled from one of the eight different sets. The first card (or swf) can be pulled from any of the 8 sets (out of a total of 12 cards in each set))..and will load into a targetMC, and the second must be pulled randomly from any of the 8 sets except from the folder where the first card was chosen and load onto the second targetMC.
after the winning card is chosen, it will display winning animation (and send data off to a dynamic bargraph program), and then the main movie will reload two random cards from differnt sets.
can anybody help me on how to set this up??
Load A Flash Movie To A Random Frame Each Load
I have created a flash file that fades from one picture to the next. However, I would like to find an actionscipt that will allow the flash movie to load to different each time the page is visited/refreshed. That way visitors don't have to see the same image each time the visit the my page, but can still sit and watch all of them if they want. Also I would want to be able to specify which frames are available for load. That way the page will always load at the begining of each image animation... not right in the middle of it switching to the next image.
Any help is greatly appreciated!
Load A Flash Movie To Specified Random Frames Each Load
Group:
I am trying to find a Actionscript where I can specify random frames and have the movie randomly load to the specified frames each time the page is viewed. The below scrip was given last time I posted this question, but it doesn't seem to load at the specified frames. Sometimes it does, sometimes it load right in the middle of an animation. You can see in the code below I would like the movie to load at frames 1, 116, 231, 346. Any suggestions?
_____________________________________________________
Array.prototype.shuffle = function() {
for (var ivar = this.length-1; ivar>=0; ivar--) {
var p = random(ivar+1);
var t = this[ivar];
this[ivar] = this[p];
this[p] = t;
}
};
ASSetPropFlags(Array.prototype, ["shuffle"], 1, 1);
var Array_ar:Array = new Array(1, 116, 231, 346);
Array_ar.shuffle();
index = 0;
function load_random() {
gotoAndPlay(Array_ar[index++]);
if (index == Array_ar.length) {
(index=0);
}
}
load_random();
Load Random Mc.. Wait.. Then Load Following Mc
Last edited by [X]Silver : 2005-03-30 at 00:50.
Is this possible?
I'm doing a flash site, that loads a random movie at startup;
ActionScript Code:
filename = ["test_0.swf", "test_1.swf",
"test_2.swf", "test_3.swf", "test_4.swf"];
path = "mc/";
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], movieTarget);
Is it then possible to assign a linked movie to each of the randomly loaded movies, and have it load after a 4 second wait?
Page loads -> random movie -> 4 sec wait -> Random movie unloads and is replaced by the movie in same category (linked)
Does this make sense?
Hope someone can help me...
thanks
Random Load
I'm building my first all Flash site for myself.
The background is an image/.swf.
When someone hits the page, I want a unique and random image/.swf to pop into the background.
I've built the whole site off of an 'empy' base movie. Everything else loads into various layers or MCs of those layers.
My base image movie is layer 1. What would be the random script needed to have layer 1 rotate randomly through 5 or 6 different images/movies on load?
Any guidance, to tutorials or suggested scripting, would be greatly appreciated.
Thanks in advance.
Load Random SWF
I would like to randomly load a series of external images into my Flash file. Since Flash 5 does not support external linking to image files, I have to place images into a SWF movie, and then randomly load the external movies.
If anyone knows a script for this, or could tell me where to find it, I would appreciate it.
Thanks
Load Random Mc ( HELP PLEASE)
HI.....
I have exernal (mc.swf)
when i update it....
the old mc still in the cash ..
any action script code for it ?
I don't want meta html code... only action script!!
Thanks...
Random Load
i want a movie with random movieclips going of at random intervals, is it possible? And can you call for these movieclips to load when they get called so you dont have to load everything right away?
Also, do you need to clear it after each event has played so it doesnt take up space (ram)?
Load Random .swf In?
Hi. I was wondering if someone could help me with my problem. I have a movie with about 6 different sections which are loaded in from external .swf's. For the moment being my AS is...
loadMovie("news.swf",_root.wNEWS.newsMC);
_root.wNEWS.newsbutton.enabled = false;
The reason I have the button thing is to disable the button of that clip once it's loaded, I'm sure you knew that though. But what I want to do is instead of loading that clip in everytime have it randomly load in one of my 6 sections everytime you visit or refresh. I was wondering if someone could show me the AS for what I want to do? I would appreciate it alot. Thanks!
Load Random
does anyone know how to have flash files( swf ) load random into a table. i am setting up a page and would like if every time someone goes to this page have a different swf show up . i would like to be able to call these swfs from a folder they are placed in. thanks for the help
Random Load Swf
Hi folks,
here's my dilema. I trying to have my site stream my songs and then I want to put in a code to have it open another swf in the same window/level at random.
I'm looking for an actionscript code to do the following.
I need it to load my swf files in random order. <-don't make since
"is there a such thing as, Random order, order is not Random"
anyway
I have been searchin sites and forums and I keep getting real close to what I'm looking for. However, the code must be too complex for my newb @$$, or either they're half complete. Please, I know that it's a simple code to load my swf's, I just need a lil assistance.
ver: Flash 5
OS: Winderz (windows2k)
examples I found on the net!
r=random(12)+1;
filename="movie"&r&".swf";
loadMovie("http://your-server.com/swf/"&filename, _root, );
Load Random .JPG
hey all..
can anyone tell me the script to load a random .jpg...
i have 5 diff. bg images..
1 of them now is at > http://members.rogers.com/chrisp/wor...h/aurora2.html
and i just want it to load a diff random bg image each time someone visits..
thx for the help
Random Load
Hi all,
I have a empty mpovieclip on my stage and I want to be able to load a random external image or movieclip each time the page is refreshed or the flash movie goes back to the frame that has the empty clip.
I have a folder that has 3 to 4 images at this stage and I want to know what code I would need to get my flash movie to randomly call one of the images from that series of images.
How can I do this using actionscript.
Any helo would be appreciated ro if anyone knows of a working example somewhere.
I am most grateful
Pixel Magik
Load Random Swf
i m new at this and i m having a problem with:
how can i load random swf from another swf?
thnks
Load Random Jpg
HI all
Is there a way I RANDOM
can load a jpg from a folder
What I want to do is a movie on my deafult page, that call/load
a random thumb from my gallery and because I uploading new once
a week I would be great that it just took the xxxxxx.jpg and
mabye could loop
Some have a Idea
:-) Pauk
Random Swf Load
hello
i have MX 2004 pro and have built a site with a database. The site has a flash header which appears at the top of every page. I want to mix it up a bit and make flash load a selection of movie clips randomly from a folder. how would i do this?
for example if the homepage loaded up and showed movie 1, if i clicked on the contact us link could i make flash show movie 2,3 or 4 instead on a random cycle?
Random Load JPG's
Hi please can anyone help.
I urgently need a little script to randomly load a jpg from a folder of say 10. However I need it to fade in the jpg once its loaded.?
Random Swf Load
Can anyone help please?
I need to randomly load 1 out of 30 different swfs on an action.
Basically, when clicking into the photography section on my site, I want to load up a random photo (each photo is a swf).
Any ideas?
Thanks
Help With Random Pic Load
how do i use this script to load a random picture into my movie. i have the pics in a clip all on separate frames. i don't know what i need to make it work
i successfully used the gotoandstop(random()+1) but it will load pictures repeatedly. i want there to be no repetition in the sequence.
http://www.flashkit.com/tutorials/Ac...1050/index.php
here is the script if you don't feel like going to the link
numberOfElements = 50;
myNumbers = new Array(numberOfElements);
randomNumbers = new Array(numberOfElements);
for(i=0;i<numberOfElements;i++){
myNumbers[i] = i+1;
}
i=0;
while(myNumbers.length > 0){
thePosition = Math.round(Math.random()*(myNumbers.length-1))
randomNumbers[i] = myNumbers[thePosition];
i++;
myNumbers.splice(thePosition,1);
}
for(i=0;i<numberOfElements;i++){
trace(randomNumbers[i]);
}
Load Random *.jpg
i can't get this to work. i want it to load any random jpg file that end with exension jpg
//Random images
pics = new Array("*.jpg", "*.jpg", "*.jpg", "*.jpg");
var randNum = getRandom(0, 3);
_root.containerMC.loadPic(pics[randNum], pics[randNum], 100);
pics[randNum]._x = 0;
pics[randNum]._y = 0;
// function to generate a random integer
// between minimum and maximum, inclusively
function getRandom(minimum, maximum) {
return Math.floor(Math.random()*(maximum-minimum+1)+minimum);
}
Load A Random .jpg?
Hi,
Does any one know of any code i could use to get flash to look at a folder with .jpg's in it and have flash pic one at random to load in?
Cheers
Aidan
[F8] Random Mc Load
I havn't done this b4,
i have 3 empty slots and 6 images which can be MC's or jpg's
i just want to be able to load 6 into 3 randomly on a button press.
any tuts out there 4 me to look at?
cheers
Rat
Load Random XML
Hello
I want to be able to randomly load childnodes from an xml file, so that each time the flash file is opened a different set of text appears.
I have the text loading into a flash file fine. But don't know how to go about, randomly loading them it.
Any ideas??
Load Random SWF
I am working on a website and I have 3 files:
index.swf (main site)
main_g1.swf
main_g2.swf
I need the last 2 to load into the index.swf file by using the LoadMovie script:
ActionScript Code:
loadMovie("main_g1.swf", "_root.g_loader");
ActionScript Code:
loadMovie("main_g2.swf", "_root.g_loader");
But I need them to load randomly into the same movie clip each time the site is visited (so it either loads main_g1.swf or main_g2.swf randomly).
Would anyone know a script for this?
How Can I Load Random Mc Or Gif`s?
Guyz.. How can I load random mc in my flash? Coz im making a game like Final Fantasy that loads random monster in my stage.. thanks in advance.. ty..
Load Random MC's
Hey all. Designer here. U know what that means. I need the logic genius of a generous coder.
Heres what I need.
1. load image randomly once to a site for use as a background image.
the next time a user loads the page another random image appears in bck.
I'm think thinking 4 images total (img1.swf, img2.swf, etc).
What does the code look like? the simpler the better. Thanks.!
Load Random Swf But Not Same
someone here helped with the code to load random SWF files into a movie clip...however, i need to make sure it doesnt load the one that's already playing, that it goes on to a new one everytime..
Attach Code
var swf_ar:Array = new Array("carousel1.swf", "carousel2.swf", "carousel3.swf");
function load_random() {
var rnd:Number = Math.floor(Math.random()*swf_ar.length);
carousel.unloadMovie();
carousel.loadMovie(swf_ar[rnd]);
}
load_random()
Load Random SWF
I want to load a random swf (I have five) each time a user goes to the site or hits refresh. I've researched this forum for an "easy" solution as well as buying an ActionScript book. I'm am in no way very savy with this subject. Is there an easy code to do what I need or will I have to immerse myself in understanding arrays, etc.
If someone can't provide any code could you please provide a clear basic path of the steps I have to go through so I can research each step one at a time to get the results I want.
Thanks in advance.
Load Random Mc
I wonder if anyone could get this newbie pointed in the right direction as to how to load a random image (movieclip) onto the stage using actionscript 3?
Load Random .swf
I have a blank .swf that I want to randomly load several other .swf files. here's the script I am using, but i do not know why it is not working
ActionScript Code:
a = ["index1.swf", "index2.swf", "index3.swf", "index4.swf", "index5.swf", "index8.swf"];r = a[random(a.length)];loadMovie(r, 0);
I though that was right, but I am obviously mistaked. help?
thanks
Random Flv Load
does anyone know how I could get flash to load random streaming flv videos on mouseover. I have 5 flv's that say different things and when the user mouses over a text link I want these movies to load random. Any Help would be appriciated. I can do it with swf's not these pesky flv's though.
How To Load Random MP3's...
I am making this small site just for friends to check out what I'm listening to and vice versa.
Basically I need to know how to load a random mp3 on the load of a movie.
Here is the site right now: http://ullmanm.com/EnjoyGoodMusic.html
I just want a random mp3 from a list of songs to load every time the site is refreshed.
Thanks, for any help. BTW, the paint strokes in the background were from http://the-preps.com/ .
Thanks for the help,
Mike
Random Load Swf
I have a bunch of swf's I want to load into my main movie...
I want one to load, wait 1 minute, then load another.
My question is, what is the easiest way to do this... In MX that is...
In Generator, I know how, but in MX, it is eluding me...
I'm thinking that I use an array (which I have never done before), but that would entail inputting the file names of all 30+ swf's...
I would like to have some sort of AS that will call the swf's by a number, then load the next swf, then when there are no more swf's, it goes back to 1.swf...
Am I asking for 2much?
and if there is a tutorial on this, I haven't found it... I can't even see where this has been asked on the forum before...
thanks in advance for any help...
Rev
Random Flv Load
does anyone know how I could get flash to load random streaming flv videos on mouseover. I have 5 flv's that say different things and when the user mouses over a text link I want these movies to load random. Any Help would be appriciated. I can do it with swf's not these pesky flv's though.
Load Random Mc HELP
Okay... disregard the last post.. i've worked around that.
Now.. i have my random script... it loads a random mc into a blank movieclip at page start.
But... I want this to happen when i press a button!
ActionScript Code:
filename = ["test_0.swf", "test_1.swf", "test_2.swf", "test_3.swf"];
path = "mc/";
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], movieTarget);
Can i apply this script as a function, to a button???
Any help will be greatly appreciated ;-)
Load A Random Mc.
I want to make a get a random movie clip to the same level (load a random movei clip to the same movie clip)
if anyone have a clue pelease mail me
txs
Load Random .swf In?
Hi. I was wondering if someone could help me with my problem. I have a movie with about 6 different sections which are loaded in from external .swf's. For the moment being my AS is...
loadMovie("news.swf",_root.wNEWS.newsMC);
_root.wNEWS.newsbutton.enabled = false;
The reason I have the button thing is to disable the button of that clip once it's loaded, I'm sure you knew that though. But what I want to do is instead of loading that clip in everytime have it randomly load in one of my 6 sections everytime you visit or refresh. I was wondering if someone could show me the AS for what I want to do? I would appreciate it alot. Thanks!
Random Swf Load
hi,
How would i load a random swf?
I have main1.swf, main2.swf etcetc up to 10. Is there a way to do the usual loadMovieNum but add random onto this?
Thanks
cuse
Random Swf Load@?
How can i randomlly load an swf into a target mc from four swfs? I want to have a different background when you refresh how can I do this? PLEASE HELP!!!!!!!!!!!
+J
Load A Random Png
Hey,
I have an XML document that has a list of images I have made.
Want I would like to do is make Flash randomly load one of these pngs. Then wait 4 seconds and load a new one. Like the header on Lee's Flash Blog.
How would I do this?
Any help would be much appreciated.
Thanks!
Load Random Movie
I'm attempting to load an external swf file at random.
To accomplish this I was hoping to put the paths of the swf files in an array and then call random to generate the random #. Then use the loadMovie command to load the selected file.
I've learned that loadMovie doesn't seem to like arrays or even variables in the arguments.
Example.
var MaxClips = 4;
var RandNum = random(MaxClips);
myClips = new Array();
myClips [0] = "0.swf";
myClips [1] = "1.swf";
myClips [2] = "2.swf";
myClips [3] = "3.swf";
// now for loading the movie
loadMovie(myClips[RandNum], 2);
-- or --
myMovieClip = myClips[RandNum];
loadMovie(myMovieClip, 2);
Later in the movie the user will be able to select options to change the loaded movie and again, I use the array.
Any help is appreciated.
- Keith
Load Movie At Random
i managed to apply the laod movie command, i'm using levels,
is it possible to load the movies at random? and whats the script or the command?
thanks in advance
Load Random Movie
Does anyone no of a tutorial to explain how to load random .swf files into a level? I want my main timeline to load a different file each time it is started.
TIA
Load Random Movie
I'm sure this'll be simple to somebody! I've tried finding it on the board but soz I couldn't.
Basically... I want a user to arrive at a webpage with an swf file in it. I want this swf to remain constant but within it I then want to load a random movie. So each time the user visits this page its different. Make sense?
Cheers stacks in advance!
steve
Random Load Movie
Hi,
I want to make a "Do you know that..." and I want to load a different movie everytime someone click on a button because it's gonna be stupid if you come again on the site and u know the order of appearance of the movies. Will be very thankful if you tell me how!
Random Image Load
I'm trying to create an interface that includes random images loading in a photo album type layout. It is random for 2 reasons.
1. Whenever the page loads the images load in different locations
2. Whenever the page loads random images load from a database.
HELP...
|