# Control/code issue

**URL:** <https://forum.kirupa.com/t/control-code-issue/277934>\
**Category:** flash\
**Created:** [December 19, 2008, 12:47am UTC](https://forum.kirupa.com/t/control-code-issue/277934 "2008-12-19T00:47:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leetech](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@leetech](https://forum.kirupa.com/u/leetech)\
**Post date:** [December 19, 2008, 12:47am UTC](https://forum.kirupa.com/t/control-code-issue/277934/1 "2008-12-19T00:47:45Z")

</div>

Hi All,

I am fairly new to actionscripting so I assume this is a fairly newb question.

Basically, I have my animation that includes Play/Pause button that I rigged up. I dont want the the movie to loop therefore I put a stop(); in the first frame, since my button changes from a Play icon to a Pause Icon. For the life me I can not work out how to make my animation to go back to the start and change my icon from the Pause icon back to the Play icon.

I assume I need some If statements, that will say something along the lines of if at end change icon to play, how should this code be written???

Pause Button Code:  
on (release) {  
gotoAndStop(1);  
\_parent.stop();  
}

Play Button Code:  
on (release) {  
gotoAndStop(2);  
\_parent.play();  
}

I have the controller code sitting within its own movieclip.

Any help would be greatly appreciate…:ne:
