Flash random image
- Started
- Last post
- 15 Responses
- steadyvibe
Hey, i am doing a flash website and the client wants the website to have a different image on the homepage every time it is reloaded.. Is that possible in flash?
- Tyrone0
we do it with PHP. Easy.
- steadyvibe0
you do.. how? Im not savvy with the PHP..
- brandelec0
if the site's not flash, do it with php, but if it is, just name your images nums like 1.png, 2.png...
and build a function that calls random numbers, which you can use to call on which image to use
- Tyrone0
we use PHP that way anything we put into that folder can be pulled into the flash file. no need to name anything. flash just yanks any pic from the folder. so it depends on how you want to do it.
- brandelec0
i concur w/ tyrone
- steadyvibe0
cool sounds good. now how would i go about doing that?
- unfittoprint0
php-free.
subsitute .swf w/ .jpg.
http://newstoday.com/pv-an/view_…
- Jerry0
You could also try pasting this code into the first frame of a flash movie:
imagefolder = "imgs/";
imageprefix = "pic";
imagenum = random (10);
imagesuffix = ".jpg";
//
image = imagefolder + imageprefix + imagenum + imagesuffix;
//
trace (image);
//
_root["yourmovieclip"].loadMovie (image);keep in mind that the image has to be a non-progressive jpg.
with kind regards,
Jerry
- honda0
It's very easy.
Two lines of code.Enjoy friends:
http://www.apt11.com/source/
- honda0
I like how people offer up suggestions without offering any real help. *cough
Props to unfittoprint and Jerry for taking time out to help a fellow nt citizen.
- Tyrone0
blow me honda. i was busy.
- honda0
Sorry for the invite Tyrone, but I'm straight.
We all have things to do. Maybe some of your time could have been spent being constructive. However, judging by your response one could reason that it would be something difficult for you to do.
Keep up the good work!
- Jerry0
thanks Honda,
I totally agree...
cheers,
Jerry
- brandelec0
drama queens
- Jerry0
As I agree with Honda you could probably spend your time better. There's a drama in there.