Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Loading A Random Background Image With A Preloader



helloI'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..



KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 12-12-2006, 01:44 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[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 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);

How To Incorporate The Loading Random Image Into The AS Preloader Tutorial?
How can I incorporate the loading a random image into this tutorial: http://www.kirupa.com/developer/acti...cliploader.htm

I've tried already, but can't get it to work. Could someone tell me how to do this, by modifying the AS in that tutorial?
Thanks!

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

Random Background/image
what is the procedure to show a random background or navigation for my site? Thanks

Random Background Image Freaking Out?
Hi,

I have a movie clip with 9 frames. Each frame has a different image. Then I have AS to generate a random number and go to that number frame when the project is loaded (the whole thing is an exe on a CD by the way but the problem occurs whether I'm running it off my hard drive or the CD). It works great MOST of the time. The problem is that once in awhile when you load the project the random generator code seems to be ignored and all the images flash by, looping over and over. You have to close the project and relaunch to get it to stop.

Is there some way to fix this problem? This CD will be going to potential clients.

Thanks!
TS

Load A Random Background With Preloader
I've searched the site, and it looks like a lot of people have the same problem, but I couldn't find any answers. The load a random background tutorial is great, but it doesn't work with my preloaders. Does anyone know how to modify it so the preloaders on the SWFs being radomly loaded work?

Much obliged.

Tile Background, Random External Image/swf
Hey all,

First post!
Anyways, I've been browsing around for a random tiled background and pieced together some components you guys have written, however its not working correctly?

The image(s) loads in the blank mc (named bc), however it does not tile?

loadMovie("bg_"+(Math.floor(Math.random()*3)+1)+". swf", "bg");
bg._visible = false;
w = bg._width;
h = bg._height;
y = _y;
for (iy=0; iy<20; iy++) {
x = _x;
for (ix=0; ix<24; ix++) {
n = "bg"+(iy*24+ix);
duplicateMovieClip("bg", n, 1+(iy*24+ix));
_root[n]._x = x+w/2;
_root[n]._y = y+h/2;
x += w;
}
y += h;
}

Any suggestions?

Random Fullscreen Background Image On Refresh
Hi there, I have flash site and client wants random fullscreen background image to load on refresh. sounds easy right ?. but i've tried a lot of components and code snippets but it's causing headaches as nothing seems to work. i have a client squirming because it isn't done and i was wondering if you could help me out.

I did purchase a component from flashden (randombgholder) which does exactly what i want, but it seems to clash with the flashloaded fCMS system i have working in place, and somehow knocks it out, but that could be my bad amateur flash coding causing it. And when i go to center the swf over the background using his code he provided it goes haywire.
perhaps i could do a random fullscreen background image on page refresh in html?? i tried some css ones, but nothing works probably because i'm very new to flash and the likes.
links to tutorials or someone i could even pay to do this - anything really appreciated.
THanks in advance, Angie.

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

Background Image With Preloader
Hi,

I'm using a background jpeg which scales to fit the browser window automatically. I want to add a preload bar to show the user that it's loading. When I add one the following code doesn't seem to work. Does anyone know how to add a preloader. An example I have seen is on http://www.hi-res.net

Thanks

PHP Code:



Stage.scaleMode = "noScale";
Stage.align = "TL";
this.onResize = function() {
    this._width = Stage.width;
    this._height = Stage.height;
};
Stage.addListener(this);
this.onLoad = this.onResize; 

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!

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

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

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 Image Preloader
Does anyone know how to do a random preloader. Basicaly how it would work is the closer it got to completing its load, the more the stage would fill with randomly placed images from the library. Does anyone have a easy solution?

In AS 1.0

Loading SWF On Background Image?
Hello all,

I need to have a photo slideshow play on the home page of a resort site, but I'm afraid the content will be heavy and I don't want to show the preloader.

Is there a way to have a background image in a table and then load the SWF on top of it? Does this involve DHTML layers?

Thanks in advance!
Robert

Random Image Generator With A Preloader
On the banner of my website, i'm trying to have images rotate randomly upon refresh, but cannot figure out the best/easiest way to set it up.

Question 1: can i keep the preloader and the images in one timeline?

Question 2: Would using separate scenes for the preloader and the images help reduce my loading time?

Background Image Loading Timer
Here it goes : I have a 4 x 3 grid which contains 8 MC's with images (jpg's). The 4 remainder grids cells are buttons. So here's the tricky part for which I need some help

Each of the 8 'image' cells needs to hold 8 different images (total of 64 images) which I load from the server. Each button action will trigger two 'image' cells to bring up a new image but in random. How do you call up a random image in the specific MC using AS ?

