# Align Clip on stage that has wide masking

**URL:** <https://forum.kirupa.com/t/align-clip-on-stage-that-has-wide-masking/184651>\
**Category:** flash\
**Created:** [April 6, 2006, 4:22pm UTC](https://forum.kirupa.com/t/align-clip-on-stage-that-has-wide-masking/184651 "2006-04-06T16:22:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![forwardtrends](https://avatars.discourse-cdn.com/v4/letter/f/cab0a1/32.png) [@forwardtrends](https://forum.kirupa.com/u/forwardtrends)\
**Post date:** [April 6, 2006, 4:22pm UTC](https://forum.kirupa.com/t/align-clip-on-stage-that-has-wide-masking/184651/1 "2006-04-06T16:22:01Z")

</div>

Is there a way to say “only use the coords of the viewable area” when aligning a mc that is masking a really wide object? (I’m looping through XML and duplicating MC’s inside a centered mc and under a mask.)

Thanks

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [April 6, 2006, 4:23pm UTC](https://forum.kirupa.com/t/align-clip-on-stage-that-has-wide-masking/184651/2 "2006-04-06T16:23:28Z")

</div>

just refer to that “centered mc” instead of the entire movieclip.

---

<div class="post-metadata">

**Author:** ![forwardtrends](https://avatars.discourse-cdn.com/v4/letter/f/cab0a1/32.png) [@forwardtrends](https://forum.kirupa.com/u/forwardtrends)\
**Post date:** [April 6, 2006, 4:26pm UTC](https://forum.kirupa.com/t/align-clip-on-stage-that-has-wide-masking/184651/3 "2006-04-06T16:26:38Z")

</div>

I can’t - this entire movie is loaded inside another which is ease-centering all the content - it takes the width of the empty MC I load into. I’m then centering more content inside the loaded clip.

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [April 6, 2006, 4:28pm UTC](https://forum.kirupa.com/t/align-clip-on-stage-that-has-wide-masking/184651/4 "2006-04-06T16:28:58Z")

</div>

you got some code? i’ll see if i can coerce it into submission:)

---

<div class="post-metadata">

**Author:** ![forwardtrends](https://avatars.discourse-cdn.com/v4/letter/f/cab0a1/32.png) [@forwardtrends](https://forum.kirupa.com/u/forwardtrends)\
**Post date:** [April 6, 2006, 4:35pm UTC](https://forum.kirupa.com/t/align-clip-on-stage-that-has-wide-masking/184651/5 "2006-04-06T16:35:51Z")

</div>

There are 3 different movie’s we are talking about here… the main shell (top drop down nav), the underlying empty clip that I load everything into (which is always ease-centered using a simple ease function based on it’s height and width), and the actual content clips that I load in.

Normally the empty loader clip size inherits the dimensions of the loaded file, but when this file also uses a noScale stage, centered clip, and masked content - things go haywire (all because I’m duplicated 200 or so clips vertically and it pushed everything up and down)

The code itself is just basic:

Shell:

Stage.align = “TL”;  
Stage.scaleMode = “noScale”;

On the loader clip:

onClipEvent (enterFrame) {  
endY = (Stage.height / 2) - (this.\_height / 2);  
endX = ((Stage.width / 2) - (this.\_width / 2));  
\_x += (endX-\_x)/speed;  
\_y += (endY-\_y)/speed;  
}

Inside the loaded movie:

onClipEvent (enterFrame) {  
endY = (\_parent.\_height / 2) - (this.\_height / 2);  
endX = ((\_parent.\_width / 2) - (this.\_width / 2));  
\_x += (endX-\_x)/speed;  
\_y += (endY-\_y)/speed;  
}

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [April 6, 2006, 4:47pm UTC](https://forum.kirupa.com/t/align-clip-on-stage-that-has-wide-masking/184651/6 "2006-04-06T16:47:41Z")

</div>

do you have the loop code handy?

---

<div class="post-metadata">

**Author:** ![B\_L\_U\_E](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@B\_L\_U\_E](https://forum.kirupa.com/u/B_L_U_E)\
**Post date:** [April 6, 2006, 4:48pm UTC](https://forum.kirupa.com/t/align-clip-on-stage-that-has-wide-masking/184651/7 "2006-04-06T16:48:45Z")

</div>

instead of referring to the entire loaded movie, use another mc like defective said. It would like [AS]onClipEvent (enterFrame) {  
endY = (\_parent.\_height / 2) - (this.center\_mc.\_height / 2);  
endX = ((\_parent.\_width / 2) - (this.center\_mc.\_width / 2));  
\_x += (endX-\_x)/speed;  
\_y += (endY-\_y)/speed;  
}[/AS]center\_mc being the mc

---

<div class="post-metadata">

**Author:** ![forwardtrends](https://avatars.discourse-cdn.com/v4/letter/f/cab0a1/32.png) [@forwardtrends](https://forum.kirupa.com/u/forwardtrends)\
**Post date:** [April 6, 2006, 4:50pm UTC](https://forum.kirupa.com/t/align-clip-on-stage-that-has-wide-masking/184651/8 "2006-04-06T16:50:34Z")

</div>

Gotcha - let me try it out - thanks guys
