# Fading images using actionscript

**URL:** <https://forum.kirupa.com/t/fading-images-using-actionscript/238208>\
**Category:** flash\
**Created:** [September 8, 2007, 5:51am UTC](https://forum.kirupa.com/t/fading-images-using-actionscript/238208 "2007-09-08T05:51:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![herbshirt](https://avatars.discourse-cdn.com/v4/letter/h/bc79bd/32.png) [@herbshirt](https://forum.kirupa.com/u/herbshirt)\
**Post date:** [September 8, 2007, 5:51am UTC](https://forum.kirupa.com/t/fading-images-using-actionscript/238208/1 "2007-09-08T05:51:56Z")

</div>

Hullo,

I’m brand new to Flash… I’ve found bits and pieces of my answer but they assume I know more than I do.

Can some tell me in real laymans terms how to have say… 5 images fading from one to another, looping using action script. I found a tut which does it using tweening, that’s simple enough but apparently action script will reduce the file size and make it smoother.

I’m using mx 2004.

Thanks in advance…

Herb.

---

<div class="post-metadata">

**Author:** ![mykel\_suthertun](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@mykel\_suthertun](https://forum.kirupa.com/u/mykel_suthertun)\
**Post date:** [June 10, 2008, 3:07pm UTC](https://forum.kirupa.com/t/fading-images-using-actionscript/238208/2 "2008-06-10T15:07:59Z")

</div>

Any chance you know how to achieve this same effect with images served by XML as opposed to an array in actionscript? I’d like to build this into my content manager, so XML is a must.

---

<div class="post-metadata">

**Author:** ![biznuge](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/biznuge/32/11567_2.png) [@biznuge](https://forum.kirupa.com/u/biznuge)\
**Post date:** [June 10, 2008, 3:30pm UTC](https://forum.kirupa.com/t/fading-images-using-actionscript/238208/3 "2008-06-10T15:30:45Z")

</div>

@herbshirt… Did you ever get this thing working mate. sorry. it must’ve fallen off my radar a while back.

@mykel\_… I’d still serve the mechanism up as an array, but simply pop an xml loader on in front of the initialisation part of the swf…

---

<div class="post-metadata">

**Author:** ![studvicious](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@studvicious](https://forum.kirupa.com/u/studvicious)\
**Post date:** [June 17, 2008, 5:04pm UTC](https://forum.kirupa.com/t/fading-images-using-actionscript/238208/4 "2008-06-17T17:04:49Z")

</div>

To get it working in your CMS change “image1.jpg”, “image2.jpg”…

to something like “[http://www.yoursite.com/folder/image1.jpg](http://www.yoursite.com/folder/image1.jpg)”, “[http://www.yoursite.com/folder/image2.jpg](http://www.yoursite.com/folder/image2.jpg)”

It should work then. The code was fine it just wasn’t sure exactly where those image files were once you uploaded everything to your CMS.

---

<div class="post-metadata">

**Author:** ![caroldeck](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@caroldeck](https://forum.kirupa.com/u/caroldeck)\
**Post date:** [June 26, 2008, 9:54pm UTC](https://forum.kirupa.com/t/fading-images-using-actionscript/238208/5 "2008-06-26T21:54:24Z")

</div>

Hi,  
I found your FLA and it was easy enough to get working with my images. Thanks! I just have one question, if you don’t mind… is there some way I can get the first image to show right away, while the SWF is loading?

Thanks,  
Carol

[quote=biznuge;2213077][http://www.ampdesign.co.uk/image\_roller/index.html](http://www.ampdesign.co.uk/image_roller/index.html)

this should show you what i meant.[/quote]

---

<div class="post-metadata">

**Author:** ![biznuge](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/biznuge/32/11567_2.png) [@biznuge](https://forum.kirupa.com/u/biznuge)\
**Post date:** [June 29, 2008, 8:13am UTC](https://forum.kirupa.com/t/fading-images-using-actionscript/238208/6 "2008-06-29T08:13:15Z")

</div>

sorry , but all this stuff is linking back to a now defunct url I used to use for dev purposes. I won’t be resurrecting it, and didn’t do much of a job backing it up, so apologies on that score to anyone viewing this thread and wondering about the dead links.

> I found your FLA and it was easy enough to get working with my images. Thanks! I just have one question, if you don’t mind… is there some way I can get the first image to show right away, while the SWF is loading?

you could certainly package an image into the swf for use at runtime, but this kinda defeats the whole purpose of preloading any images into the movie, and would increase the swf size substantially. In short, it’s a completely self defeating idea, but is certainly possible. :2c:
