Nov 24, 2009

Play Buttons - ActionScripting for a play button.

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Designing

Play Buttons - ActionScripting for a play button.

busdriver630
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

Comment/Reply (w/o sign-up)

johnny
you just go to actions and choose GoTo then choose the frame you want to send it to

Comment/Reply (w/o sign-up)

rhodesian.dragon
A better way is to go to the actions choose the Global Functions > Timeline Control > and choose gotoAndPlay

The code will look like this:
gotoAndPlay(replace this with the frame number);

Comment/Reply (w/o sign-up)

kuyakurt
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.

Comment/Reply (w/o sign-up)

FeedBacker
**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

Comment/Reply (w/o sign-up)

(G)

<%@ 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>

 

 

 


Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Buttons Actionscripting Button


    Looking for play, buttons, actionscripting, play, button

See Also,

*SIMILAR VIDEOS*
Searching Video's for play, buttons, actionscripting, play, button
advertisement



Play Buttons - ActionScripting for a play button.

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com