# Please help! how to attach tween classes to my code

**URL:** https://forum.kirupa.com/t/please-help-how-to-attach-tween-classes-to-my-code/178436
**Category:** flash
**Created:** [February 10, 2006, 3:36pm UTC](https://forum.kirupa.com/t/please-help-how-to-attach-tween-classes-to-my-code/178436 "2006-02-10T15:36:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![romka](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@romka](https://forum.kirupa.com/u/romka)
#### Post date: [February 10, 2006, 3:36pm UTC](https://forum.kirupa.com/t/please-help-how-to-attach-tween-classes-to-my-code/178436/1 "2006-02-10T15:36:53Z")

</div>

[FONT=Times New Roman][SIZE=3]Hei,[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]I’m urgently looking for a solution how to attach tween classes into this code to make movement little smoother. Or to make up the whole thing on tween classes.[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3](this is background mc which moves up and down when clicking menu buttons).[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]Here is the code for background mc:[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman]onClipEvent (load) {[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] \_x = 0;[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] \_y = 0;[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] div = 30; [/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman]}[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman]onClipEvent (enterFrame) {[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] \_x += (endX-\_x)/div;[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] \_y += (endY-\_y)/div;[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman] \_root.menu1.onRelease = function() {[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] endX = 0;[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] endY = 0;[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] };[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] \_root.menu2.onRelease = function() {[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] endX = 0;[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] endY = -500;[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] };[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] \_root.menu3.onRelease = function() {[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] endX = 0;[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] endY = -1000;[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] };[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] \_root.menu4.onRelease = function() {[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] endX = 0;[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] endY = -1500;[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] };[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] \_root.menu5.onRelease = function() {[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] endX = 0;[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] endY = -2000;[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] };[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3]}[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman]Thanx for any help! [/FONT][/SIZE]
