Loading A Random Background At 100%
how would you go about doing this. (ex http://hi-res.net )
I know how to do both indvidualy but i cant make it all work together!
any help would be apreciated
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 02-06-2004, 01:07 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Loading A Random Background At 100%
how would you go about doing this. (ex http://hi-res.net )
I know how to do both indvidualy but i cant make it all work together!
any help would be apreciated
Loading Random Background
Hi, i read and completed the tutorial on this topic:
http://www.kirupa.com/developer/mx/l...background.htm
what i needed is something similar, except that my background image is a motion clip and instead of having external .swf, i need all the MC's in just one flash. How do i do that?
Thank you for a quick response
x.
Victor
Loading A Random Background
Hi everyone
This is my first post here, but i've used the excellent tutorials section on many occasions with great success
I now have a question re: Loading a Random Background
This will indeed work perfectly for what i want, my question is this;
can i get the same effect using jpgs from an external source?
thankyou for looking
Sue
How Do You Use Loading A Random Background On The Website
I found the loading random background tutorial
http://www.kirupa.com/developer/mx/l...background.htm,
so i follow through the tutorial to make my .swf file work as every time i open the .swf file, it gives me different background. However, when i insert its in my webpage, it gives me no response. It won't even load or do anything else at all, so is there anything i need to do or any specific code that i need to include when i insert it to my webpage so it'll load the new background everytime that i refresh the page?
By the way, the tutorial's really helpful, thank you!
Loading Random Background Tutorial Q.
I was just reading the testing the tutorials regarding loading a random background. I have tried this and worked!
BUT!...
I tried this for my flash document but the background covers everything else.
The keyframe, in which the script for loading the random image is in, is in a layer under a layer where my title is in. But when it loads the image, it appears on top of my image.
I'm trying to make an interactive DVD and want it so that my background changes each time you load the .swf file. (If possible to make it change also whenever you come back to the home page after visiting another page in it)
How do I solve this problem?
Question About Random Loading Background
I got the tutorial to work (it's pretty simple) but I want the background to randomly load images on it's on, basically looping through all of the random bacgrkounds without the page having to be refreshed. How do I achieve this? Thanks
Random Background When Loading Website
Hi there,
I'm new to Actionscript and was hoping somone could assist me with creating a random picture loader for my background, so that when you enter the website the picture in the background is different every time you enter.
Thanks for any help!
[F8] Loading A Random Background Image And Preloading It.
Hey guys, currently making a new site. It is a fluid layout so everything streches etc. I am loading in a different background image each time the site is loaded and I have a good code for that from here:
http://www.kirupa.com/developer/mx/l...background.htm
But since the image needs to take up a lot of space on stage for things like 22" screens the image sizes are like 2MB. Is there anyway that I can preload the background image seperatly to the whole movie...well actually I know there is I just need to be pointed in the right direction or just given some help. I want the preloader to load the whole stage but then where the background image should be displayed a preloader is displayed until the background image has fully loaded.
Any help would be awsome!
thanks.
Loading Random Background Problems [renamed]
I am looking for someone skilled with Flash, a Wizard hopefully...
I have been trying to create a .swf that loads a Random background image (like the one on Kirupa's MX tutorial on this site) ... and my skills are just too insuficient.. I got it working but the images loads in sequence too fast and my general composition and work is kinda messy...
Is there someone here who is interested in helping out ?
The project is for our website, we are a non-commercial gaming clan, and alot of programmers, but none of us have any serious Flash experience. We are able to advertise/link back to anyone who might wanna help us out.
Contact me on email: therseus@gmail.com
Loading A Random Background Image With A Preloader
hello
I've been following the Loading a Random Image tutorial from kirupa but I can't seem to make my image*.swf's to work..in it all I have is 3 frames, where the first 2 frames are for the preloader and the 3rd one is for the image.. but all I get is the loadBar fully loaded (but with no animation, just static) and no image... does that code from the kirupa tutorial stop the *.swf to make anykind of anymation?
another question is about how to simple load a movie on enter frame with a movieclip defining the location where it should be loaded to.. shouldn't it be: location.loadMovie("movie.swf") ? simply.... no?
thanks in advance..
Help Loading A Random Background Full Screen
In the bottom layer of my main movie, Id like to put a random background image which loads on entering the frame and stretches to full screen. I would like to use a preloader for the image so Im trying to load a swf using this which I found here:
http://www.kirupa.com/developer/mx/l...ackground2.htm
Code:
choice = Math.round(Math.random()*5);
switch (choice) {
case 0 :
location.loadMovie("image0.swf");
break;
case 1 :
location.loadMovie("image0.swf");
break;
case 2 :
location.loadMovie("image0.swf");
break;
case 3 :
location.loadMovie("image0.swf");
break;
case 4 :
location.loadMovie("image0.swf");
break;
case 5 :
location.loadMovie("image0.swf");
break;
}
but I could not get it to stretch full screen. How do I get the externally loaded swf to stretch full screen and be able to resize via a listener from within my main movie?
Thanks!
Rich
Loading Random Fullscreen Background Image
so, i finally got the fullscreen / scaling background to work. AND i can add .swf's and other mc's over top of it without any problem. however, i want to be able to have the background image randomly generated. i know how to do that on its own, but i can't get it to work with this script. any advice?
here's my fullscreen / scaling bg script.
Quote:
Stage.scaleMode = "noScale";
_global.imgConstantWidth = bgImage._width;
_global.imgConstantHeight = bgImage._height;
setImage = function(mc){
var originalWidth = 1280;
var originalHeight = 850;
var widthGutter = (Stage.width - originalWidth)/2;
var heightGutter = (Stage.height - originalHeight)/2;
mc._x = -widthGutter;
mc._y = -heightGutter;
if (mc._width > Stage.width){
mc._x -= (mc._width-Stage.width)/2;
}
if (mc._height > Stage.height){
mc._y -= (mc._height-Stage.height)/2;
}
}
resizeImage = function(mc){
var scaleByWidth;
if (Stage.width/Stage.height > _global.imgConstantWidth/_global.imgConstantHeight){
scaleByWidth = true;
}else{
scaleByWidth = false;
}
if (scaleByWidth){
mc._height = Stage.width * _global.imgConstantHeight / _global.imgConstantWidth;
mc._width = Stage.width;
} else {
mc._width = Stage.height * _global.imgConstantWidth / _global.imgConstantHeight;
mc._height = Stage.height;
}
}
setImage(bgImage);
resizeImage(bgImage);
sizeListener = new Object();
sizeListener.onResize = function() {
setImage(bgImage);
resizeImage(bgImage);
};
Stage.addListener(sizeListener);
AS 2 Loading Random Background FULLSCREEN Images
Hi there,
I have been looking at this tutorial http://www.kirupa.com/developer/mx/l...background.htm
but I need the background images to be FULLSCREEN. Can someone help me out? Is there a way to do this that someone can point me to ? I have a client squirming, and my head is on the block.
I am using as2, flash cs3.
Thanks in advance, Angie.
Loading Random Background Problems [renamed]
I am looking for someone skilled with Flash, a Wizard hopefully...
I have been trying to create a .swf that loads a Random background image (like the one on Kirupa's MX tutorial on this site) ... and my skills are just too insuficient.. I got it working but the images loads in sequence too fast and my general composition and work is kinda messy...
Is there someone here who is interested in helping out ?
The project is for our website, we are a non-commercial gaming clan, and alot of programmers, but none of us have any serious Flash experience. We are able to advertise/link back to anyone who might wanna help us out.
Contact me on email: therseus@gmail.com
Random Background With Random Text File
I am trying to create a resizable flash file that will act as a background for my html/css website. Within the flash I want to have a script that randomly loads a jpg file from a specific folder on my server as well as a correlating txt file for that background. Here is an example of what I mean.
Say there is a movieclip named "background" and then a dynamic text area named "info" in the lower left-hand corner of the flash movie. I want a script to randomly load a jpg file (say 234.jpg) from a folder named "backgrounds" on the server. I also want it to load the correlating text file into the dynamic text area (234.txt) from a folder named "info". How would I do this and what would the script be?
NOTE: the names of the jpg and txt files would be 1.jpg, 1.txt, 2.jpg, 2.txt, etc.
Thank you for any help you can give!
-- K
Random Background
i have built a script to load a differenct background picture in random order. the script follows: -
SelectionBGArray = new Array();
SelectionBGArray[0] = "3";
SelectionBGArray[1] = "4";
SelectionBGTotal = SelectionBGArray.Length;
randomBG = SelectionBGArray[random(SelectionBGTotal)];
gotoAndStop (randomBG);
i have different background pictures on frame 3 and 4. the random function returns either 3 or 4 and thus gotoAndStop (3 or 4). i'm not very happy with this and it is very buggy. does anyone know better ways to do this? i would like to put all of the background pictures in one frame and manipulate the x and y coordinates as the .swf file loads. but i think setproperty method only works with on (release) event.
Random Background-mc's?
On my stage I have four buttons, and a background-mc too.
Let's say I want to have three background mc's, and want to random these mc's, so that they change every time I enter the site.
Is there a really easy way to do this? I'm using F4 and Mac.
Thanks ;D
coala
Random Background
I'm trying to design a custom tetris game for a local cricket club that I play for. I want to have a cricket background behind the main game. I want the background picture to change everytime the player starts a new game. How do I tell flash to load a new pic at the start of a new game????
Lee
Random Background
I'm new here so...Hello!
I only really know the basics of Flash, I don't have much knowledge of Action Scripting but I'm keen to learn! So here goes with the first of many (probably very dumb) questions;
If I were to create say 5 different background graphics or images how would I go about being able to have one of them randomly load to the background of my flash page when somebody enters the site?
Hopefully it's nothing too difficult!
Thanks in advance,
Sarah.
Random Background
My client wants to use an image as the background but wants 3 different backgrounds that will be selected randomly at the time of loading. She is trying to avoid having the same background every time. Is this possible?
Random Background
hello.. i was just wondering the correct coding to use to create a randomized background.. im trying to find tutorials.. but no luck.. where the movie clip for the background is in one movie clip.. but i really didnt want it that the site would just be going through the same actual animation.. i wanted to change colour randomly from the ones i set.. and animate.. instead of just running the movie clip.. or making about 200 frames.. where once it gets to one from it stops.. then calls another.
thats actually the question im more so wanting to.. with actionscripting the code to make it count maybe a min or 2.. then go to a randomized frame label. hopefully this is possible. i havent actually touched flash for a while.. been pushed into using visual basic by my boss.. so ya.. if anyone can help.. im using flash mx 2004
Random Background
Fox,
i am very new to flash n need some urgent help,
working on a project where i need 2 things,
1. randomly changing background everytime i open that flash file
2. how to call an swf or a flash file in another flash file n play the animation with the background of the file in which i am calling the other fla.
e.g.
i want "movie X" to be played inside the "movie Y" with the background of the "movie y" and all the components too.
please help, a little urgent
thanks
Random Background
Im looking for a way of loading a random image from xml and resize it to 1280x960 . All the examples i have are for loading multiple thumbnails .
My xml is below , can anyone show me an example .
Quote:
<item type="Wallpaper">
<img><![CDATA[Wallpaper/name.jpg]]></img>
</item>
Random Background
For mostely all of you it's will appair as a stupid question but am searching for a soultion since couple houer whitout figure it
My problem is am trying at to load into my swf a random background each time a visitor come into the site. i read couple tutorial and put some idea from them tougeder.
I called my diferent background (in propriety panel) ''background1'' to ''background6'' and they are occurence of symbole 84 to symbole 89
so here my code
ActionScript Code:
// random background donne une valeur aleatoire entre Background1,2,3,4,5 Nom d'occurence ActBg1,2,3,4,5
K = Math.ceil(Math.random()*5);
attachMovie("Background"+K, "ActBg"+K, 1);
// displayit
"Background"+K = visible.root_;
am not sure of evrething in this code and am realy sorry to bother you whit that basic stuff Any kind of help would be appreciate thx
Random Background
Hi there
I was wondering how I can add a random background to my flash site. This script should generate a random background everytime someone views my site...
Exactly like this site: http://www.exopolis.com/site/
Visit it 2-3 times to see how it does it.
SWF Random Background
Hi,
Got a little problem that I hope all you talented Flash pros could help me with.
I’m creating a Flash site with a random, allow scale, swf background. On top of that background I want my navigation menu, this should not scale with the background.
I used the KIRUPA tutorial to create the random background and it works fine, the problem is that the top navigation menu doesn’t stay the same size….it scales with the background. Think I have to use Fscommand() somehow?
If you go to www.puma.com, you can see exactly what I’m looking for.
Here is the Kirupa tutorial: http://www.kirupa.com/developer/mx/loadingrandombackground.htm
Thanks!
Random Background From XML
hey guys, its been a while since ive been on here. but i need some help.
i am making a full screen flash site and need a random pic as the background but it loaded from an xml file so the client can control it.
i know you guys know how to do this im not looking for new code!!
thanks in advance this place is awesome
Random Background From XML
hey guys, maybe i posted this in the wrong place earlier.
i need help bad, in a bind and need a background of a full window flash movie to be a random image with data loaded from an xml file.
any code or tips you have will be greatly appreciated i need help!!
Random Background
Hi there
I was wondering how I can add a random background to my flash site. This script should generate a random background everytime someone views my site...
Exactly like this site: http://www.exopolis.com/site/
Visit it 2-3 times to see how it does it.
SWF Random Background
Hi,
Got a little problem that I hope all you talented Flash pros could help me with.
I’m creating a Flash site with a random, allow scale, swf background. On top of that background I want my navigation menu, this should not scale with the background.
I used the KIRUPA tutorial to create the random background and it works fine, the problem is that the top navigation menu doesn’t stay the same size….it scales with the background. Think I have to use Fscommand() somehow?
If you go to www.puma.com, you can see exactly what I’m looking for.
Here is the Kirupa tutorial: http://www.kirupa.com/developer/mx/loadingrandombackground.htm
Thanks!
Random Background Help
I followed this tutorial.
http://www.kirupa.com/developer/mx/l...background.htm
It is a step by step guide on how to load a random background image. It loads a .swf into a movieclip on your main timeline. I did everything right, but the thing is, is that I am trying to load the image into a movieclip thats inside of another movieclip. For example it says to load the image into the movie "location." I need to load it into "background" then "location."
The gist of the code says.
choice = Math.round(Math.random()*5);
switch (choice) {
case 0 :
location.loadMovie("image0.swf");
break;
now if i need to put it into another movieclip dont i do this?
choice = Math.round(Math.random()*5);
switch (choice) {
case 0 :
_root.background.location.loadMovie("image0.swf");
break;
Well I tried that and a bunch of other options, but it didn't work. Someone please help me. Even another link to some better tutorial will help. Anything. Thanks.
Jonathan
Random Background/animation ?
Hi folks,
i've got an question. I want to make an menu for my webpage and so i will creat some animation (example: a dot which follows a line) but i will make it five or six of this animations so that the menu dosn't will be boring. ok now i've got an question: is there a way to make this animations randomize? in one of my flash books i found a script to shange the background after every start (its the code for the background):
Go to an play (Random (_totalframes))
Here the background are on one frame per movie (as background). Is there a way to write an script to randomize some different screens and that there will be a random brake after one screent with the differnt animations (i thinks it's boring too if a animation will change after one ends). And how can i realize this random brake.
I hope someone can help me
Random Background Movieclips?
Hi,
I would like to have at least two different background movieclips - so that the background changes every time I enter my flash site.
Is this difficult? How can I do this?
Thanks // coala
Random Background Images
Hello,
I am using Flash v5.0 and I can't figure out how to make a random background image appear each time someone accesses my webpage...if anyone could help me it would be greatly appreciated!
Cheers,
Macohead
Random Color In Background
I have a Website built in MX with two basic colors in the background. I want to add a script that changes the two background colors on site randomly. The catch is that I have certian colors that I want displayed together. For example, blue and green are used together then pink and yellow and orange and blue. How could these colors switch based on every visit to the site, but remember it can't just be any random color it has to come from a set that I specify (blue/green, pink/yellow, orange/blue, etc.).
Thanks
Random Background Color
i googled this but a lot of sites talk about "background color"...
anyone know how to give the stage a random bg color out of a choice of say 4 or 4 defined colors?
a nice addition would be being able to get the webpage its sitting in to appear the same color, via php (or alternatively let the php get the random color and pass it to flash...)
any ideas?
EDIT: just realised the bg color of the movie is of course defined by the webpage its sitting in... so php can handle that.
but how about if i want to pass the rgb value that was chosen by the php into the movie to be used by symbols...?
Random Background And Txt File
I am trying to create a resizable flash file that will act as a background for my html/css website. Within the flash I want to have a script that randomly loads a jpg file from a specific folder on my server as well as a correlating txt file for that background. Here is an example of what I mean.
Say there is a movieclip named "background" and then a dynamic text area named "info" in the lower left-hand corner of the flash movie. I want a script to randomly load a jpg file (say 234.jpg) from a folder named "backgrounds" on the server. I also want it to load the correlating text file into the dynamic text area (234.txt) from a folder named "info". How would I do this and what would the script be?
NOTE: the names of the jpg and txt files would be 1.jpg, 1.txt, 2.jpg, 2.txt, etc.
Thank you for any help you can give!
-- K
Help Random Background Image
Hello guys, i need a hand please!!
Im trying to do a site but with a random backround.. add like 5 different images and make the background fit in the resolution of all computers and every minute make them change with an effect!
please if someone knows how can i do this that is not creating a movie clip symbol with animation cause that wont be random and wont fit in all resolutions.
Thank you guys!!
roth
How To Create A Random Background?
I am trying to create a Xmas crad, which atomatically loads one out of 10 backgrounds randomly. Is there any easy way to do that?
Thanks a lot!
Background Random Appearance
Hi
I am designing a flash area for a website, and what I want is for my small image of a cloud I made to pass across the stage (120 X 400) from right to left, across the stage. However, I would like the cloud to come in at random places, have random speeds, and be random sizes. I have no idea how to approach this. Any ideas would be really helpful
Thanks
[F8] Operation: Random Background?
How can a random background function be made?
I mean Im trying - very hard - to make a game like the game "Tanks", currently Im stuck with programming on the background generating.
By that I mean EASY ways to generate random backgrounds which 'ent too impossible.
Now I dont want to generate the Y position for 400 movieclips (1pixel wide) and then getting the proximity and recheck, reposition. Thank you
THx for any help I could get.
<Tongxn>
Scripting A Random Background... How?
Ok,... another something I want to work out. If you scroll to the bottom of this page (I mean the very bottom... all the way down) You will see a little "kirupa.com" button with loads of little circles that look like they are blowing in the wind....
Its obvious this is tweening through a guide thats repeated... but I want a similar effect. With about 10 circles... I want them to vary in size and "_alpha" on every pass and every time take a diffrent course from left to right... if it is even possible have them follow the mouse aswell.
Thanks again
Merry Christmas <
Chris
Random Background Question...
Hi,
I load a Random Background (for Home) in my movie, all works perfect. My question is:
Wenn I go back to Home (home button), I want to display the same Background that Flash loaded first.
Is there a way to do that?, to assign a variable to the movie that Flash loads?
I used this code to load the random movie:
choice = Math.round(Math.random()*5);
switch (choice) {
case 0 :
myemptymovie.loadMovie("image0.swf");
break;
case 1 :
myemptymovie.loadMovie("image1.swf");
break;
case 2 :
myemptymovie.loadMovie("image2.swf");
break;
And for the home button I use the same code but with:
on (release) {
choice = Math.round(Math.random()*5); …
Thanks for your help…
Random Background Swf Question
Hi all - hope you're all well
I have a question regarding the Random Background image/swf tut.
The AS that does the work is this:
ActionScript Code:
on (release) { choice = Math.round(Math.random()*5); switch (choice) { case 0 : location.loadMovie("image0.swf"); break; case 1 : location.loadMovie("image1.swf"); break; case 2 : location.loadMovie("image2.swf"); break; case 3 : location.loadMovie("image3.swf"); break; case 4 : location.loadMovie("image4.swf"); break; case 5 : location.loadMovie("image5.swf"); break; }}
What I'd really like to do is make sure that on pressing F5 in the browser (IE) the next image is not a repeat of the previous randomly selected image.
Any ideas? (Sorry - me and AS still getting acquainted
Thx for any help.
Random Background Pic Freaking Out
Howdy all,
I have a flash exe on a CD. Every time the project loads it has a new background image. The AS for this works fine. However, every once in a while when the project is loaded the backgound becomes all the images flashing. I have 9 different images in 9 frames of a movie clip (called "theClip") and the AS is:
ActionScript Code:
choice = Math.floor(Math.random()*13); // returns an integer between 0 and 12theClip.gotoAndStop(choice);
So obviously there are times when the AS is being ignored and it's just playing all the frames of the clip. Unfortunately this CD is being given out to potential clients so I really need to find out if there is a way to prevent this from happenning.
Any ideas?
Random Motion Background
I am a very basic flash mx programmer and I am making an animated header for my website. I have started with Kirupa's tutorial on random motion with objects. Now what I want to happen is....
1. I want it to load the random motion.
2. I want it to then have layer above that fades in to a color.
3. I want the random motion to continue in the background while stuff above the transparent color is going. I.E. site name, description, etc.
I have tried create new layers and working on it but the random motion always repeats on one frame. I don't know how you can let the random motion continuely being sent back to frame 1 and have the stuff above it work. Any ideas?
|