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




Random Images



Hi!
I´d like to do something (Flash 5 and MX) like in www.vcdesign.com but with differences:
- the images show up random, from left do right and right to left, with diferent alphas
- from x in x second, one of that images (random) fade up to the center, followed by a descriptive text;, the user click on and open another page.

Please, someone!!!! I need that script!!!!

Thank you
Regards
xudito@hotmail.com  



Tek-Tips > Adobe(Macromedia): Flash Forum
Posted on: 9 Sep 02 10:07


View Complete Forum Thread with Replies

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

Load All Images From The Images In 1 Folder (named By Random Number)
Hi Guys,

I've got a gallery style viewer, you click on an image and it enlarges. It pulls in images which are numbered 1 to 12 in a folder called 'images'. I want it to pull in randomly numbered images instead. so i suppose i want it to search the folder for images named 1.jpg up to 1000000.jpg and pull them in.

I've uploaded it to: www.dhardy.co.uk/gallery.zip as it'll become clearer then!

Thanks in advance! dave.

Help With Unique Random Images - Multiple Images At A Time
Ok so what i would like to do is set up a page that has 36 images on it. But every time anyone goes to the site i want them to show up in random order. I have jpgs they are all labeled 1.jpg, 2.jpg 3.jpg and so on. I have used code that pulls the images form a folder that the swf isnt in like /images/1.jpg. So what im saying is i want to pull them externally. Any one have any ideas on how to do this?

Random Images + Random Timing
Is it possible to display random images, along with a unique amount of air time for each image?

I have a section that will display a company logo for a particular amount of time, according to its sponsorship level – being either 20, 10, 7, or 5 seconds.

Approximately 20 images are being used (JPEG, at 240px wide x 200px tall).

Random Images, Random Positions?
Hey there.

I want to add some depth to my background and what I was thinking was to have a simple animation appear at random each time a differant size, position angle ect, and if possible have it attach the animation more the once at a time.

Cheers.

Random Images
I want to load a random image into my flash movie.
Obviously download speed is a main priority and by that token, i don't want to have to load up all the images to be chosen from in order to display one random one.

What is the best way of doing this in flash?

Random Images
Hi guys.
I'm new at actionscript and am struggling with something that I hope someone can help with.

I have a map of the world made of 2 colours - green for the land and blue for the sea (imaginitive, eh?!)

I want to randomly make houses appear on the map, but only appear on the land.
I can generate the houses okay, but how do I make sure they only appear on land?

Thanks in advance for any help you can offer.

Regards,
Damian.

Random Images
This is driving me crazy. I am trying to recreate an effect found at the following website:
http://www.sentinelpartners.com/seco...news/index.htm

In this effect, each time a user loads a page, a different image will appear on the left side; the picture has an animated flash or swish text on top of the picture. On the page I am developing, I want to load both a random picture AND a random animated text quote. I have already developed a MC that will randomly load the quotes; of course, that text MC is very small. But a similar MC I developed for the pictures is way too large and causes an unacceptable delay in the page loading. I need a MC that will randomly load a .jpg (or swf files if I convert the pix to swf) from a specific directory (call it sflash). The webpage itself will have a flash file that uses the loadMovie function to load the pix MC and then the text MC. So... how do I create an MC that will randomly load my pix (1-14) from the external file sflash? Thanks in advance. KD

Random Images
hi there

i have six mc'c that i want to randomly display and have used this code

gotoAndPlay(random (7));
if (_currentframe==1) {
gotoAndPlay(random (7));
}

this works fine but sometimes the random code above displays what i have just seen, is there an easy way to make these six movies randomly display without displaying what has just been displayed?

many thanks

tasvino

Random Images
I have 20 images that i want to rotate in and out randomly with a fade effect on each. How would i go about doing that. They will all be in a row in a flash movie that is 775x397. Thx in advance.

Random Images
I have heard that in Flash MX is now possible to do random images. I know how to random swf files, but the life of my I can not find any documention on how to the random images. Where do I need to look?

Thanks
Tim

Random Images
Hey,

