# Tweening a object w/actionscript

**URL:** https://forum.kirupa.com/t/tweening-a-object-w-actionscript/106442
**Category:** Uncategorized
**Created:** [April 5, 2004, 11:36pm UTC](https://forum.kirupa.com/t/tweening-a-object-w-actionscript/106442 "2004-04-05T23:36:03Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![iloveitaly](https://avatars.discourse-cdn.com/v4/letter/i/7ea924/32.png) [@iloveitaly](https://forum.kirupa.com/u/iloveitaly)
#### Post date: [April 5, 2004, 11:36pm UTC](https://forum.kirupa.com/t/tweening-a-object-w-actionscript/106442/1 "2004-04-05T23:36:03Z")

</div>

is it possible to make a object (box in my case) increase its width over a series of frames with actionscript? I would assume it would be somthing like this:

```auto

on (release) {
tellTarget("/path") {
this.box._width=200
}
}

```

its not working…  
any ideas?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 6, 2004, 12:41pm UTC](https://forum.kirupa.com/t/tweening-a-object-w-actionscript/106442/2 "2004-04-06T12:41:42Z")

</div>

I am writing the code on the \_root.bar  
I did the targeting with the targeting thing on the actionscript panel. I also did it by “hand”, both didnn’t work.  
i fooled around with this for awhile and went back to try to modifie the first posters code.  
I did and came up with this:

```auto

on (release) {
	onEnterFrame = function () {
		if (_root.box._width<=_root.scale._width) {
			_root.box._xscale += 10;
		}
	};
}

```

but i this code was applied to a new .fla with only 3 elements, the box, the box that i want the with to be, and the button. and it worked! so i brought it over to my other project changed the path, and it…well…didn’t work. It made the boxes width move but never stopped. any ideas?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 6, 2004, 12:58pm UTC](https://forum.kirupa.com/t/tweening-a-object-w-actionscript/106442/3 "2004-04-06T12:58:31Z")

</div>

hmmm… inside the function , before the if, try tracing both sides.

```auto
 onEnterFrame = function () {
trace("left side>>>>>"+_root.box._width);
trace("right side>>>>>>>>>>>>>>>>>>"+_root.box._width);
//
if (_root.b........

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 6, 2004, 1:04pm UTC](https://forum.kirupa.com/t/tweening-a-object-w-actionscript/106442/4 "2004-04-06T13:04:27Z")

</div>

whooaa, you lost me there. what is tracing? whats with all the arrows?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 6, 2004, 6:16pm UTC](https://forum.kirupa.com/t/tweening-a-object-w-actionscript/106442/5 "2004-04-06T18:16:51Z")

</div>

\<grin\> tracing. very important. It takes the value of your varibles or whatever you put in the () and outputs them to the "output window’ when you test your movie. cmd + enter.

I just stuck the arrows and text in there to make it easy to distinguish which value is which.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 6, 2004, 11:52pm UTC](https://forum.kirupa.com/t/tweening-a-object-w-actionscript/106442/6 "2004-04-06T23:52:09Z")

</div>

THANK YOU!!!  
after fooling around with it for an hour i finally got it to work!!!  
here the code:

```auto

on (release) {
        onEnterFrame = function () {
                if (_root.mainmov.scalebox._width<= 700) {
                        _root.mainmov.scalebox._xscale += 10;
                }
        };
}

```

THANK YOU SO MUCH!  
If your wondering, [heres](http://ambwhitestudios.com) the site i am working on.  
the only menu that actully works so far is the details menu, and the front page isn’t complete. But other than the non-completeness of it what do u think design wise?  
THANKS AGAIN!  
hmm, I just came across a problem though, if i change the \<= to \>= the box infidentaly goes on, why? if there anything specail i have to do when i change that symbol ( the greater than less than symbol )? Also i should be able to use != instead of \<= symbols correct? because if i use them i get the same effect, line goes on forever.
