# Pic loop bar. Trying to convert to AS3

**URL:** <https://forum.kirupa.com/t/pic-loop-bar-trying-to-convert-to-as3/262609>\
**Category:** Uncategorized\
**Created:** [June 7, 2008, 6:13pm UTC](https://forum.kirupa.com/t/pic-loop-bar-trying-to-convert-to-as3/262609 "2008-06-07T18:13:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PJaco](https://avatars.discourse-cdn.com/v4/letter/p/858c86/32.png) [@PJaco](https://forum.kirupa.com/u/PJaco)\
**Post date:** [June 7, 2008, 6:13pm UTC](https://forum.kirupa.com/t/pic-loop-bar-trying-to-convert-to-as3/262609/1 "2008-06-07T18:13:40Z")

</div>

Hi everyone. I’m no expert on Actionscript 3.0. I’m wondering if someone had a suggestion on how to fix my AS3 code.

Here’s the AS2 loop picture bar code. Works perfect.

\_root.pics.onEnterFrame=function(){  
\_root.pics.\_x+=(86-\_root.\_xmouse)/33.3;

```
if(this._x&gt;0){
    this._x=-300;
}
if(this._x&lt;-300){
    this._x=0;
}

```

}

Then I was trying to update to AS3. There’s something obvious I’m missing, no?

pics.addEventListener(Event.ENTER\_FRAME, onEnterFrame);

```
pics.x+=(86-mouseX)/33.3;

if(this.x&gt;0){
    this.x=-300;
}
if(this.x&lt;-300){
    this.x=0;
}

```

thanks kindly for any suggestions!

---

<div class="post-metadata">

**Author:** ![PJaco](https://avatars.discourse-cdn.com/v4/letter/p/858c86/32.png) [@PJaco](https://forum.kirupa.com/u/PJaco)\
**Post date:** [June 9, 2008, 1:16am UTC](https://forum.kirupa.com/t/pic-loop-bar-trying-to-convert-to-as3/262609/2 "2008-06-09T01:16:13Z")

</div>

thanks for writing back. Of course! …left out my function. Works now
