How does Flash handle movieclip width?

This is more a general question than a problem I’m having. I have two movie clips. One of the movie clips is set to stay beside the other (clip2._x = clip1._x + clip1._width/2 + clip2._width/2). The code works and keeps clip 2 right beside clip 1. I tweened the width of clip 1 on the timeline and it still worked fine, clip 2 stayed right beside clip 1.

Where I started running into problems is when I tweened the width of clip 1 from inside clip 1 and not from the main timeline (I converted the object inside clip 1 to a graphic so I was still using a motion tween and not a shape tween). Clip 2 still moved with clip 1, but it no longer stayed right beside it, there was now a big gap between the two. I eventually fixed it by subtracting an arbitrary number from the end of the equation. I got the number by simple trial and error; I just kept increasing it until the boxes touched.

My question is simply, why did the width value change depending on whether the movie clip was bieng tweened on the main timeline or from inside the clip?

Because of the different timelines.

Do this simple experiment:

Draw a shape in Flash and set the width to 50.

Convert it to a movieclip, the width should still be 50.

Change the width of the movieclip to 100 - the box gets bigger. Go inside the movieclip and select the box, note the width is still 50.

From my understanding, the two are treated as different objects with their own timeline. Don’t know if that makes sense but your actions are applied to the movieclip, not the shape within it, which is why it worked the first time. When you changed the object within it no longer works because the actions still apply to the (outside) movieclip.

Does that make sense? :hr:

What if I did it the other way around. Make a box–>convert to mc–>then go inside the mc and stretch the box. The mc will be stretched on the main timeline as well. I understand what you’re saying about the seperate timelines, but is it a two way street? Does manipulating objects within an mc also have no effect on the mc holding those objects?

If you want an example of what I’m talking about make two boxes, have one box’s _x setup to be right on the edge of the other box. Then change the other box’s width both on the main timeline and from within the MC.