I figured out how to load random images in Flash MX, but the image loads on top of everything. How you keep that from happening? Does it have something to with the location?

Here is the code I used.

Code:
onClipEvent (load) {
ran = Math.floor(Math.random()*9);
loadMovieNum("files/"+ran+".jpg", "");
}
Here is an example.
Here is the fla file.

Thanks
Tim

I Need Some Help With Random Images.....
I'm working on a project which involves randomizing multiple pictures. My client wants these to be in a random loop rather than a standard timeline order but I'm having a hell of time getting an action script created to do this.... can someone help me out?

I have 4 photoshop file each containing 4 seperate images 1-2-3-4

When the number one image transistions to another image, it should transition to another number 1 image - from the next photoshop file. the number two to a number two - three to three until all images are used. This should be random, not one after another. I'm having a problem in flash changing the lineup and the order of the transitions. Each transition need to hold unchanged for 2-3 seconds until the next one changes. I'd like to keep all the images grouped - in other words, one at a time, the images in flash1.psd would all transition to the images in flash2 and then all would change to flash3 and so on until flash4.

Help!! please???

Random Images
The code below is suppose to load randomly select jpgs but doesn't work. Any suggestions?

//
randomLoad = Math.round(random(5));
myPic = "newPic" + randomLoad +".jpg";
emptyClip.loadMovie(myPic);

Random Images
hey everyone, how can I make random images everytime a user refreshes the page?
I have about 10 images I would like to use.
Thanks everyone.

Random Images
I am working on a client update. Right now they have a slide show of 3
images but they want to have the images rotate. One goal is to have the
model image appear randomly (one of the three) on each load.

I know there is a javascript with this function in HTML. Does anyone
have the code for this for Flash MX?

TIA

Random Images
Hello Guys,

it there an easy way, to make a random images each time a user is login on the main page of the site. I'm using Flash MX 6, and I'm really not good for coding , any help will be really appreciated,

cheers,

Random Images?
My client requested a simple movie that shows 3 images in a row but randomly switches out the images from a library of about 20. What would be the best way to do this? Thanks!

Random Images
Hey,

I have 10 images which I want to use in a header. But I do not want all 10 showing at the same time, what I want to be able to do is, have an image showing, then randomly it fades out, and another one fades in. Does any one know a simple actionscript for this?

Thanks,
Paul

[F8] Random Images
Hey,

After looking for hours on how to find some ActionScript that will load a random image and display is for me, I found a post on this forum with the folling script.

I am a newbie to AS and eager to learn, however I would like to adapt this cool script to be able fade in an image everytime a random is displayed. Does anyone have any ideas to point me in the right direction?

The script:


Code:
// create array to hold images, add more if needed
var picArray:Array = new Array();
picArray[0] = "http://www.google.com/intl/en/images/logo.gif";
picArray[1] = "http://us.i1.yimg.com/us.yimg.com/i/ww/beta/y3.gif";
picArray[2] = "http://wwwimages.adobe.com/www.adobe.com/images/shared/product_boxes/112x112/box_fl8pro_112X112.jpg";
picArray[3] = "http://www.adobe.com/images/shared/product_boxes/112x112/box_studio8_112X112.jpg";

// set random number range so that it won't exceed
//the number of images in picArray
var randomRange: Number = picArray.length;

// generate random number
function genRandomNum(num) {
num = Math.floor(Math.random() * randomRange)
return num;
}

// create mc to hold images
this.createEmptyMovieClip("mcImage", getNextHighestDepth());
mcImage.createEmptyMovieClip("mcHolder", mcImage.getNextHighestDepth());

// every time you press the image, it'll load a new image. You can remove
// this function if you wish.
mcImage.onRelease = function() {
trace(picArray[genRandomNum(x)]);
mclLoader.loadClip(picArray[genRandomNum(x)], mcImage.mcHolder);
}

// init ## Load a random image when swf is first loaded.
var mclLoader:MovieClipLoader = new MovieClipLoader();
mclLoader.loadClip(picArray[genRandomNum(x)], mcImage.mcHolder);

Random Images
Hey guys,

