# Line block effect over images

**URL:** <https://forum.kirupa.com/t/line-block-effect-over-images/35470>\
**Category:** Uncategorized\
**Created:** [November 14, 2003, 10:18am UTC](https://forum.kirupa.com/t/line-block-effect-over-images/35470 "2003-11-14T10:18:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trevorsaint](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/trevorsaint/32/268_2.png) [@trevorsaint](https://forum.kirupa.com/u/trevorsaint)\
**Post date:** [November 14, 2003, 10:18am UTC](https://forum.kirupa.com/t/line-block-effect-over-images/35470/1 "2003-11-14T10:18:23Z")

</div>

Hi all, I am interested in applying a simple effect to images on my site. On many sites, they have an effect that is placed over the top of an image, where long rectangles a randomly moving from left to right.

They have varied opacity which is simple enough but I would very much like to know the method for doing something similar to this, can anyone help me out with the action script side of things or provide me with a link to a tutorial

Cheers

---

<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, 11:52am UTC](https://forum.kirupa.com/t/line-block-effect-over-images/35470/2 "2003-11-14T11:52:51Z")

</div>

Put a clip on your scene, name it cl and then put this is the frame action panel:

```auto
// boundaries
left = 0 ;
right = 300 ;

cl.onEnterFrame = function () {
var dx = this.tx - this._x ;
this._x += dx / 5 ;
if (Math.abs(dx) < 5) {
this.tx = random (right - left) + left ;
}
}

```

That’s just an example, you could have any kind of motion.

pom 🙂

---

<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, 5:41pm UTC](https://forum.kirupa.com/t/line-block-effect-over-images/35470/3 "2003-11-14T17:41:24Z")

</div>

Thanks for that Pom, I will give it a try, I guess this can be applied to multiple rectangle objects? and is this an effect just from left to right? I am guessing yes as the effect is on the x axis. How would I apply this to multiples?. I am sure you have seen this effect on many sites, just adds interest over the image I guess, and thanks for your reply Pom
