ok, so i just want to know, how do I add a play button at the beggining of my flash animation, how do I stop it from looping, how do i create a hyperlink at the end and how do I get the correct source code? I tried opening it in internet explorer but the code didn't work when I put it on my site, www.dannycaller.tk :bashhead:
play, stop, link and code
Started by rellac, Jul 06 2007 11:02 AM
4 replies to this topic
#1
Posted 06 July 2007 - 11:02 AM
#2
Posted 14 July 2007 - 09:55 AM
I will have to look into the play button one since it is a little (not much) technical then the stop, for the stop button you would simply select the stop button and then in the action script add:
Hoot
stop();and it should stop what you are trying to stop. I will look into the play one since I haven't used flash in some time.
Hoot
#3
Posted 15 July 2007 - 08:53 AM
Hoot, on Jul 14 2007, 09:55 AM, said:
I will have to look into the play button one since it is a little (not much) technical then the stop, for the stop button you would simply select the stop button and then in the action script add:
stop();and it should stop what you are trying to stop. I will look into the play one since I haven't used flash in some time.Hoot
#4
Posted 15 July 2007 - 09:24 AM
to create a play button, you first need to put the actionscript
On this first frame, which you have put the stop coding on, create a movieclip or a button (movieclips are more commonly used today, even as buttons) which will be your Play button. Use this actionscript for that movieclip/button:
I know that code will work on a movieclip, if it doesnt on a button, just remove _root.
As for stopping the movie from looping, simply put
If you want to create a hyperlink, use this code:
Of course, you can choose _blank, _parent, _self etc.
stop();on your first frame, this way the movie does not automatically start. (If you want the user to press play when no part of the movie is showing at all, insert a new frame at frame 1 so that the play button will be on a blank screen.)
On this first frame, which you have put the stop coding on, create a movieclip or a button (movieclips are more commonly used today, even as buttons) which will be your Play button. Use this actionscript for that movieclip/button:
on(release) {
_root.play();
} I know that code will work on a movieclip, if it doesnt on a button, just remove _root.
As for stopping the movie from looping, simply put
stop();on your last frame.
If you want to create a hyperlink, use this code:
on(release) {
getURL("http://www.website.com", "_blank");
}
Of course, you can choose _blank, _parent, _self etc.
#5
Posted 15 July 2007 - 08:51 PM
What version of Flash are you using? If its Flash CS3, you'll have to set your Actionscript settings to 2.0. Also, I suggest you use:
Rather than:
For the functions noted above. The on() and onClipEvent() methods shouldn't be used much anymore. Unfortunately most tutorials still teach people to use them, even though they have been replaced by much more useful methods that promote better coding practices.
this.onRelease = function(){
}
Rather than:
on(release){
}
For the functions noted above. The on() and onClipEvent() methods shouldn't be used much anymore. Unfortunately most tutorials still teach people to use them, even though they have been replaced by much more useful methods that promote better coding practices.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