Thanks,
Smalco

Help Loading Image Background As MC /multiple MC's
Hello.This is really a two question post . but the first quesion is more important.
1. I am using this code to load a background.
photoclip.loadMovie("stripes.jpg");

I have an empty movie clip on stage. I have given it the instance name photoclip. It is positioned in the upperleft hand corner.
The issue is that the background appears but the only partially.
how do I load a background dynamically and get the full dimensions of the image to show up? Also are there ways to tile backgrounds like you can do in CSS?

2. Ideally I'd like to have a whole bunch of empty movie clips and load images into them. Is it possible to have multiple Movie clips on the stage that are different instances of the same object? I want each of these movie clips to load different images. I know i could just put the image in the MC but I think loading trthem dynamically will make for a smaller flash file.


I am using flash 8 and have very limited experience.
Thanks in advance,

Loading Background Image OnMouseOver, Etc.
I'm try to solve this problem, but it seems too dificult for me... So, any help or clue are welcome!

Let me decsribe it!


I have movie that has two different images... When the movie is loaded and reach the end, I have large button that onMouseOver effect has new image (smiling girl).

The problem is that I want her to smile all the time while the mouse is over animation. That should includes the case when someone trys to type something and finally press small button to submit data. But when mouse cursor is not rolling over she should stop smiling...

The problem is that it's simple to have her smiling in every other case, but when the event as described occurs, she stop simling..

I try several solutions that came up in my head, such as attachMovie, createEmptyClip, different depths, rollOver/out etc, but it seems that I haven't bright idea what i should do i order to get the expected result.

So, please help me! It's pretty urgent...

http://img219.imageshack.us/my.php?i...utmovieof5.swf

Loading Background Image OnMouseOver, Etc.
I'm try to solve this problem, but it seems too dificult for me... So, any help or clue are welcome!

Let me decsribe it!


I have movie that has two different images... When the movie is loaded and reach the end, I have large button that onMouseOver effect has new image (smiling girl).

The problem is that I want her to smile all the time while the mouse is over animation. That should includes the case when someone trys to type something and finally press small button to submit data. But when mouse cursor is not rolling over she should stop smiling...

The problem is that it's simple to have her smiling in every other case, but when the event as described occurs, she stop simling..

I try several solutions that came up in my head, such as attachMovie, createEmptyClip, different depths, rollOver/out etc, but it seems that I haven't bright idea what i should do i order to get the expected result.

So, please help me! It's pretty urgent...

http://img219.imageshack.us/my.php?i...utmovieof5.swf

Help On Loading Background Image From Css In Flash 8
i need help on how to load a background image from a css to flash 8...HELP!!!can someone please show me step by step and the codes that i need to do...

Loading Background Image OnMouseOver, Etc.
I'm try to solve this problem, but it seems too dificult for me... So, any help or clue are welcome!

Let me decsribe it!


I have movie that has two different images... When the movie is loaded and reach the end, I have large button that onMouseOver effect has new image (smiling girl).

The problem is that I want her to smile all the time while the mouse is over animation. That should includes the case when someone trys to type something and finally press small button to submit data. But when mouse cursor is not rolling over she should stop smiling...

The problem is that it's simple to have her smiling in every other case, but when the event as described occurs, she stop simling..

I try several solutions that came up in my head, such as attachMovie, createEmptyClip, different depths, rollOver/out etc, but it seems that I haven't bright idea what i should do i order to get the expected result.

So, please help me! It's pretty urgent...

http://img219.imageshack.us/my.php?i...utmovieof5.swf

Loading Of Background Image From CSS To Flash 8
Hiya, I need to load background image from css to flash 8. Is this possible and if possible, how am I going to do it? Can anyone pls help me and greatly appreciated if u could show me the actionscript on how to do it. Thanks alot!

Loading Background Image OnMouseOver, Etc.
I'm try to solve this problem, but it seems too dificult for me... So, any help or clue are welcome!

Let me decsribe it!


I have movie that has two different images... When the movie is loaded and reach the end, I have large button that onMouseOver effect has new image (smiling girl).

The problem is that I want her to smile all the time while the mouse is over animation. That should includes the case when someone trys to type something and finally press small button to submit data. But when mouse cursor is not rolling over she should stop smiling...

The problem is that it's simple to have her smiling in every other case, but when the event as described occurs, she stop simling..

I try several solutions that came up in my head, such as attachMovie, createEmptyClip, different depths, rollOver/out etc, but it seems that I haven't bright idea what i should do i order to get the expected result.

So, please help me! It's pretty urgent...


http://img219.imageshack.us/my.php?i...utmovieof5.swf

