# Play/pause toggle for embedded FLV

**URL:** <https://forum.kirupa.com/t/play-pause-toggle-for-embedded-flv/308305>\
**Category:** Uncategorized\
**Created:** [April 20, 2010, 7:02pm UTC](https://forum.kirupa.com/t/play-pause-toggle-for-embedded-flv/308305 "2010-04-20T19:02:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![saeru](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@saeru](https://forum.kirupa.com/u/saeru)\
**Post date:** [April 20, 2010, 7:02pm UTC](https://forum.kirupa.com/t/play-pause-toggle-for-embedded-flv/308305/1 "2010-04-20T19:02:41Z")

</div>

Hello,

I’m new to all of this. I have a play/pause toggle button that is working. The thing is, I also have a preloader before the video begins playing on the timeline. When the video has stopped playing and I want it to replay again, how can I make it start from where the video begins and not at the very beginning where the preloader is.

code for the play/pause button:

> on (release){  
> \_root.toggleMe();  
> theVideo.play();  
> }  
> code on timeline:

> var isPlaying:Boolean = false;

function toggleMe():Void {  
if (isPlaying) {  
stop();  
isPlaying = false;  
} else {  
play();  
isPlaying = true;  
}  
}  
I tried using this code for the play/pause button to see if replays where the video is but it doesn’t work:

> on (release) {  
> if (\_root.toggleMe() == false)  
> {  
> \_root.toggleMe() == false;  
> theVideo.play();  
> }

else {  
\_root.toggleMe() == true;  
gotoAndPlay(“replay”);  
}  
}
