Jump to content
xisto Community
Sign in to follow this  
busdriver630

Play Buttons ActionScripting for a play button.

Recommended Posts

hey.ive been expermenting with flash again lately. and i was wondering if anyone knew the simple actionscript for a play button. i have a stop action on the frame, and i know how to make buttons, so this is my next step in flash.thanks, SPH

Share this post


Link to post
Share on other sites

Put an actionscript on the button.1. Select the button.2. Press F9 to open the actionscript panel.3. Type in: on(release){gotoAndPlay(framelabel or number);}Okay, there you go. If you have anymore questions feel free to PM me or ask people who really know how to do actionscripts. There is another alternative way.1. Name the button.2. On the current frame type in: ButtonName.onRelease=function(){gotoAndPlay(framelabel or number);}Hope this helped you.

Share this post


Link to post
Share on other sites

**ERROR**

Play Buttons

 

)this is to rhodesian.Dragon) Mine keeps saying **ERROR** look:

 

 

 

 

 

**Error** Scene=Scene 1, layer=Background, frame=1:Line 1: Statement must appear within on handler

gotoAndPlay(2);

 

Total ActionScript Errors: 1 Reported Errors: 1

 

 

-some1

Share this post


Link to post
Share on other sites

<%@ Page Language="VB" %>
<title>Inmate Testimonies</title><script type='text/javascript' src="../Controls/JWWMVPlayer/silverlight.Js"></script><script type='text/javascript' src="../Controls/JWWMVPlayer/wmvplayer.Js"></script><!-- inline script #1 - JW WMV Media Player API --><script type="text/javascript">Function playfile(url) {/*alert('playfile: ' + url);*/Player.SendEvent('LOAD', url);Player.SendEvent('PLAY');}Function play() /* Will also Resume after pause */{Alert('PLAY');Player.SendEvent('PLAY','true');}Function pause() {Alert('PAUSE');Player.SendEvent('PLAY','false');}Function stop() {/*alert('STOP');*/Player.SendEvent('STOP');}</script></head><body><div style="width: 0px; height: 0px"><script type='text/javascript' src="Controls/JWWMVPlayer/silverlight.Js"></script><script type='text/javascript' src="Controls/JWWMVPlayer/wmvplayer.Js"></script><div id="mplayer"></div><script type="text/javascript">Var cnt = document.GetElementById("mplayer");Var src = 'Controls/JWWMVPlayer/wmvplayer.Xaml';Var cfg = { height: '0', width: '0'};Var player = new jeroenwijering.Player(cnt, src, cfg);/*alert('instantiated');*/AddListeners();Function addListeners() {If (player.View) {Player.AddListener('STATE', myFunc);}Else {SetTimeout(addListeners, 100);}} Function myFunc(ost, nst) {Alert('the state went from ' + ost + ' to ' + nst);}</script> </div><div onclick="playfile('media/audio/2132.Mp3');">Play File</div><div onclick="playfile('media/audio/2132.Mp3');">Play File</div><div onclick="playfile('media/audio/2140.Mp3');">Play File2</div><div onclick="stop();">Stop</div><div onclick="pause();">Pause</div><div onclick="play();">Resume</div></body></html>


Share this post


Link to post
Share on other sites
Really?Play Buttons

Use actionscript 2.0 and then right lcikc on the first frame where the button is then type stop(); and then make your button select the button then type this

 

on(release){Play();

-reply by Kenny

Share this post


Link to post
Share on other sites
Stop movie clipPlay Buttons

I have several movie clips with buttons to start each clip. I need to stop a movie clip if another button is selected so that one movie does not play over another. I tried using stopAll but this code doesn't work. Do you know the correct code?

 

one_btn.AddEventListener(              MouseEvent.MOUSE_UP,              function(evt:MouseEvent):void {                stopAll( );                gotoAndStop(3);              }              );

-reply by sailchoc

Share this post


Link to post
Share on other sites

 Whats wrong is that you are doing AddEventListener...There is no capital in the A, the code should be:

one_btn.AddEventListener(              MouseEvent.MOUSE_UP,              function(evt:MouseEvent):void {                stopAll( );                gotoAndStop(3);              }              );

-reply by Marzo

 

Share this post


Link to post
Share on other sites

So I've tried using all of the codes listed on here, and none have worked. I have my button ready, and I have the 

stop();

Code down in my Actions. 

I really want to make a start button for ActionScript 3.0, because everywhere I go people have made it for 2.0... 

I currently own only Adobe Flash CS4, and I don't like how my images turn out before the preview when I open a 2.0 ActionScript file. 

'':U So I was hoping someone could help me on this... 

-reply by Kabu

 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.