this is my first post for actionscript.org, was needing alittle help with this-
could someone please be able to do two(or one thing if you can)
1. in the following code

choice = Math.round(Math.random()*2);
switch (choice) {
case 0 :
location.loadMovie("image0.swf");
break;
case 1 :
location.loadMovie("image1.swf");
break;
case 2 :
location.loadMovie("image2.swf");
break;
}

could anyone tell me how to count how many swf there are in a target folder

and putting the value in like this
choice = Math.round(Math.random()*ValueCalledin);

instead of listing all the files and

2. set a limited time for that swf to play before it calls in the next random swf

im my very unexpert like way i thought (im a total AS beginner) that the script may look something like this

this.location = "Myfolder/";
choice = Math.round(Math.random(".swf")*value);
switch (choice) {
case random :
this.location.loadMovie(".swf");

for the first bit, i dont know lol
dont laugh too hard at my attempt lol
cheers
MCKTJ
__________________

Random Images
I created a flash piece with three images that rotate. So first image1 is displayed, fades out and then image2 displays, fades out then image3 displays, fades out, then image1 displays, etc...

What Im trying to do is when the application first starts it will randomely select one of the three images to start on. I plan on using the Random command to handle this but I am unable to figure out the actionscript command that I use in order to go into a function. I tried using OnStart and OnLoad but that didnt work. Any suggestion?

Random Images
Hi,

I am loading images into flash from a mysql database using php, can you code it so that a random image is selected from a table when you press a button in flash?

thanks

Gavin

Random Images (Help)
So.. I've changed the size of my site (most of you won't know what it looked like anyway) and it fits perfectly with some (cropped) photos of mine.
But that's not really the point, I want the image to change every time you load the page up (visit or reload the page).. I've tried making something like

if (_root.pic = 1) {
this.stop
}
if (_root.pic = 2) {
this.gotoAndStop(2)
}
if (_root.pic = 3) {
this.gotoAndStop(3)
}

'Cept I don't know how to make numbers random either...

