# A better animation approach

**URL:** <https://forum.kirupa.com/t/a-better-animation-approach/286463>\
**Category:** Uncategorized\
**Created:** [April 15, 2009, 8:58pm UTC](https://forum.kirupa.com/t/a-better-animation-approach/286463 "2009-04-15T20:58:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shorescores](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@shorescores](https://forum.kirupa.com/u/shorescores)\
**Post date:** [April 15, 2009, 8:58pm UTC](https://forum.kirupa.com/t/a-better-animation-approach/286463/1 "2009-04-15T20:58:32Z")

</div>

Hi - I am using Flash CS 3 v9.0 and have set up a file which works, as long as I publish the .SWF for Flash Version 6. I need to accomplish this for version 8 or 9, but when publishing the SWF using version 8 (or 9) the buttons no longer create motion.

I am attempting to have a large masked image enter the stage, then buttons 1-5 move the image left or right and into view.

**Maybe somebody can offer a better approach, using AS 2?**

My file is setup like Frame 1 Actions layer:

```auto
//btn code for samples motion
btn1.onPress = function() {
	tar = 1509;
};

btn2.onPress = function() {
	tar = -46;
};

btn3.onPress = function() {
	tar = -565;
};

btn4.onPress = function() {
	tar = 987;
};

btn5.onPress = function() {
	tar = 471;
};

```

Then the image, named imageStrip\_mc has the following ActionScript inside of the mc:

```auto
speed = 0.2;
currentPos=0;

onEnterFrame = function () { 
dist =_parent.tar-currentPos; 
currentPos = _x += dist*speed;
}

```

I have no clue why the SWF works great, only if it’s published for version 6. Maybe there is a better way of doing this, which will work as a version 8 or 9 SWF?

Attached is the .FLA **saved for CS 3**. The buttons on the attached don’t work for me. But, if you save the SWF out for Version 6, they suddenly do.

Thanks in advance!

- shorescores
