# \_width not changing during tween. is it useless?

**URL:** https://forum.kirupa.com/t/-width-not-changing-during-tween-is-it-useless/62618
**Category:** flash
**Created:** [August 30, 2004, 1:02am UTC](https://forum.kirupa.com/t/-width-not-changing-during-tween-is-it-useless/62618 "2004-08-30T01:02:15Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![rwelti](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rwelti/32/716_2.png) [@rwelti](https://forum.kirupa.com/u/rwelti)
#### Post date: [August 30, 2004, 1:02am UTC](https://forum.kirupa.com/t/-width-not-changing-during-tween-is-it-useless/62618/1 "2004-08-30T01:02:15Z")

</div>

I was disappointed to find that I could not use the \_width  
property of a tweened movieclip instance to know how large  
the mc is at a given time.

Am I just not getting something??

A breakpoint in the onEnterFrame() function shows that  
\_width is always the LARGEST width the movieclip  
ever has – not its CURRENT width. In my case the mc is being  
made larger and larger, using a tween made in the authoring  
environment. The clip starts out tiny and ends up 400 pixels wide,  
but the \_width property is 400 the entire time!

What gives??

i really appreciate enlightenment!  
rwelti

---

<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: [August 30, 2004, 9:01am UTC](https://forum.kirupa.com/t/-width-not-changing-during-tween-is-it-useless/62618/2 "2004-08-30T09:01:19Z")

</div>

> [@rwelti](#):
>
> I was disappointed to find that I could not use the \_width  
> property of a tweened movieclip instance to know how large  
> the mc is at a given time.
> 
> Am I just not getting something??
> 
> A breakpoint in the onEnterFrame() function shows that  
> \_width is always the LARGEST width the movieclip  
> ever has – not its CURRENT width. In my case the mc is being  
> made larger and larger, using a tween made in the authoring  
> environment. The clip starts out tiny and ends up 400 pixels wide,  
> but the \_width property is 400 the entire time!
> 
> What gives??
> 
> i really appreciate enlightenment!  
> rwelti

I think you need to show the code you are using  
something like this  
mc.onEnterFrame = function() {  
this.\_width += 1;  
trace(this.\_width);  
};

gives the expected result

---

<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: [August 30, 2004, 6:35pm UTC](https://forum.kirupa.com/t/-width-not-changing-during-tween-is-it-useless/62618/3 "2004-08-30T18:35:34Z")

</div>

Hi Stringy,

I’m not trying to change the mc.\_width, just make a decision  
based on it.

I made the tween in the authoring environment, so there is  
no Actionscript to show…

A breakpoint in the onEnterFrame() function shows me that  
the width of the movieclip is always 400, no matter what  
frame I’m in, even though the object is getting larger on  
the screen, as the tween progresses.

I am guessing that the intermediate values of the size tween  
simply are not being stored in the \_width property where I  
expected to find them.

I’d have to give you a .fla file but to see it, just tween a circle  
from width say 10 to width 100 across say 30 frames. Make  
an onEnterFrame() function and put a breakpoint in it. In the  
debugger, try to examine the \_width property.

Cheers and thanks for reading!  
Russ

---

<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: [August 30, 2004, 6:53pm UTC](https://forum.kirupa.com/t/-width-not-changing-during-tween-is-it-useless/62618/4 "2004-08-30T18:53:09Z")

</div>

> [@rwelti](#):
>
> Hi Stringy,
> 
> I’m not trying to change the mc.\_width, just make a decision  
> based on it.
> 
> I made the tween in the authoring environment, so there is  
> no Actionscript to show…
> 
> A breakpoint in the onEnterFrame() function shows me that  
> the width of the movieclip is always 400, no matter what  
> frame I’m in, even though the object is getting larger on  
> the screen, as the tween progresses.
> 
> I am guessing that the intermediate values of the size tween  
> simply are not being stored in the \_width property where I  
> expected to find them.
> 
> I’d have to give you a .fla file but to see it, just tween a circle  
> from width say 10 to width 100 across say 30 frames. Make  
> an onEnterFrame() function and put a breakpoint in it. In the  
> debugger, try to examine the \_width property.
> 
> Cheers and thanks for reading!  
> Russ

Motion tween your mc on its \_parent timeline rather than shape tween on its own.(otherwise \_width will always be the same)

---

<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: [August 31, 2004, 8:05pm UTC](https://forum.kirupa.com/t/-width-not-changing-during-tween-is-it-useless/62618/5 "2004-08-31T20:05:14Z")

</div>

Thanks.

I found the issue: the movie clip included a mask, and the mask  
was the item whose \_width was being returned, since it was larger than  
the circle inside of it.

Which makes a different issue. In order to get at  
the circle’s \_width (as a masked shape) it seems I have to make it it’s own mc.

If I do that, I can’t shape tween it, I have to motion tween it, and when  
motion tweened it gets thicker as it gets larger, which is not what I want.  
I tried converting lines to fills, no change. The shape tween is the one that  
lets me keep the circle the same thickness, and shape tweens apparently  
can’t be applied to movieclips… Aaargh!

Actually you can see the circles in action at [http://www.iris.edu/swaves/EQ.html](http://www.iris.edu/swaves/EQ.html)  
They are the red circles. (Hit the Play button)

I have not tried tweening it in the parent’s timeframe. That’s a whole  
nother basket of fish. Not sure. Anyway thanks a lot for answering!

rwelti

---

<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: [August 31, 2004, 8:12pm UTC](https://forum.kirupa.com/t/-width-not-changing-during-tween-is-it-useless/62618/6 "2004-08-31T20:12:06Z")

</div>

> [@rwelti](#):
>
> Thanks.
> 
> I found the issue: the movie clip included a mask, and the mask  
> was the item whose \_width was being returned, since it was larger than  
> the circle inside of it.
> 
> Which makes a different issue. In order to get at  
> the circle’s \_width (as a masked shape) it seems I have to make it it’s own mc.
> 
> If I do that, I can’t shape tween it, I have to motion tween it, and when  
> motion tweened it gets thicker as it gets larger, which is not what I want.  
> I tried converting lines to fills, no change. The shape tween is the one that  
> lets me keep the circle the same thickness, and shape tweens apparently  
> can’t be applied to movieclips… Aaargh!
> 
> Actually you can see the circles in action at [http://www.iris.edu/swaves/EQ.html](http://www.iris.edu/swaves/EQ.html)  
> They are the red circles. (Hit the Play button)
> 
> I have not tried tweening it in the parent’s timeframe. That’s a whole  
> nother basket of fish. Not sure. Anyway thanks a lot for answering!
> 
> rwelti

I think if you do the outline as hairline, you can motion tween with no increase in thickness
