# Need help translating AS2 to AS3

**URL:** <https://forum.kirupa.com/t/need-help-translating-as2-to-as3/321184>\
**Category:** flash\
**Created:** [April 12, 2011, 9:12pm UTC](https://forum.kirupa.com/t/need-help-translating-as2-to-as3/321184 "2011-04-12T21:12:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TechReview](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@TechReview](https://forum.kirupa.com/u/TechReview)\
**Post date:** [April 12, 2011, 9:12pm UTC](https://forum.kirupa.com/t/need-help-translating-as2-to-as3/321184/1 "2011-04-12T21:12:36Z")

</div>

I have a bit of code I’ve been using successfully with AS2 but don’t know AS3 to make it work. I’ve GOT to get it in AS3.

All I need it to do is play to a certain point no more than 3 times…hopefully that will be obvious by the code. (see below)

if (!loopCount) {  
var loopCount:Number = 0;  
}  
loopCount++;  
if (loopCount \< 4) {  
this.gotoAndPlay(265);  
}  
loopCount++;  
if (loopCount \< 2) {  
this.gotoAndPlay(264);  
}

…so it plays to frame “264” twice and on the third round it goes to “265” where I have it stop()'ing.

Thanks!
