# Extremely Easy Question about Rollout

**URL:** <https://forum.kirupa.com/t/extremely-easy-question-about-rollout/115799>\
**Category:** Uncategorized\
**Created:** [July 12, 2004, 1:20am UTC](https://forum.kirupa.com/t/extremely-easy-question-about-rollout/115799 "2004-07-12T01:20:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RadioactveChimp](https://avatars.discourse-cdn.com/v4/letter/r/7feea3/32.png) [@RadioactveChimp](https://forum.kirupa.com/u/RadioactveChimp)\
**Post date:** [July 12, 2004, 1:20am UTC](https://forum.kirupa.com/t/extremely-easy-question-about-rollout/115799/1 "2004-07-12T01:20:08Z")

</div>

I have this code attached to a button:

onClipEvent (enterFrame) {  
\_root.xInit = 150;  
\_root.yInit = 150;

```
if (_root._ymouse &gt; 50 && _root._ymouse &lt; 150) {
    _root.yChange = Math.round(_root._ymouse-this._y);
    _root.xChange = Math.round(_root._xmouse-this._x);
    _root.yMove = Math.round(_root.yChange/20);
    _root.xMove = Math.round(_root.xChange/20);
    this._y += _root.yMove;
    this._x += _root.xMove;
}
else {
	_root.yChange = Math.round(this._y - 60);
	_root.xChange = Math.round(this._x - 50);
	_root.yMove = Math.round(_root.yChange/20);		
	_root.xMove = Math.round(_root.xChange/20);
	this._x -= _root.xMove;
	this._y -= _root.yMove;
}

}instanceName.

```

onRollOutustomEasing = {};  
customEasing.pts = [{Mx:0,My:0,Nx:18,Ny:-236,Px:2,Py:-19},{Mx:20,My:-255,Nx:16,Ny:-96,Px:2,Py:119},{Mx:38,My:-232,Nx:30,Ny:186,Px:3,Py:-148},{Mx:71,My:-194,Nx:22,Ny:-46,Px:8,Py:37},{Mx:101,My:-203,Nx:30,Ny:24,Px:1,Py:-21},{Mx:132,My:-200,Nx:28,Ny:-6,Px:4,Py:6},{Mx:164,My:-200,Nx:40,Ny:2,Px:-4,Py:-2},{Mx:200, My:-200}];  
customEasing.ease = function(t,b,c,d,pl){  
var i,r;  
r = 200 \* t/d;  
for(i = 0;r\>pl[i+1].Mx;i++){  
}  
i=pl\*;  
if(i.Px != 0){  
r=(-i.Nx+Math.sqrt(i.Nx_i.Nx-4_i.Px\*(i.Mx-r)))/(2_i.Px);  
}else{  
r=-(i.Mx-r)/i.Nx;  
}  
return b-c_((i.My+i.Ny_r+i.Py_r\*r)/200);  
}

Flash says:

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 22: Statement must appear within on/onClipEvent handler  
}instanceName.

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 24: Statement must appear within on/onClipEvent handler  
customEasing.pts = [{Mx:0,My:0,Nx:18,Ny:-236,Px:2,Py:-19},{Mx:20,My:-255,Nx:16,Ny:-96,Px:2,Py:119},{Mx:38,My:-232,Nx:30,Ny:186,Px:3,Py:-148},{Mx:71,My:-194,Nx:22,Ny:-46,Px:8,Py:37},{Mx:101,My:-203,Nx:30,Ny:24,Px:1,Py:-21},{Mx:132,My:-200,Nx:28,Ny:-6,Px:4,Py:6},{Mx:164,My:-200,Nx:40,Ny:2,Px:-4,Py:-2},{Mx:200, My:-200}];

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 25: Statement must appear within on/onClipEvent handler  
customEasing.ease = function(t,b,c,d,pl){

Total ActionScript Errors: 3 Reported Errors: 3

how do I fix this

-Dean
