Forum Moderators: open

Message Too Old, No Replies

Fading images with time delay

         

bateman_ap

4:05 pm on May 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, wonder if I could get some help. I am trying to build a flash movie that has if you can imagine a series of strips that contain pictures fading in and out from black. I have 2 current probs. using the below code I found I can get a image fade in and out on a mouse over but I need to change this to fade in and out without and user interaction and also at random intervals so it looks random.

The below code is a action on a movieclip containing 2 layers

onClipEvent(load)
{
dir = 0;
speed = 6;
original._alpha = 0
this.onRollOver = function()
{
dir = 1;
}

this.onRollOut = function()
{
dir = -1;
}
useHandCursor = false;
}
onClipEvent(enterFrame)
{
temp = original._alpha + speed*dir;
original._alpha = Math.min(100,Math.max(temp,0));
}

Iresh

4:13 am on Jun 1, 2005 (gmt 0)

10+ Year Member



Hi Bateman,
Try this code as the movie clip action

onClipEvent(enterFrame){
this._alpha=random(100);
}

bateman_ap

10:23 am on Jun 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi thanks for that. However if I use this it all goes crazy speeds!