# Animate a loaded jpg

**URL:** https://forum.kirupa.com/t/animate-a-loaded-jpg/290452
**Category:** flash
**Created:** [June 15, 2009, 9:17am UTC](https://forum.kirupa.com/t/animate-a-loaded-jpg/290452 "2009-06-15T09:17:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mentha](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@mentha](https://forum.kirupa.com/u/mentha)
#### Post date: [June 15, 2009, 9:17am UTC](https://forum.kirupa.com/t/animate-a-loaded-jpg/290452/1 "2009-06-15T09:17:02Z")

</div>

Hi there. Been a while since I’ve posted here, but that due to having a lack of problems figuring things out 😉

I’m trying to figure out how to make a dynamically loaded image actually move across my screes. So far, my script loads the image, but stops after 1 frame. Without the loaded image everything works just fine. It’s all Action Script, so my gues is that I probably missed something along the way.

Here’s my script:

```auto

scaler.loadMovie("image.jpg");

//set the starting value for 2 variables
var targScale = 45;
var targX = 250;
var targY = 102;
var speed = 5;

scaler.onEnterFrame=function() {
    scaler._xscale -= (scaler._xscale-targScale)/speed;
    scaler._yscale -= (scaler._yscale-targScale)/speed;
    scaler._x += (targX-scaler._x)/speed;
    scaler._y += (targY-scaler._y)/speed;
}

```

Any help would greatly be appreciated!
