|
|
Play Buttons - ActionScripting for a play button. | ||
Discussion by busdriver630 with 9 Replies.
Last Update: October 28, 2010, 11:01 pm | |||
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
Wed Apr 13, 2005 Reply New Discussion
Wed Jun 1, 2005 Reply New Discussion
The code will look like this:
gotoAndPlay(replace this with the frame number);
Wed Jun 1, 2005 Reply New Discussion
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.
Tue Feb 21, 2006 Reply New Discussion
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
Fri Dec 21, 2007 Reply New Discussion
CODE
<%@ Page Language="VB" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.W3.Org/TR/xhtml1/DTD/xhtml1-transitional.Dtd"><script runat="server"></script><html xmlns="http://www.W3.Org/1999/xhtml"><head id="MasterHead" runat="server"><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>Thu Aug 20, 2009 Reply New Discussion
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 KennyMon Nov 30, 2009 Reply New Discussion
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 sailchocMon Dec 14, 2009 Reply New Discussion
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
Sun May 30, 2010 Reply New Discussion
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
Thu Oct 28, 2010 Reply New Discussion
Flash On Web Page using flash on a web page (3)
|
(5) The History Of Logo Design
|
Index