More On Background Swf Loading *or* PRELOADER OF A PRELOADER
Deja vu, but here we go! I asked this before, but I'm still not quite there. I can guess you can call this post HOW TO MAKE A PRELOADER OF A PRELOADER! lol...

Here's the setup. I have 3 swf files burned off. In other words, I will have a main movie with two buttons that will load each of the other two (depending on which button is clicked) with the "loadMovie" action. I have a preloader setup for all the movies. So, when button one is clicked it will load the first swf into level 1, etc and the preloader animation will run until it's loaded...etc. for the other swf and button.

Now, that's the setup, here's what I'm looking to do.
Is there a way (on the main stage) to set an action that will start the loading process of the other two swfs (that the buttons activate)"in the backgroud" BEFORE the buttons are pressed. In other words, I want to start the loading process before anything is done and then when the button is clicked, what hasn't been loaded, if any, will finish off with the preloader animation going.
TWO THINGS:
1) I want to do this with multiple swf's (as explained above) NOT one huge swf with all the scenes.
2) Even if the swfs finish before a button is clicked, I want them to just "sit there" invisible until a button is clicked. I know that I can achieve the invisible effect by leaving the first frame of each loaded swf blank and applying a stop action.
3)The clips that I will be loading are the same size of the stage, therefore, will be covering up the main timeline completely (an "unloadMovie" action is put into a button to get back to the main timeline which acts as a "back" button of sorts).

Well, that's about it. I hope I explained it thouroughly enough. Some extra info....on the main timeline I have the preloader on frame 1 (an anonymous one, it works for any timeline of any scene or swf that I put it on), then my "main" page on frame 2 (the one with the two buttons).

Thoughts and impressions:
Should I load each of the swf's into their own movie clip in level 1? I don't know if this would make a difference, but I'm throwing it out there for comments!

Random Image Loading
hi there,
im trying to figure out/ write a script, so that everytime a user were to hit refresh, the swf would display a different image.

im assuming i would have to select a number by using random(5)
and then associate that number to a movieclip or scene.

if anyone has info or insights on how to go about this, i would really appreciate it.

an example of what i am talking about is here:
http://www.onenine.com/flash.html

thanks in advance -
jennifer

Random Image Loading
Hi, firstly what to say I tried to find the answer in other theads and forums, but no succes...
hope someone can help

I'm creating a page that every time it goes back frame 1 a new image is loaded in a empty MC. I used the following code:

pic_arr = ["dynamic/image_big_A.jpg",
"dynamic/image_big_B.jpg",
"dynamic/image_big_C.jpg",
"dynamic/image_big_D.jpg",
"dynamic/image_big_E.jpg",
"dynamic/image_big_F.jpg",
"dynamic/image_big_G.jpg",
"dynamic/image_big_H.jpg"];ranNum = random(pic_arr.length);
image.loadMovie(pic_arr[ranNum]);

It works! The PROBLEM is that it repeats itself, wich is something i would like to stop, at least not to see the last one shown again. Any suggestions?

__________________________________________________ _______________________
Thanks god for this forums, if not I wouldn't got as far anyway

Random Loading Image
Im trying to create a Dynamic slideshow that loads an image fades it out and loads another.

This is my code thus far. I can get the image to load but its not random.

Code:
function loadImages(amount:Number) {
for (var i = 0; i<amount; i++) {
var sURL:String = "images/0"+i+".jpg";
randImage = Math.floor(Math.random()*sURL.length);
holder.loadMovie(sURL);
}
}
loadImages(1);

Loading A Random Image
I need some help loading a random image into a movie clip.
I'm creating a flash presentation for my band with a script generated moving banner across the top of the presentation.
I have had help with a script which sends a movie clip in a repeating pattern from left to right on the stage. I wish to load an image into the clip with a different image into the following clip and so on.

I have attached the .fla file for someone to help me with.
This is not the presentation, just a mock up of what I'd like done.

I would really appreciate the help.

Random Image Loading
I've want to display 2 random images on the same page from a directory that has 5 images in it.

I got the random part, but I can't get the pics to load simultaneously. Can someone point out what I did wrong?


Code:
Array.prototype.pickRandomValues = function(n) {
var selected = [];
for (var i = 0; i<n; ++i) {
var r = Math.floor(Math.random()*this.length);
selected.push(this[r]);
this.splice(r, 1);
}
return selected;
};
loadMovie("img/"+pictures_array.pickRandomValues(1)+".jpg", "container_mc");
loadMovie("img/"+pictures_array.pickRandomValues(1)+".jpg", "container_mc copy");

