Share Posted November 28, 2011 I have used loaderMax to load swf file but I dont know if i can add a play/pause/stop and a seek bar to control the loaded swf Please help.. thanks alots Link to comment Share on other sites More sharing options...
Share Posted November 28, 2011 Yes. See Class SWFLoader in API Documentation http://www.greensock.com/as/docs/tween/ You can use getSWFChild to control the content of loader, your SWF Link to comment Share on other sites More sharing options...
Author Share Posted November 29, 2011 I am new to greensock and as3 could you give me an example adding play pause stop buttons and seekbar when loading swf thanks Link to comment Share on other sites More sharing options...
Share Posted November 30, 2011 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. 1 Link to comment Share on other sites More sharing options...
Share Posted January 1, 2014 Carl, thank you SO much for the above code!! You and Jack are helping me to learn to fish. Happy New Year, Steve Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now