Solved

Random images in Flash and

Posted on 2003-11-21
2
457 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HTML 5 or Flash 7 495
Action Script commands 5 252
Shouldn't i be able to use an old win xp machine as an internet radio? 7 143
black magic design 1 135
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 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…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
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.

734 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