# Object movement using actionscript

**URL:** https://forum.kirupa.com/t/object-movement-using-actionscript/226576
**Category:** flash
**Created:** [May 22, 2007, 12:51pm UTC](https://forum.kirupa.com/t/object-movement-using-actionscript/226576 "2007-05-22T12:51:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bl4ck1c3](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bl4ck1c3](https://forum.kirupa.com/u/bl4ck1c3)
#### Post date: [May 22, 2007, 12:51pm UTC](https://forum.kirupa.com/t/object-movement-using-actionscript/226576/1 "2007-05-22T12:51:23Z")

</div>

I’ve been trying to move a movieclip using actionscript by changing the coordinates of the movie clip

here’s my code

i named the movieclip “bola”

```auto

on (release) {

    for (t=0; posy != 0; t++) {
        posx=(3 * t * Math.cos(60))
        posy=(3 * t * Math.sin(60) - 0.5 * 9.81 * t * t)
        _root.bola._x = posx
        _root.bola._y = posy
    }
}

```

but something’s missing me… because when i press the button the movie moves to position x=0 y=0 and not the projectile movement that i want …  
is the for cycle wrong ??

can anyone check what’s wrong with my code ??? :cross-eye
