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?
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 10-10-2006, 04:03 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Random Background Tutorial PROBLEM
Hi there,
i have followed the Kirupa tutorial for the random bacground image, and it works fine...but not for my liking!!
Basically the tutorial loads up external .swf's that have embedded pics within them.....
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;
}
- the problem is it forces the .swf's with the pictures to load causing the .swf's poping on at the wrong time!!
now my question is, is it possible to elliminate the swfs having to load and instead having it done this way:......
choice = Math.round(Math.random()*5);
switch (choice) {
case 0 :
location.gotoAndPlay(2);
break;
for instance having the picture placed at frame 2??
In conclusion, is it possible to do this effect internally instead of externally??
thnx in advance !!
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
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
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!
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
About Loading Random Movies Tutorial
In the Loading random movies tutorial we make an array specifying each movie that can be randomly picked and loaded. Works well if there are only three movies to choose from.
But what if there are for example hundreds of images or movies you want them to be randomly loaded? Is there a way to not specify each element in the array but to tell the array to find the elements in a specified folder containing all the images and movies?
I would like to make an interface where on the button release 3 random images would get displayed. The library will get increased in size over time so it would be nice that the code could include all the files in the image folder, no matter what and when i add something.
Thank you for your help,
Petra
About Loading Random Movies Tutorial
In the Loading random movies tutorial we make an array specifying each movie that can be randomly picked and loaded. Works well if there are only three movies to choose from.
But what if there are for example hundreds of images or movies you want them to be randomly loaded? Is there a way to not specify each element in the array but to tell the array to find the elements in a specified folder containing all the images and movies?
I would like to make an interface where on the button release 3 random images would get displayed. The library will get increased in size over time so it would be nice that the code could include all the files in the image folder, no matter what and when i add something.
Thank you for your help,
Petra
Help With Tutorial On Loading Random Movies Into Animation--
I got stumped right at the first step - I didn't know how to create a movie and set it's width and height! - How silly is that - how do i create a movie? Do I create a new Flash Document? Here is the first step of your tutorial that I was about to follow - thanks!
Here's How
The following steps for Flash MX/2004 will help you to create your own animation and load random movies into it:First, create a new movie, and set its width and height to be 300 by 200 pixels. Also, set your frame rate to 25.
Loading A Random Image Tutorial Question
This post is refering to this tutorial on this site:
http://www.kirupa.com/web/random_image.php
I understand how to create and modify the php page, but I don't know what code I should
use in my flash movie to call the php file into my movie clip.
Can anyone help?
Thank you, Chris
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
Help With A Changing Background Tutorial
I'm sorry but I've already gone color-blind trying to duplicate this tutorial:
http://www.flashkit.com/tutorials/Ge...-526/index.php
Somehow no matter how many times I've tried to do it on my own (using Flash5 btw) and even downloading the .fla I can't for the life of me...make it to work. As for the downloaded fla...well it works...but the tutorial messed up how I view the .fla......
I mean I think the tutorial steps is missing something...or maybe I really just suck at this??? Can anyone please check before I turn into a
Looping Background Tutorial
im looking fora looping background tutorial, when i say looping background i mean like loony Toons background thing where the character looks like hes moving againsts a moving background that just goes over and over
Looping Background Tutorial
im looking fora looping background tutorial, when i say looping background i mean like loony Toons background thing where the character looks like hes moving againsts a moving background that just goes over and over
Moving Background Tutorial
Hi,
I am looking for a tutorial that when you move the mouse over the screen it will move the background, so if I move the mouse left I want to the background to scroll right, and if I move my mouse up I want it to come down a bit.
I did find a basic tutorial for something like this,
http://www.jesseharding.com/blog/200...ouse-in-flash/
but I would also like the option for it to ease in and out, so it doesn't suddenly stop when the mouse stops.
I had a quick look in the sites tutorials and couldn't find one, if anyone has one, please link it to me.
Thanks
V
Duplicate Background Tutorial
Hey there,
I'm trying to fill a movieclip with a seamless pattern, so in essense its pretty much the same as Kirupa's Duplicate Background tutorial. I'm having trouble converting the AS from filling the background to filling a movieclip
Here's the original code:
ActionScript Code:
tileBG = function () { tile_width = 34; tile_height = 34; // x_max = Math.round(Stage.width/tile_width); y_max = Math.round(Stage.height/tile_height); trace(x_max); trace(y_max); for (x=0; x<=x_max; x++) { for (y=0; y<=y_max; y++) { bg = _root.attachMovie("square", "bg"+x+y, this.getNextHighestDepth()); bg._x = tile_width*x; bg._y = tile_height*y;}}}; tileBG();
I've tried replacing _root with the name of my clip, but that didn't seem to do the trick, if anyone can point me in the right direction I'd appreciate it
J.
Tiled Background Tutorial
Hi guys,
Great tutorial on http://www.kirupa.com/developer/flas...und_flash8.htm
How do you make it update to always fill whatever size the movie is dragged to?
Tree Background Transparency With Lee's Tutorial
I've created a tree via the tutorial I found on this site that Lee put up as a video. I'm trying to incorporate that UI with a transparent background so only the folders and links are visible in the list.
I've seen others paste code that deals with the transparent background however I'm not entirely sure how to incorporate that into the way Lee showed the method in the XML tutorial on this site.
Any help would be appreciated,
Thanks!
Dennis
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
Document Background Fade (pixelwit.com Tutorial Help)
http://www.pixelwit.com/temp/colorfa...rial/home.html
I have my site set to fade between colors for multiple objects utilizing the scripting provided by the above site. Everything works perfectly, but I've run into a challenge. I am trying to get the document background (HTML, not Flash) to change colors evenly with a particular object in the Flash movie. I am trying to call a javascript function using GETURL each time the colorchange function changes the object's color, so that the fade is equal within the flash movie and on the document background.
I have modified the "transshift" function in the pixelwit code to do this, below is my code. The color change happens, but not gradually like the object's color does. The object fades colors, and at the end of the fade the document bg jolts to the new color. Any ideas?
Color.prototype.transShift = function(){
//trace("Running");
var ratio = (getTimer()-this.v.startTime)/this.v.milSecs;
if(ratio<1){
var newTrans = {};
for(var i in this.v.change){
newTrans[i] = this.v.startTrans[i]+ratio*this.v.change[i];
}
this.setTransform(newTrans);
color1=new Color(_root.rightfade);
taco=color1.getRGB().tostring(16);
trace("taco RGB="+taco);
_root.GetURL("javascript:changeBG("#" + taco + "")");
}else{
this.setTransform(this.v.goalTrans);
clearInterval(this.v.intrvl);
var myFunc = this.v.func;
delete(this.v);
if(myFunc)myFunc();
}
}
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
|