Solved

Random images in Flash and

Posted on 2003-11-21
2
449 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now