Also, is this for use in Flex or Flash?
and what is your data source you plan on using to hold the values of the image file names? (Web Services, XML, Remoting, Text file, etc)
rp
Main Topics
Browse All TopicsI am looking for code in Actionscript 3.0 which will allow a user to dynamically load a different image each time a single button is clicked.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
if you are publishing for Flash Player 9, then you should use the Loader Class...
if you are publishing for version 8, you should use the MovieClipLoader class.
but basically, you start off with an array of your data...
var imgList:Array = new Array();
imgList.push("image1.jpg")
imgList.push("image2.jpg")
imgList.push("image3.jpg")
imgList.push("image4.jpg")
imgList.push("image5.jpg")
then you use the Loader class to pull in the image you want...
but first you need to select a random number from that array...
so you can use this...
var selectedImg:String = imgList( (Math.round(Math.random*5)
(you might check the syntax on that one)
so you have a reference to a random image, and not you just need to use the loader class to pull in that image...
here is a link about the Loader class:
http://livedocs.adobe.com/
and here is another one...
http://newmovieclip.wordpr
rp
Business Accounts
Answer for Membership
by: rascalpantsPosted on 2007-07-10 at 11:30:26ID: 19456449
are you looking for a Class or just framescript?
rp