# Random photo effect?

**URL:** https://forum.kirupa.com/t/random-photo-effect/35306
**Category:** flash
**Created:** [November 12, 2003, 4:24pm UTC](https://forum.kirupa.com/t/random-photo-effect/35306 "2003-11-12T16:24:14Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![riderchic88](https://avatars.discourse-cdn.com/v4/letter/r/77aa72/32.png) [@riderchic88](https://forum.kirupa.com/u/riderchic88)
#### Post date: [November 12, 2003, 4:24pm UTC](https://forum.kirupa.com/t/random-photo-effect/35306/1 "2003-11-12T16:24:14Z")

</div>

Hey guys (and gals?). Thanks for all the previous help on this same movie… but I was wondering, is there any way I could possibly apply a random “Ken Burns”-style effect to each photo as it is loaded in the flash? Thanks C:-)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 12, 2003, 5:10pm UTC](https://forum.kirupa.com/t/random-photo-effect/35306/2 "2003-11-12T17:10:19Z")

</div>

I have no idea what a Ken Burns style effect is 😃

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 12, 2003, 8:15pm UTC](https://forum.kirupa.com/t/random-photo-effect/35306/3 "2003-11-12T20:15:26Z")

</div>

It’s not really important, lol… I just want random effects, but FYI he is a documentary director and he does lots of panning and zooming of photos to give the picture movement, since he usually is dealing with materials that existed before the advent of video… I saw a six-part documentary he did on the history of jazz which was very fantastic, I’d reccomend it to anybody. I think his most famous one is a documentary he made on the Civil War. :nerd: :geek:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 12, 2003, 9:03pm UTC](https://forum.kirupa.com/t/random-photo-effect/35306/4 "2003-11-12T21:03:04Z")

</div>

Basically, I’m looking to have all of these effects scripted in a list:  
-pan up  
-pan down  
-pan right  
-pan left  
-fade in  
-zoom in  
-zoom out

and applied randomly to the movieclip that is dynamically loading each photo. I’m gonna take a wild guess it has something to do with masking maybe, at least for the panning? I’m AS clueless, so I have no idea where to go with this.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 12, 2003, 9:39pm UTC](https://forum.kirupa.com/t/random-photo-effect/35306/5 "2003-11-12T21:39:41Z")

</div>

OK… Same thing, new question. I’ve been playing around with it myself, and I used this tutorial:  
[Loading a Random Background](http://www.kirupa.com/developer/mx/loadingrandombackground.htm)

Same concept, and I arranged my actionscript as so (with only 1 case so far, just to see if it still works):  
Original:  
[AS]  
MovieClip.prototype.fadeIn = function() {  
if (this.photo.\_alpha\<100-this.fadeSpeed) {  
this.photo.\_alpha += this.fadeSpeed;  
} else {  
this.photo.\_alpha = 100;  
this.onEnterFrame = null;  
}  
};  
[/AS]

New:  
[AS]  
MovieClip.prototype.effect = function() {  
choice = Math.round(Math.random()\*5);  
switch (choice) {  
case 0 :  
if (this.photo.\_alpha\<100-this.fadeSpeed) {  
this.photo.\_alpha += this.fadeSpeed;  
} else {  
this.photo.\_alpha = 100;  
this.onEnterFrame = null;  
}  
}  
};  
[/AS]

I’ve changed fadeIn to effect in the part that calls the movieclip as well, and it DOES work, in theory… I see it trying… poor little thing… the problem is, the fading is super-stuttered and doesn’t really fade in all the way before stopping, waiting, fading out and moving on to the next picture. Does anyone have a clue why this would happen?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 14, 2003, 3:40pm UTC](https://forum.kirupa.com/t/random-photo-effect/35306/6 "2003-11-14T15:40:34Z")

</div>

nevermind, i’ve got it.