Loading A Random Image
Hi all,
I refer to the tutorial on Loading a Random Background but what if I want to make my images randomly appear on top of each other on the click of a button just like the jackpot?

Random Image Loading Via XML
i'm trying to randomly load images via xml but my output window keeps saying "undefined".

can somebody help me please?


Code:
function loadXML(loaded){
if(loaded){
xmlNODE = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total;i++){
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
}
randomImage();
}else{
content = "file not loaded!";
}
}
xmlData =new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("bg.xml");

p = 0;
function randomImage(){
if(loaded == filesize){
p = Math.floor(Math.random() * total);
bgholder._alpha = 0;
bgholder.loadMovie(image[0], 1);
}
}

Loading Random XML Image
I've got external jpgs loading into my flash via XML the same as this:
http://www.kirupa.com/developer/mx20...togallery1.htm

However, I want the images to load randomly. So unlike the above tutorial, I want it to load a random image each time the user visits it.

Also, I do not need a next and previous button, but one single button which refreshs the movie with a new random image.

Does anyone know how adjust the actionscript/xml to do this?

thanks.

Loading Random Image
I want to make a button that loads a random image in a new window. Is this possible?

Loading A Random Image
Hi all,
I refer to the tutorial on Loading a Random Background but what if I want to make my images randomly appear on top of each other on the click of a button just like the jackpot?

Random Image Loading Via XML
i'm trying to randomly load images via xml but my output window keeps saying "undefined".

can somebody help me please?


Code:
function loadXML(loaded){
if(loaded){
xmlNODE = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total;i++){
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
}
randomImage();
}else{
content = "file not loaded!";
}
}
xmlData =new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("bg.xml");

p = 0;
function randomImage(){
if(loaded == filesize){
p = Math.floor(Math.random() * total);
bgholder._alpha = 0;
bgholder.loadMovie(image[0], 1);
}
}

Random Image Loading
Hi.
I'm building a Web site completely in Flash. On the home page along with some text I would like to load a random product image that is for sale. The text on the home page needs to stay the same, but the product image and product description as well as the "buy me" button need to load randomly so every time a user logs in he/she sees a different product. Any suggestions or links to tutorials would be very much appreciated. Thanks in advance.
Ivan

www.foundation-one.net

Random Dynamic Image Loading
Objective: create a movie that dynamically loads random images and changes to another image after a period of time, while having an "in-between" fade transition (between images loaded).

I'm able to dynamically and randomly load images to my flash project, and have even gone so far as to randomly choose an image from a folder. However, with random(), you have to specify the amount to be 'randomed' and if the number of images are too little, an error will occur saying it can't find the specific image.

Additionally, suppose in the future I want to add more images without messing with the Flash file, how am I going to come up with a script that's going to allow flash to find the images? Coz at this moment if I don't alter the flash file by adding the number of images, then it won't find the new images.

-oxy

Dynamically Loading A Random Image
I'm sure this is really easy and I'm going to kick myself when someone shows me but I've got out of practice with Flash (not that i was a master or anything in the first place).

Basically I am trying to dynamically load one of three images, selected at random, into a movieclip when a button is pressed.

I think it should be something like this:

button1_btn.onRelease = function() {
randNum += random(3);
loadMovie("images/[randNum].jpg", box1_mc);
}

Although now of course it is looking for an image called [randNum].jpg - rather than using randNum to select an image. Where am I going wrong?

thanks for your help

Naomi

Help With Random Image Loading Script :(
I am trying to make a random image loading script .. the catch is that i want to read the url from text file

concept is that a screen will be showing different names of games and when a game is highlighted its screen shots will be displayed, now screen shots url would be picked from the text file called path.txt

path.txt would be something like

&game1a=c:picsabc1.jpg
&game1b=c:picsabc2.jpg
&game1c=c:picsabc3.jpg
&game2a=c:picsdef1.jpg
&game2b=c:picsdef2.jpg
&game2c=c:picsdef3.jpg

now i want to read one variable at a time and load that image for around 3 seconds and than load the other one and so on ..

i can easily import text files and read from them but when i try using them nothing happens for instance i made a text file called test.txt which had

&myText=1

i did

myData = new LoadVars();
myData.load("test.txt");

now i can read that data in a dynamic text field but when i try to use the value in loading image like

loadMovie ( myData.myText + ".jpg",image);

image does not loads

but when i do

a = 1;
loadMovie ( a + ".jpg",image);

image loads up

when i try assigning value to some other variable like

a = myText;
or
a = myData.myText;

still nothing happens

can someone tell me where i am going wrong here?

Copyright © 2005-08 www.BigResource.com, All rights reserved