Jump to content
Search Community

adding play pause stop buttons and seekbar how to??

sututuyet test
Moderator Tag

Recommended Posts

to play and pause you just need to target the rawContent of the SWFLoader

 

here is a basic example:

 

import com.greensock.*
import com.greensock.events.LoaderEvent;
import com.greensock.loading.SWFLoader;
import flash.events.MouseEvent;

//hide buttons until swf has loaded
play_btn.visible = false;
pause_btn.visible = false;


var loadedSWF:SWFLoader = new SWFLoader("part1.swf", {container:this, onComplete:setupButtons});
loadedSWF.load();





function playSWF(e:MouseEvent):void{
	loadedSWF.rawContent.play();
}

function pauseSWF(e:MouseEvent):void{
	loadedSWF.rawContent.stop();
}	

function setupButtons(e:LoaderEvent){
play_btn.visible = true;
pause_btn.visible = true;
play_btn.addEventListener(MouseEvent.CLICK, playSWF);
pause_btn.addEventListener(MouseEvent.CLICK, pauseSWF);
}	

 

programming a seekbar is quite involved. perhaps you can find some tutorials on building a seekbar for a movie clip that is on the stage and then apply those concepts to controlling the rawContent of your swf. Unfortunately we do not have the time to provide extensive custom code solutions.

 

attached are files for that contain the code above.

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...