Load Random Movie For Ad's
i'm creating a web page, i'm trying to put some banners, i't work perfect, everytime y reload the page a diferent banner go on... but what i want to do is put a code in my banner (in the last frame) and... this code will call a .swf, but no in secuence, but ramdom... and i read a loot of different posts... i dont want to genetare a number, cuz if i put the code fot 10 banners, if i dont have 10 banners?? or... if i have more than 10 banners??? i have a rotor.php on my web, so, everytime u go in, a different banner go in... PLEASE SOMEONE!!!! HELP ME!!!!!!!!
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 09-10-2006, 08:13 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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 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!
Load Random Movie
Hey people,... was wondering how to load in a random movieclip into another movieclip?
Any ideas?
Thanks.
Load Random Movie
Hi,
Ive created 4 different SWF files and I want to load one of these randomly onto a HTML page. Is it possible to have another movie that sits permanently on the HTML page and assign an actionscript to its first frame that will load a random SWF on top of it.
Any help with this would be a life saver.
Cheers,
Shane
Random Load Movie
Hi,
I am creating a quick quiz in flash for a client, The problem i am having is I want the file to sit localy on the clients PC and connect to my server to display the swf files. This I can do ! But I also want the local swf file to randomly pick a swf file from my server ? This I cant do?
Is there a way to randomly load swf files into a movie ?
If so can you tell me how ?
Cheers
David
Load Random Movie
OK, here's what I'm going for and I don't quite know how to go about it. I'm having an all flash site. In the upper right hand corner, I want an external random movie to play. Now, I think I could manage this just creating a random number then using if statements, but here's the kicker. I want that movie to play, then "tell" the main movie that it's over, upon which the main movie will unload that movie, and load another random movie.
What I was thinking was something on the order of:
On the first frame of each seperate movie, call out a variable say movie=0, then the last frame of each seperate movie will have a stop and movie=1.
Now, in the main movie, I will have an empty movie clip that will be something like:
onClipEvent(enterFrame) {
if(movie=1) {
unloadMovie(anotheremptymc)
then do the random thing
}
}
The only problem is that I don't know how to get that main movie symbol to be able to "see" the variable out of the loaded movie. Any help or suggestions?
Random Movie Load
For my new website header I would like a random .swf to load in a certain position on the stage.
I have been searching and found many similar threads/tutorials but any code I have tried from there, comes up with errors upon publishing. The only problem I thought of is possibly due to the fact they were written for previous Flash versions, but I have set my movie as Actionscript 2.0 and still get errors.
Basically, I'd like one of 10 small .swfs loading randomly, once just when the page loads.
This .swf would stay there until the page is refreshed, then another .swf would be loaded in the same place. So an .swf just needs to load once everytime the animation appears.
The .swfs are named as "movie_0.swf" through to "movie_9.swf. These will all be held in the main directory of the site, the same as the header.
If anyone has a link to another thread that will get this to work in CS3, or if someone could show what the code should look like, I'd be very grateful.
Many thanks,
Cal
Load Random Movie
I'm sure this is old hat for most out here, but I can't seem to piece this together.
I have a movie (parent.swf) and I want to load external movies (ext1.swf, ext2.swf, ext3.swf) into parent.swf.
The catch is, I want the movies to transition (actually enter stage right, exit stage left) through parent.swf randomly and continuously.
I'm sure there is a tutorial I'm missing somewhere but any help will be very appreciated. Thanks.
Load Random Movie
I need to load random movies into a mc on main stage,...maybe even set the time in loads a new one to random too,...I pretty new to as,...and have not learned varibles very well yet,...if anyone can point me to the right direction that would be very cool,...and nice of them.
Load Random QT Movie?
I have a series of four QT movies that I would like to randomly load when someone goes to this Flash piece on a web site.
Simple explanation...each time someone visits/refreshes the web page containing this Flash piece (which contains the video), I would like a different video to load in the Flash piece. I don't need to deal with cookies or anything...just a random loading of the movie.
I don't even know where to begin to write and ActionScript like that. I'm in Flash 8 Pro, by the way. Please...any direction would be great.
Thanks so much!
Load Random Swf Into Movie
I need to load a randomly selected .swf into my main movie. Have found the code below which does all the loading fine...
... however, I need to keep elements from the original, so is there a way to load the new movie INTO the main one?
I think I might need to load into an empty instance? If so, what does my code need to look like?
Thanks in advance
Attach Code
// all variables are global so they will be available
// as we load new swfs into level 0...
_global.fileNames = ["home_bot_alex.swf","home_bot_jackson.swf","home_b ot_rob_gym.swf","home_bot_rob_webber.swf","home_bo t_ross.swf","home_bot_simon.swf"];
//get random file while checking against the last one
_global.getRandomFile=function(oldFile){
do { var newFile = fileNames[Math.round(Math.random()*(fileNames.length-1))]; }
while (oldFile==newFile);
return newFile;
}
_global.loadRandomFile=function(){
_global.fileToLoad = getRandomFile(_global.fileToLoad);
loadMovieNum(fileToLoad,0);
}
Hello, And Random Movie Load, Help.
First off, Hello every one. I am not new to flash but new to action scrips.
Now, I need help. I have searched the forums. But I can find the answer. I have two intros to my site, and want both to be displayed randomly when people visit my site. I used this site's tutorial to load a random movie and it worked. But the problem is that it shows the animation that is outside the frame. (A ninja flys past the screen) How can I set it so that it will load a random movie and just show whats in the frame?
Hello, And Random Movie Load, Help.
First off, Hello every one. I am not new to flash but new to action scrips.
Now, I need help. I have searched the forums. But I can find the answer. I have two intros to my site, and want both to be displayed randomly when people visit my site. I used this site's tutorial to load a random movie and it worked. But the problem is that it shows the animation that is outside the frame. (A ninja flys past the screen) How can I set it so that it will load a random movie and just show whats in the frame?
Random Load Movie
Is it possible to load movie clip's into Flash randomly.
Thanks in advance.
Trying To Load Random Movie
I am using the below script in flash mx 2004 to load a random movie but it is not working can someone please tell me what I am doing wrong?
Thanks
Tim
PHP Code:
filename = ["pcrx2.swf", "headline.swf"];
path = "";
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], movieTarget);
HELP - Random Movie Clip Load
I have a problem. I am trying to get a movie to load a random swf file each time run. The files are 1.swf, 2.swf, 3.swf, ect..... Here is the script I am trying.
ran = random;
loadMovie (load.swf ="brands/(ran).swf", "load");
What the hell am I doing wrong?
Thanks for your help,
Bryan
I Need A Random Load Movie Script
I want an swf on my homepage that loads a random movie
each time the user visits the site - is this possible?
I guess the master movie would pick from a random list of
the movies with the same root name but anyone got
the code? or fla examples?
Random Scene Or Movie Load
Is there a fairly easy way to do either of the following:
1. When an .swf movie loads, to play in a _random_ sequence the various scenes in that one .swf file, with no action taken by the viewer.
OR
2. When one .swf movie loads and completes, to load _at random_ any of several external .swf movies over the top. Then when that second .swf movie is completed, to again load _at random_ any of the several external movies.
Has to do with banner advertising, as you might have guessed.
Many thanks for any help.
Randy Scott
Load Random Jpeg In Movie
Hi!
I don't know how to randomly load a jpg.
I have 60 jpeg in a file, and I'd like to load them randomly on my 1st page.
PLEASE SOME HELP
Load A Random Frame In A Movie
Hey people, I've got this movieclip that has serveral different images in it that act a backdrop. What I want to know is, if I place all the images in the same movieclip (if differnet images are placed at every 10 th frame), can I write a script that will randomly choose an image and place it at certain X & Y cood's?
Thanks,...
How To Load Random Text Into Movie, But...
I have created a button that loads random txt into a dynamic txt box.
Works a treat. But I want to put the button within a movie. When I do this, it no longer works. Can anyone help?
(Is there a problem with scripts generally when buttons are placed within movies??)
//this is the script in the txt file, randinfo.txt //
textField=Dynamic text
name1= first line of text
&name2= second line of text
&name3= third line of text
&name4= fourth line of text
&name5= fifth line of text
&name6= sixth line of text
&numnames=6
//this is the script in the button, the dynamic txt field is named random.name //
on (press) {
loadVariablesNum ("randinfo.txt", 0);
count = Number(random(numnames))+1;
_root.randomname = eval("name" add count) ;
stop ();
}
How To Load Random Text Into Movie, But...
I have created a button that loads random txt into a dynamic txt box.
(see attached fla)
Works a treat. But I want to put the button within a movie. When I do this, it no longer works. Can anyone help?
(Is there a problem with scripts generally when buttons are placed within movies??)
//this is the script in the txt file, randinfo.txt //
textField=Dynamic text
name1= first line of text
&name2= second line of text
&name3= third line of text
&name4= fourth line of text
&name5= fifth line of text
&name6= sixth line of text
&numnames=6
//this is the script in the button, the dynamic txt field is named random.name //
on (press) {
loadVariablesNum ("randinfo.txt", 0);
count = Number(random(numnames))+1;
_root.randomname = eval("name" add count) ;
stop ();
}
Random Load Movie Clips
Hi there,
Could someone point me in the right direction..
I have created my site perfectly and each clip loads from Movie Clips etc.. What I have is on the homepage different areas such as news, clients, features.. What i want to do now is in each of these areas load a random movie clip to make the site look like it is more dynamic.. Has anyone got a script for this that i can pre select say 3 - 5 swf files to load randomly or in order each time the page is refreshed. I would want to do this for each MC so the site looks dynamic.
Thanks.....
Select Random From Load Movie ?
hi all i have a small banar in my site and i have also 30 swf file for my products
how can i write an action to select randomly from 30 swf file with loadmovei function
the files name are : p1.swf - to - p30.swf
thx alot
[F8] Load Movie At Random Frames
Hi,
I have a flash movie which is going to sit on the homepage of a site but I need it to start at different points each time the page is visited. I have managed to do this succesfully using the following code on the first frame:
PHP Code:
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("begin_movie", "image2", "image3", "image4", "image5", "image6", "image7", "image8", "image9");
Array_ar.shuffle();
index = 0;
function load_random() {
gotoAndPlay(Array_ar[index]);
if (index < Array_ar.length-1) {
index++;
}else{
index=0;
}
}
load_random();
However, unfortunately life's never that simple so my problem is that because my flash movie contains slow tweens of fairly large jpegs, the images jerk when exported. The only way around this is to load the movie from a container file, which is published to flash 7. This somehow prevents the jerking (good tip for anyone else who has this problem). On the first frame of the empty container movie I just have
PHP Code:
loadMovie("img/flash/homepageAnim_01.swf",1);
But now, because of the new actions at the beginning of my main movie, the container file fails to load the movie at all.
Please help! I'm sure this is a fairly common problem so hopefully this thread will help a few people.
Thanks
Joanna
[CS3] Load Random Movie Clips
Hello,
I have created a flash site/game. The stage consists of a static picture ive made that lasts for one key frame. there are several movie clips that i would like to start randomly playing within the stage called pigeon, giraffe, ibis, zebra and plane. They are all animated movie clips.
Question is how do i get them to start playing randomly at any moment? I cant seem to find the right answer. FYI im using Actionscript 2.0
thanks
[F8] Random Load Movie INTO Existing
Hi,
I need to load a randomly selected .swf into my main movie. Have found the code below which does all the loading fine...
// all variables are global so they will be available
// as we load new swfs into level 0...
_global.fileNames = ["home_bot_alex.swf","home_bot_jackson.swf","home_b ot_rob_gym.swf","home_bot_rob_webber.swf","home_bo t_ross.swf","home_bot_simon.swf"];
//get random file while checking against the last one
_global.getRandomFile=function(oldFile){
do { var newFile = fileNames[Math.round(Math.random()*(fileNames.length-1))]; }
while (oldFile==newFile);
return newFile;
}
_global.loadRandomFile=function(){
_global.fileToLoad = getRandomFile(_global.fileToLoad);
loadMovieNum(fileToLoad,0);
}
... however, I need to keep elements from the original, so is there a way to load the new movie INTO the main one?
I think I might need to load into an empty instance? If so, what does my code need to look like?
Thanks in advance
Random Load Movie Clips
Hello all. I'm new to action script and I'll appreciate it if anybody could give me some help.
I'm currently creating a kindergarten game where the user is supposed to drag and drop a correct answer (from a list of options given) to a specific place to check the answer.
Eg: Given a,e,i,o,u and in the bottom right corner there is a "A". The user is supposed to drag the "a" to the "A" which produces the right answer. Anything else is wrong.
So my question now is, how do i generate a random given options(a,e,i,o,u)? Naturally there must be a correct answer among the given options. I've already made movieclips for a-z as well as A-Z.
My second question is:
Is there any way to loadMovie to a specific coordinate, even after I've managed to randomise the questions?
Please help! I really appreciate any given help!
Thanks!
Load Random Movie Clip
Hey guys,
I am looking to load a random movie clip from my library onto the stage. I would like to time it so that the movie clip finishes playing then it chooses another random movie clip and plays that until it finishes as well. In the code below I am attempting to test it with 2 movie clips. Right now it will wait for the seconds I specified before it loads the first movie, then randomly loads each movie right after another not waiting the setInterval period each time.
How can I make it load a random clip, wait for it to finish, then load another random clip and so on? Thanks!
-----------------------------------------------------------------
var inter=setInterval(randomLoad,10000);
function randomLoad()
{
movieArray = new Array("girl", "group");
randomMovie = Math.floor(Math.random()*2);
trace(randomMovie);
_root.attachMovie(movieArray[randomMovie], shim, 2);
}
Load Random Movie (no Repeat)
Does anyone know how load non repetative random movies (swf). I want to load ten of them. Please let me know how to do this. Thanks a lot!
Load Random Movie Clips
Hi,
I am trying to make a flash site where the intro scene would randomly load 1 of 4 movie clips from my Library. I've never done a random script before. Any help is appreciated.
Thanks!
Load Random Movie Button
hi.. heres my problem . I am trying to get a single button to load different individual images with each 'click' , now I know a simple way to do this is by having keypoints along the timeline with which the button is directed to via 'stop' and 'goto' a.s. but what if I wanted the imge that appears to be a random choice? I presume the images would then not have to be within the timeline but called upon with a 'load' function? and perhaps even as .swf's rather than jpegs? i am not sure though as i am still practicing and my flash expert mates just laugh at me struggling! all help appreciated
Load Random Swf- Then Play The Next Movie
Hi, i am trying to construct a banner that loads random swf's which contain videos. The viewer will go on to the website and view the first random animation, the video will play through and when it has finished i need it to load another swf but not the same on just played. In a way i need it to know what it has already played and to work its way through the other swf's. I think theres about 9 in total.
I know how to get a main swf to load externals in to a movie clip holder. What i don't know is how to make it play the next swf after the video has stopped.
If it can be done via xml that would be even better!
Please help if you can!
Cheers!
Load Random Movie Button
hi.. heres my problem . I am trying to get a single button to load different individual images with each 'click' , now I know a simple way to do this is by having keypoints along the timeline with which the button is directed to via 'stop' and 'goto' a.s. but what if I wanted the imge that appears to be a random choice? I presume the images would then not have to be within the timeline but called upon with a 'load' function? and perhaps even as .swf's rather than jpegs? i am not sure though as i am still practicing and my flash expert mates just laugh at me struggling! all help appreciated
Load Random Movie Problem
Last edited by Dirtyboy : 2006-04-18 at 18:53.
I can't go home until I figure this out. Can someone point to me what's wrong with this code? Any help is much appreciated.
ActionScript Code:
clips = new Array("http://temp.com/media/sgtmp/sgslide/g0.swf",
"http://temp.com/media/sgtmp/sgslide/g1.swf",
"http://temp.com/media/sgtmp/sgslide/g2.swf",
"http://temp.com/media/sgtmp/sgslide/g3.swf",
"http://temp.com/media/sgtmp/sgslide/g4.swf",
"http://temp.com/media/sgtmp/sgslide/g5.swf",
"http://temp.com/media/sgtmp/sgslide/g6.swf",
"http://temp.com/media/sgtmp/sgslide/g7.swf",
"http://temp.com/media/sgtmp/sgslide/g8.swf",
"http://temp.com/media/sgtmp/sgslide/g9.swf");
function gen_rand_swf(){
Math.floor (Math.random () * 9);
}
function changeMovie(){
count = Math.floor (Math.random () * 9);
loadMovieNum ("http://temp.com/media/sgtmp/sgslide/g" + [count] + ".swf", 1);
}
var interval=setInterval(changeMovie,10000,gen_rand_swf(),dropZone);
a1.onRelease = function () {dropZone.loadMovie("http://temp.com/media/sgtmp/sgslide/g0.swf");}
a2.onRelease = function () {dropZone.loadMovie("http://temp.com/media/sgtmp/sgslide/g1.swf");}
a3.onRelease = function () {dropZone.loadMovie("http://temp.com/media/sgtmp/sgslide/g2.swf");}
a4.onRelease = function () {dropZone.loadMovie("http://temp.com/media/sgtmp/sgslide/g3.swf");}
a5.onRelease = function () {dropZone.loadMovie("http://temp.com/media/sgtmp/sgslide/g4.swf");}
a6.onRelease = function () {dropZone.loadMovie("http://temp.com/media/sgtmp/sgslide/g5.swf");}
a7.onRelease = function () {dropZone.loadMovie("http://temp.com/media/sgtmp/sgslide/g6.swf");}
a8.onRelease = function () {dropZone.loadMovie("http://temp.com/media/sgtmp/sgslide/g7.swf");}
a9.onRelease = function () {dropZone.loadMovie("http://temp.com/media/sgtmp/sgslide/g8.swf");}
a10.onRelease = function () {dropZone.loadMovie("http://temp.com/media/sgtmp/sgslide/g9.swf");}
The random movie works fine, but when I click on a button, the movie doesn't loads another one on top of it instead of unloading the last one. What am I missing?
Load Random Movie Into Movie Clip?HELP?
Load External Random Movies Into a Movie Clip??HELP!
Alright i have done this tutorial on this site http://www.kirupa.com/developer/acti...ndom_movie.htm.
But I need help with the Action Script?? Could any one help me modifie the AS to allow this movie clips to be loaded in to another container movie clip...
My Current AS is;
filename = ["Banner1.swf", "Banner2.swf", "Banner3.swf"];
path = "http://www.buildersmart.com.au/flash/";
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], movieTarget);
Load And Play Random Movie Clip
Can anyone give me some pointers as to how I might load and play a random movie clip? I have a series of short movies (about 15), all the same size (120 x 80) but not the same length (duration).
I know how to create a 'holding' movie and load a specific movie into this 'holding' movie. I now want to add code so that one of the 15 movies is picked randomly, loaded, placed on the stage and then played.
Load Random Movie Clip From Library
i need a way to have one of three versions of a banner randomly load upon refresh, but they cannot be external files.
I'm thinking loading movie clips from the library might be the best way to go but I'm pretty foggy and I haven't found much out there on the Web the get me started in the right direction.
any takers?
Load A Random External Movie Clip?
I want to display a random movie clip on a web page from a possible 3 clips.
I think the best way to do it is to have a parent clip, which has script to choose from 1 of 3 external clips to load in. Not sure on the actionscript involved to do this, or how to show an overall preloader for the new clip loading?
[F8] Load Music Tracks With Random Movie
I have a movie that has 3 sections. It basically runs from the start and when it makes it to the end of that first section, I have some AS that tells it to jump to a random section. Simple, right? Here's the code I used:
Code:
function getRandomLabel ():String {
var labels:Array = new Array("CYN", "RED", "GRN");
var index:Number = Math.floor(Math.random() * labels.length);
return labels[index];
My problem is now that I want to add music behind these sections. Each section runs about 20 seconds but I have tracks that are 1 minute long. So after 3 sections have randomly played, I want to switch tracks. Can someone help me with the AS here?
I'm guessing that I need some kind of math function that determines how many times my getRandomLabel function has run and then to start the count over... and use that to load up my mp3 tracks.
This is way over my head. Any help would be greatly appreciated. Thanks.
Code For Random Movie Load After 30 Seconds
Hi i need some help with writing code that randomly loads a movie into layer 0 after a thirty second interval. i have 5 movies all named 1 to 5. i use this code in some movies and it works fine but in others it doesnt function
onLoad = function () {
counter = 0;
};
_root.onEnterFrame = function() {
counter = counter + 1;
if (counter > 300) {
newmovie = random(5) + 1
newmovie = newmovie + ".swf"
loadmovieNum(newmovie, 0)
};
can any one write me some code that will work everytime as if i dont get this working i could fail university! any help would be very, very much appreciated. Thanks in advance
Dave
Random Movie Load- Percentage Check?
Okay, let's say I've got a script set up (as per the tutorial) to load a random movie.
How would I weight this so that movie A has a 65% chance of loading, movie B has a 25% chance of loading, and movie C has a 10% chance?
Stumped.
TIA!
Load Random Movie Clips & Resize
I am pretty new to Flash. I read the tutorial on loading random movies and used the code provided in the tutorial, which worked very well, but I have a problem with the movie sizes. The code used was:
filename = ["movie1.swf","movie2.swf","movie3.swf"];
path = "spiffs2/";
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], load_mc);
As you can see I am loading the 3 numbered movies from my "spiffs2" folder into an empty mc with an instance name of "load_mc". My problem is that the 3 movies are all different sizes and I want them to adopt the dimensions of the empty movie clip, which is 150w by 100h.
I also tried the following code found in this forum after moving the 3 movies to the same folder:
var ad_number = 3; //number of movies
loadMovie("banner"+random(ad_number)+".swf", _root.load_mc);
var ad_width = _root.load_mc._width;
var ad_height = _root.load_mc._height;
if (ad_width > 150) {
_root.load_mc._width = 150;
_root.load_mc._xscale = _root.load_mc._yscale;
} else if (ad_height > 100) {
_root.load_mc._height = 100;
_root.load_mc._xscale = _root.load_mc._yscale;
}
The movies load with this code also, but they do not resize as I expected.
Can someone please give me a hand with this? It's probably a simple thing, but I have tried again and again and can't find the answer anywhere.
Thanks in advance for any help!
Mozzila Disagrees With Load Random Movie
I've read through quite a few threads on the Load Random Movie script but none seemed to have the problem that I'm experiencing on Mozilla.
I have 3 external .swf being loaded randomly by the "load_randomMX.swf" that Kirupa so generously posted on this site. Thanks mate!
On IE all three swfs are randomly displayed but on Firefox Mozilla the 3rd swf just doesn't come up and there seems to be preferrential choice to the 1st swf.
As a newbie attempt to rectify matters I tried including the 3rd swf a second time within the swf line up but it didn't make a difference.
Here is the script:
filename = ["top_banner_value01.swf", "top_banner_value03.swf", "top_banner_value02.swf", "top_banner_value03.swf"];
path = "http://www.spotonsystems.com/xdev/Flash/";
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], movieTarget);
Here is the link to the site so you can see for yourselves:
http://www.spotonsystems.com/xdev/
Thanks in advance for any help that you can offer!
Hanek
|