# Help with Image Gallery(AS2 to AS3)!

**URL:** <https://forum.kirupa.com/t/help-with-image-gallery-as2-to-as3/304655>\
**Category:** Uncategorized\
**Created:** [February 11, 2010, 9:52am UTC](https://forum.kirupa.com/t/help-with-image-gallery-as2-to-as3/304655 "2010-02-11T09:52:02Z")\
**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, 9:52am UTC](https://forum.kirupa.com/t/help-with-image-gallery-as2-to-as3/304655/1 "2010-02-11T09:52:02Z")

</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 gallery mc tt contains the images for scrolling, which is inside the main mc tt contains the left and right arrow mc 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 right arrow btn which is inside the right arrow mc  
================================================== ======  
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 main mc and right arrow mc 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!!!
