# Need help transform AS2 code to AS3

**URL:** https://forum.kirupa.com/t/need-help-transform-as2-code-to-as3/273114
**Category:** flash
**Created:** [October 11, 2008, 2:11pm UTC](https://forum.kirupa.com/t/need-help-transform-as2-code-to-as3/273114 "2008-10-11T14:11:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![graphiste76](https://avatars.discourse-cdn.com/v4/letter/g/7feea3/32.png) [@graphiste76](https://forum.kirupa.com/u/graphiste76)
#### Post date: [October 11, 2008, 2:11pm UTC](https://forum.kirupa.com/t/need-help-transform-as2-code-to-as3/273114/1 "2008-10-11T14:11:01Z")

</div>

Someone can help me to transform this AS2 code in AS3. This code is about a speed effect (see fla attachement). I need to put it in a AS3 Fla but I’m not good in programation.  
Thanks in advance. 😃

import flash.filters.BlurFilter;  
import mx.transitions.Tween;  
import mx.transitions.easing._;  
var duration:Number = 15;  
var t1:Object = new Tween(mcToTween1, “\_x”, Elastic.easeIn, 133, 367, duration, 0);  
var t2:Object = new Tween(mcToTween1, “blur”, Elastic.easeIn, 0, 0, 1, true);  
t1.onMotionChanged = function() {  
oldx = x;  
oldy = y;  
x = mcToTween1.\_x;  
y = mcToTween1.\_y;  
///////  
vitessex = Math.round(Math.abs((x-oldx)));  
vitessey = Math.round(Math.abs((y-oldy)));  
///////  
mcToTween1.filters = [new BlurFilter(vitessex_2, vitessey\*2, 1)];  
trace(vitessex);  
};  
t1.onMotionFinished = function() {  
t1.yoyo();  
};
