# as2 to as3 questions

**URL:** <https://forum.kirupa.com/t/as2-to-as3-questions/319137>\
**Category:** flash\
**Created:** [February 10, 2011, 1:19am UTC](https://forum.kirupa.com/t/as2-to-as3-questions/319137 "2011-02-10T01:19:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![molster](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@molster](https://forum.kirupa.com/u/molster)\
**Post date:** [February 10, 2011, 1:19am UTC](https://forum.kirupa.com/t/as2-to-as3-questions/319137/1 "2011-02-10T01:19:20Z")

</div>

NOTE: I know I could make a class for this, but I was hoping to know how to do this without making a class just for the line mc.

Want to do something very simple, I have a mc thats a line, I am able to place it just fine… heres the deal in as2 I could do

line.onEnterFrame = function() {  
this.\_y +4  
}

however, I have this in as3…and it moves the full stage, how would I go about doing this so that It only moves the line mc (note: a new line mc is made every 2 seconds)

```auto

addEventListener(Event.ENTER_FRAME,bg);
function bg(event:Event) {
timer ++;
if (timer == 30) {
	timer=0;
var myImageMovie:line = new line();
myImageMovie.y = 20;
myImageMovie.addEventListener(Event.ENTER_FRAME,linecode)

bgmc.addChild (myImageMovie);

}

}
function linecode(event:Event) {
	this.y +=3
}

```
