# Looping a MC and if inside the loop

**URL:** <https://forum.kirupa.com/t/looping-a-mc-and-if-inside-the-loop/323826>\
**Category:** flash\
**Created:** [July 20, 2011, 7:54am UTC](https://forum.kirupa.com/t/looping-a-mc-and-if-inside-the-loop/323826 "2011-07-20T07:54:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ikirily](https://avatars.discourse-cdn.com/v4/letter/i/58f4c7/32.png) [@ikirily](https://forum.kirupa.com/u/ikirily)\
**Post date:** [July 20, 2011, 7:54am UTC](https://forum.kirupa.com/t/looping-a-mc-and-if-inside-the-loop/323826/1 "2011-07-20T07:54:27Z")

</div>

This is my first Problem. hope u can help me with this… ☹  
-: b1 = blade… rotating and moving along y axis…  
its position in the stage is x = 120 and y = 20… but when i test it tracing(\_y) shows dat d first value comes 42.85 and not 20(value from the properties)…  
i dont know how to get its exact value just like what is seen from the properties…  
i’ve tried to have an if statement that if the value of \_y = to the y coordinate the blade position that will alter its movement, it never turns like i want… please help me…  
here is my facebook email add( [punisheryuri11@gmail.com](mailto:punisheryuri11@gmail.com) )… please help me if u have a spare time…

onClipEvent (enterFrame) {   
\_root.b1.\_y += 2;  
\_rotation += 30;  
trace(\_y);  
}

-:this is my second problem…

- i have 20 b1(blades), i want to make a short code that loops, b1 - b2 -\> b20 so i dont have to copy and paste my code several times… please help me with this… tnx…  
sorry for stupidity about this, im a newbie in flash…

if(\_root.b1.hitTest(\_x, \_y, true)){  
hit = “hitted”;  
\_rotation = 180;  
\_x -= 5;  
\_y += 5;  
trace(hit);   
}
