Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replace images with other images

Status
Not open for further replies.

mmmbob

Programmer
Jul 23, 2003
29
US
Hi,
I have a movie clip which essentially contains an image. And each time someone rolls over the image I'd like to replace that image with another image in the same spot. So I tried making the image a movie clip and on rollover I removedMovieClip and then I attached the new movie. The only partially works. I am forced to change the name of the movieclip instance each time. That is if have an image called img(instance name) then I do a holder.img.removeMovieClip() and I am not able to holder.attachMovie(Image3,img,depth), but I can holder.attachMovie(Image3, img1,depth). That is if I change the instance name it works. Now if I want my movie to keep running and everyTime there was a mouse Over, then my instance names would keep growing tremendously. Is there an easier way of doing this? Any suggestions would be appreciated.
Thanks.
 
clip(instance name) holds the image

clip.onRollOver = function(){
loadMovie("someOtherPic.jpg",this)
}

or attach movie if its in the library (better with external load)

thats fine for one change but if you want more then consider a random load or a predefined order (from an array)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top