# Generating Rectangle on Movieclip (AS3)

**URL:** <https://forum.kirupa.com/t/generating-rectangle-on-movieclip-as3/310956>\
**Category:** flash\
**Created:** [June 23, 2010, 9:47pm UTC](https://forum.kirupa.com/t/generating-rectangle-on-movieclip-as3/310956 "2010-06-23T21:47:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scheisse](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Scheisse](https://forum.kirupa.com/u/Scheisse)\
**Post date:** [June 23, 2010, 9:47pm UTC](https://forum.kirupa.com/t/generating-rectangle-on-movieclip-as3/310956/1 "2010-06-23T21:47:42Z")

</div>

Hello, I was wondering if anyone could enlighten me as to how I could generate a rectangle movieclip on top of the longest section of a frame of a movieclip using AS3?

If this is the movieclip frame, I want it to find the longest portion of the movieclip on the right.  
 ![](http://forum.kirupa.com/uploads/kirupa/6253/dc953f98525f2138.png)

And then generate a rectangular movieclip on the longest section of the frame on the right side.  
 ![](http://forum.kirupa.com/uploads/kirupa/6254/79024db7fb029d41.png)  
(Don’t mind the white bg, I just used paint quick, it won’t be there)

Does anyone know where I can begin. I can figure out how to generate the rectangle and all of that, but I am confused as to how I could determine the length of the longest portion of the movieclip, and how to tell AS3 to place it there.

Any help is appreciated,  
Scheisse
