# Help with Image Gallery(AS2 to AS3)!

**URL:** <https://forum.kirupa.com/t/help-with-image-gallery-as2-to-as3/304649>\
**Category:** Uncategorized\
**Created:** [February 11, 2010, 7:33am UTC](https://forum.kirupa.com/t/help-with-image-gallery-as2-to-as3/304649 "2010-02-11T07:33:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoodog](https://avatars.discourse-cdn.com/v4/letter/h/bcef8e/32.png) [@hoodog](https://forum.kirupa.com/u/hoodog)\
**Post date:** [February 11, 2010, 7:33am UTC](https://forum.kirupa.com/t/help-with-image-gallery-as2-to-as3/304649/1 "2010-02-11T07:33:17Z")

</div>

Hi I need help to convert an image gallery from as2 to as3. Been trying so long to do so, but failed. My codes fall in 2 areas:

1. On the [COLOR=darkred]gallery mc[/COLOR] tt contains the images for scrolling, which is inside the main mc tt contains the left and [COLOR=darkgreen]right arrow mc[/COLOR] as well.  
========================================================  
onClipEvent (load)  
{  
accel1 = 3.000000E-001;  
rate1 = 1.000000E-001;  
root.xkoord1 = x;  
x = 0;  
}  
onClipEvent (enterFrame)  
{  
x = x \* accel1 + (root.xkoord1 - x) \* rate1;  
setProperty("", x, x + x);  
if (Math.abs(root.xkoord1 - x) \< 1)  
{  
setProperty("", x, root.xkoord1);  
}  
}  
========================================================

2. On the [COLOR=darkred]right arrow btn[/COLOR] which is inside the [COLOR=darkgreen]right arrow mc[/COLOR]  
========================================================  
on (rollOver)  
{  
gotoAndPlay(“s1”);  
}  
on (releaseOutside, rollOut)  
{  
gotoAndPlay(“s2”);  
}  
on (release)  
{  
if (\_root.xkoord1 \> -1500)  
{  
\_root.xkoord1 = \_root.xkoord1 - 1000;  
}  
}  
========================================================

I know it’s not possible to code on the actual mc and btn in as3, so i have inserted a new action layer in the [COLOR=darkgreen]main mc[/COLOR] and [COLOR=darkgreen]right arrow mc[/COLOR] respectively and move the above codes there, adding event listeners and etc, but it din work out. Is there a correct way to do this? Thanks and much appreciated!!!