(but I did try
_root.pic = random(3);
Which didn't work.)

So, can anyone help?

Random Images
Hey guys, I don't know if this has ever been asked before. Can anyone help me out or point me in the right direction on how to display random (unique) images using the slide show from this tutorial (http://www.kirupa.com/developer/mx20..._slideshow.htm)? Thanks!!

Is This Possible? (Random Images)
I am pretty new to actionscript, but I am trying to learn as much as I can. I have an idea to make a flash movie that loads 25 random pictures (5 pictures by 5 pictures). Also, somehow, after 5 seconds or so, I want to have a random (any of the pictures) to change into another random picture. Is that possible, too? What I would love to do is specify the folder where the pictures are, so that I can select any picture of the 200 or 300 or 400 pictures that are in that folder. Is that possible? I have been seeing so many times in the XML files that the pictures are already specified, meaning that no other pictures could be added with out altering the file.

If I am going to be able to do this, I need to know how to:

1. load 25 random pictures

2. after 5 seconds or so, have 1 picture change... and keep the process repeating.

3. If I am loading pictures from a folder in a computer, I wont change the attributes of the pictures. Is there a way in flash so that it would automatically adjust the size of the pictures. Does the "scale (matrix.scale)" have anything to do?

4. Will I have to make 25 individual "movie clips" and name them holder0, holder1, etc... to hold each file?

If anyone knows where I can read about any of this, that would be great.

Thanks in advance,

Evan

Random Images From XML
Hi there...this is my first post on the forum - only from searching around the forums (and failing) and trying my best to find an answer have i resorted to asking for help.

Below is the AS for an infinite slide menu which calls images from a location into a sequence (the original FLA is from these very forums). What i've been trying to do is randomly load the images referenced from the XML into the newThumb container but still keep the functionality of the infinite menu. Could anyone take a look and possibly enlighten me on how i can come about this?

The code:


Quote:




stop();

//////////XML
descriptions = true;
alert._visible = true;
var ease = 5;
thumbs = new XML();
thumbs.ignoreWhite = true;
thumbs.load("thumbs.xml");
thumbs.onLoad = function() {
root = this.firstChild;
total = root.childNodes.length;
displayNum = Number(root.childNodes[0].attributes.displayNum);
separation = Number(root.childNodes[0].attributes.separation);

//////////settings
w = Number(root.childNodes[0].attributes.w);
h = Number(root.childNodes[0].attributes.h);
mask._width = (w+separation)*displayNum;
mask._height = h;
mask._y = 20;

thumbnailer._y = 20;

cont._x = w/2;
cont._y = h/2;

//////////button positions
forward._y = 90.5;
forward._x = mask._width;
back._y = 90.5;
back._x = (mask._width-mask._width)+16;

mcs = [];
for (i=0; i<total; i++) {
mcs.push(i);
newThumb = thumbnailer.container.duplicateMovieClip("containe r"+i, i);
with (newThumb) {
_x = (w+separation)*i;
preloader._x = w/2;
preloader._y = h/2;
block._width = w;
block._height = h;
}
var image = root.childNodes[i].childNodes[0].firstChild.nodeValue;
newThumb.desc = root.childNodes[i].childNodes[1].firstChild.nodeValue;
newThumb.link = root.childNodes[i].childNodes[2].firstChild.nodeValue;
newThumb.cont.loadMovie(image);
newThumb.onRelease = function() {
getURL(this.link);
};
if (descriptions) {
newThumb.onRollOver = function() {
alert.desc = this.desc;
alert._visible = true;
};
newThumb.onRollOut = function() {
alert._visible = false;
};
}
}
//
var offset = total-1;
var dest = 0;
var increment = w+separation;
var ending = (total-displayNum)*(w+separation);
var lastmc = total-1;
var firstmc = 0;



back.onRelease = function() {
if (dest<0) {
dest += increment;
} else {
first = mcs[0];
for (k=0; k<total; k++) {
mcs[k] = mcs[k+1];
}
mcs[total-1] = first;
thumbnailer["container"+lastmc]._x = -(w+separation);
firstmc = lastmc;
//check whos new lastmc
for (k=0; k<total; k++) {
if (mcs[k] == (total-1)) {
lastmc = k;

}
}
}
}

forward.onRelease = function() {
if (dest>-ending) {
dest -= increment;
} else {
last = mcs[total-1];
for (k=1; k<total; k++) {
mcs[total-k] = mcs[total-k-1];
}
mcs[0] = last;
thumbnailer["container"+firstmc]._x = (displayNum)*(w+separation);
lastmc = firstmc;
//check whos new firstmc
for (k=0; k<total; k++) {
if (mcs[k] == 0) {
firstmc = k;
}
}
}
}
//movement
onEnterFrame = function () {
for (j=0; j<total; j++) {
thumbnailer["container"+j]._x += (dest+(mcs[j])*(w+separation)-thumbnailer["container"+j]._x)/ease;
}
alert._x = _xmouse;
alert._y = _ymouse;
};
};




Many thanks!!!

Random Images
Hi
I would like to be able to load a number of images, one after another on screen. each image will be visible for a set length of time (I would like to speed this up or down at a later date) Also I would like the option of making the images fade from one to the next.
Can any one help?

Random Images (Help)
So.. I've changed the size of my site (most of you won't know what it looked like anyway) and it fits perfectly with some (cropped) photos of mine.
But that's not really the point, I want the image to change every time you load the page up (visit or reload the page).. I've tried making something like

if (_root.pic = 1) {
this.stop
}
if (_root.pic = 2) {
this.gotoAndStop(2)
}
if (_root.pic = 3) {
this.gotoAndStop(3)
}

'Cept I don't know how to make numbers random either...

