Solved

Random images in Flash and

Posted on 2003-11-21
2
452 Views
Last Modified: 2010-04-03
Hi, I'm looking for a simple solution to randomly display an image in Flash each time the browser loads.

Also, I would like to know how I can limit a movie to play on the home page only once per browser session.

Thanks for your help!
0
Comment
Question by:liltyga
2 Comments
 
LVL 27

Accepted Solution

by:
negatyve earned 250 total points
ID: 9796353
>Hi, I'm looking for a simple solution to randomly display an image in Flash each time the browser loads.

suppose you've got a "images" folder with this content:

pic1.jpg, pic2.jpg, pic3.jpg, pic4.jpg.... pic20.jpg

where you want to display your picture, create an empty movieclip, with "loader" instance name.
then, in the same frame, drop this code:

loader.loadMovie("images/pic" + (random(20) + 1) + ".jpg");

>Also, I would like to know how I can limit a movie to play on the home page only once per browser session.

it dipends on the server side language supported by your web hoster. anyway, you can do it something similar with javascript and cookies:

sample1: http://flash-mx.html.it/guide/swf/negatyve_javascript/introCookies/getURL/intro.html
source1: http://flash-mx.html.it/guide/zip/negatyve_javascript/cookieGetURL.zip
sample2: http://flash-mx.html.it/guide/swf/negatyve_javascript/introCookies/GotoFrame/filmato.html
source2: http://flash-mx.html.it/guide/zip/negatyve_javascript/cookieGotoFrame.zip
sample3: http://flash-mx.html.it/guide/swf/negatyve_javascript/introCookies/LoadMovie/intro.html
source3: http://flash-mx.html.it/guide/zip/negatyve_javascript/cookieLoadMovie.zip
0
 

Expert Comment

by:gangsidestep
ID: 10178030
Hey I want to do the same thing as above but taking pictures from a php file
can you help??
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question