# Easier way for perspective view using lineTo

**URL:** <https://forum.kirupa.com/t/easier-way-for-perspective-view-using-lineto/220625>\
**Category:** flash\
**Created:** [March 27, 2007, 8:22pm UTC](https://forum.kirupa.com/t/easier-way-for-perspective-view-using-lineto/220625 "2007-03-27T20:22:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brucelines](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@Brucelines](https://forum.kirupa.com/u/Brucelines)\
**Post date:** [March 27, 2007, 8:22pm UTC](https://forum.kirupa.com/t/easier-way-for-perspective-view-using-lineto/220625/1 "2007-03-27T20:22:43Z")

</div>

I was experimenting with the lineTo classes and I came up with what you see in attached swf.

Now, the way I’ve done it seemed pretty laborious. I defined each coordinate for each point into a variable a referenced it like this:

```auto

pointOneX = this.logo._x;
pointOneY = this.logo._y;
pointTwoX = this.logo._x+30.8
pointTwoY = this.logo._y;
this.createEmptyMovieClip("side_mc", 1);
side_mc.beginFill(0x000000);
side_mc.lineStyle(0, 0x000000, 100);
side_mc.moveTo(midX, midY);
side_mc.lineTo(pointOneX, pointOneY);
side_mc.lineTo(pointTwoX,pointTwoY);
side_mc.lineTo(midX,midY);
side_mc.endFill();

```

Everything is executed inside an onPress -\> onEnterFrame and the code is duplicated so I’ve got like 18 createEmptyMovieClip, but changed lineTo coordinates.

If you understood that, is there a simpler way of coding this effect?
