# My first code

**URL:** <https://forum.kirupa.com/t/my-first-code/150460>\
**Category:** Uncategorized\
**Created:** [June 7, 2005, 7:04pm UTC](https://forum.kirupa.com/t/my-first-code/150460 "2005-06-07T19:04:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smart\_layer](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@smart\_layer](https://forum.kirupa.com/u/smart_layer)\
**Post date:** [June 7, 2005, 7:04pm UTC](https://forum.kirupa.com/t/my-first-code/150460/1 "2005-06-07T19:04:13Z")

</div>

hi  
i am new to kirupa and i am trying to learn ActionScript,  
i tried a tutorial and the code is

```auto
 onClipEvent (load) {
 var scale = 1;
 _xscale = _yscale=1;
 _rotation = Math.random()*360;
}
onClipEvent (enterFrame) {
 scale += 5;
 if (scale>100) {
 scale = 1;
 _rotation = Math.random()*360;
  }
 _xscale = _yscale= scale;
}
 

```

the code works but i did not understand why the code must have:  
\_xscale = \_yscale= scale;  
in the onClipEvent (enterFrame) section

also why i have to write the:  
\_rotation = Math.random()\*360;  
in the IF statment  
thanks for your help 🙂