(but I did try
_root.pic = random(3);
Which didn't work.)

So, can anyone help?

Random Scrolling Images
How can i make 1 image appear in many different opaques and sizes slide across my movie.. Its some sort of actionscripting but i cant figure it out... Let me know


OrBiX

Random Loading Of Images
i use this actionscript to randomize the loading of an image that represent the background of my site;

_root.a = random(4);
if (_root.a=0) {
_root.loader.loadMovie("pfbg001.jpg");
}
if (_root.a=1) {
_root.loader.loadMovie("pfbg002.jpg");
}
if (_root.a=2) {
_root.loader.loadMovie("pfbg003.jpg");
}
if (_root.a=3) {
_root.loader.loadMovie("pfbg004.jpg");
}

it doesn't properly works... is there anybody who can help me? thx!!!

Random Images On Refresh
I've seen the effect done a lot and was just wondering how it is done, so that I could do it on my own site.
But, when you refresh the page another image reloads each time, can anyone help me out on how this is done?

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 Images Slideshow
i used the flash mx samples file for a pictures slideshow...it works based on 2 buttons (back and fwd)...and on a text field you can type the number of the picture you want to see.

what i want to do is an automatic slideshow...from the beginning to the end going through all the pics...

the pics are loaded from a folder...they are not in the flash file library

Javascript Random BG With Images?
Hello there! I know this is a flash forum but since a lot of people knows Javascript as well, i thought that i should made this question over there.

I know how to randomize HTML background color with Javascript, but i was wondering if there's a way to randomizae backgrounds IMAGES with Javascript...if u know a way, can you show me the code?

Thx!

Random But Not Repeating Images
hi, i hope someone can help me with this.

i want to load a bunch of jpgs into a grid of movie clips ive laid out on the stage. im trying to get them to load randomly, so they're in different spots in the grid everytime the site loads.

the thing i cant figure out, is how do i load them randomly, but also make sure that they dont repeat?

i hope this make sense.

thanks
-sean

Displaying Images At Random
Hi all,

Could someone please help me out with randomizing? I'm interested in displaying three to four graphic images one at a time and having them appear randomly (kinda like the banner ads we see on the Web).

How would I go about doing this? I'm fairly new to Actionscripting.

Thanks!

Random Flash Images
Is there a way to embed random flash movies into my HTML?? I have like, 3 tiny flash movies the same size, I want to just load onto a page at random. Please help.

Display Random Images
Is there an easier way to display random images, for example I want it to display an image or two and then three or four second’s later change to another.

I have over 100 images to display and don’t really want create each frame and place a new image on every 5 or so frame.

There must be somewhere out there some action script that can do this, can anyone help I would very much appreciate it, and thanks in advances for your help.

0rlando

Dymanic Random Images, I Just Cant Get It
ok I can make images appear from random but have no idea how to dynamically load them from a directory.


I've searched though but cant find what I'm looking for,


I've six images "image1.jpg image2.jpg....." and are in a folder called "images"


thanks for the help
Slinky

Fading Random Images In And Out
Hello gang!
I am really having some trouble accomplishing a particular effect. I have spent 1 1/2 days trying to do this with no luck. It doesn't help that I am lousy with ActionScripting either.

What I would like to do is this:
I have 5 images that I would like to have loaded randomly. I'd also like them to fade in and out from one to the other as well.

If anyone can provide detailed instructions, I would greatly appreciate it. As I had mentioned, scripting is not my thing, so if you could please explain it in detail-assume that I know nothing-I would greatly appreciate it.

Thanks for your time and consideration!
Kind regards,
Greg

Help Generating Random Images
I need some help generating 15 random images without no buttons to push or anything like that.

I think its like: math.random() something?

Any advice, code examples or tutorial would sure be appreciated!

Chris

Random Images And Bottuns
Hiya,
I want to build a memory card game.
this is a game that u need to open two cards that are the same.
I have a board with 12 cards, so I have 6 diffrent cards.
so here comes the questions-
do I need to do a random button or a random image?
and how di I do a random button or a random image?

thanks

Taking Random Images
I have made an animation.ý use a picture in that animation but i want it to be randomly came from a folder named images.How can i achieve that.

Random Images Question
How do I display 1 of 2 images that would be randomly picked after clicking a button???

any help would be appreciated

Bonus.. How would I add a short animation after the button click, then display the random image??

thanks for any help

Loading Random Images
Hello,

I am creating a site in Flash MX 2004 where each page a user comes to I have background image with interface on top of it. What I want to do is create it so that everytime a user comes to a page or goes back to a page, or reloads the site a different image is loaded into the background, not to interfere the interface that is on top of it. I am building this site where I have a main navigation that calls the external movies into a container clip, in these movies is where I would like to place the code for this. I have been looking into some things on this and what I can find is that I will need to call these .jpg images from an external folder and set the the call in code on each movie to call them at random. The code I have so far is:

------------------------------------------------------------

imageToload = Math.random(5)
imageHolder.loadMovie([imageToload]+".jpg")

--------------------------------------------------------------

I have placed this on the first frame of the external movies, attempting to call in the 5 jpegs, but it is not working correctly. I also have a pre-loader on these movies in the first scene. I wanted that to be able to preload these as well fom that pre-loader if that is possible. My preloader script is as follows. Which is typical code.

____________________________________

(frame1)
framesLoaded = getBytesLoaded();
totalFrames = getBytesTotal();
_root.loading = Math.round((framesLoaded/totalFrames)*100);
this.bar._xscale = _root.loading;


(frame2)
if (framesLoaded == totalFrames) {
gotoAndPlay("main", 1);
} else {
gotoAndPlay(1);
}

___________________________________

I am trying a few different things, also looking into this site help as well. But I wanted to post to see if anyone could help or point me into the right direction.
Thanks

Making Images Appear At Random
Hi I am designing a task for kids with language problems it involves them categorising household objects according to where they are found in the home. I wish a household object to appear in the middle of the screen they place it in the right area of the home and then another household object appears. How might this be accomplished.

I am quite new to flash any help would be greatly appreciated.

ActionScript Random Images
Hi
I'd appreciate help with this desperately.

I have several images (15) , dynamically loaded, and displayed randomly for a header. I'm having trouble finding why I'm getting blank areas in the final file.

You can view the problem on the site (top right):
http://www.smgeurope.com/public/

All images are within the correct directory, and I really think that it's the action script that's at fault. However, I'm not that hot in this area. Any help appreciated at all.

The script is as follows:

onClipEvent (load) {
trace( this );
//
this.createEmptyMovieClip( "img", 0) ;
//
n = Math.round( Math.random()*_root.imageList.length );
src = _root.baseUrl + _root.imageList[ n ];
//
trace( src )
this.img.loadMovie( src );
//
_root.imageList.splice(n, 0);
//
av = 0.25 + random( 10 )*0.25 + random( 10 )*0.25;
a = random( 180 ); mA = random( 100 );
_x = 0 + (51 * random( 8 ));
_y = 0;
//
}
onClipEvent (enterFrame) {
a+=av;
if (a>180) {
a-=180; av = 0.25 + random( 10 )*0.5 + random( 10 )*0.5;
_x = 0 + (51 * random( 8 ));
}
//_width = Math.sin( a* Math.PI/180 ) * 75;
_alpha = Math.sin( a* Math.PI/180 ) * mA*4;
}


All images are named and loaded with:

imgLst = "thumb1.jpg,thumb2.jpg,thumb3.jpg,thumb4.jpg,thumb 5.jpg,thumb6.jpg,thumb7.jpg,
thumb8.jpg,thumb9.jpg,thumb10.jpg,thumb11.jpg,thum b12.jpg,thumb13.jpg,thumb14.jpg,thumb15.jpg,thumb1 6.jpg"
imageList = imgLst.split( ',' );

Sorry, my actionscripting is not so good enough to complete task
many thanks for any tips.
thanks
Lisa

Random Images In Flash
Hi Sup, im trying to build a flash file that randomly displays other .swf files.

What i want to do is build a flash header that randomly displays images with links. I figure if they were other .swf files i cud put the links in it.

I found some sites on the net that showed how to randomize images but they arent .swf files so i cant put links and also it is radom by clicking a button.

I want that if the site loads, the only way to see a different image is if u reload the page or click another page that has the header.

thankyou for any help

Random Images In Menu
Hi All,

I have a menu which I have done in Flash, over the buttons there is an image... I have 4 images the same size... Each time the movie loads I want one of the images to be used randomly, these images are in my library... Any ideas?

Thanks,
Tom

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