 |
freakout
Little Devil

Registered: Jan 2006
Local time: 05:04 AM
Location:
Posts: 14
|
I am trying to get a button to replay a movie but no luck. Thanks to XemonerdX He gave me the code to get a button to play a movie,..
// place on your button
on (release) {
_root.myMC.play();
}
//
That worked very well, but what I am trying to do is after clicking on the play button, I want it to "disapear" and then on last frame of movie, I want to have another button labelled "replay". I am stuck on what code to use for this. I have tried using alpha fade at 0% but then the button "play" doesen't seem to work? My questons are these, how to incorporate a second button labelled "replay?" with correct code? And how to get the first button labelled "play" to dissapear when clicked so that only the movie clip is played and then when movie clip stops, I want the "replay?" button to appear. Thanks to anyone who can help.
Report this post to a moderator | IP: Logged
|
01-25-2006 06:40 PM |
|
|
|  |
 |
JimmyPez
Awesome Devil

Registered: Dec 2005
Local time: 12:04 AM
Location: NY
Posts: 798
|
on the play button - keep your code the same, but after the play command - try
- ActionScript:
on(release){
_root.myMC.play();
buttonInstancename._visable=false;
}
|
place the replay button in the movie timeline,have that initially set to _visable.false; also,
then in the last frame of the movie, tell
replayButtonInstance._visable=true;
theres probably better ways to do this
Report this post to a moderator | IP: Logged
|
01-26-2006 02:41 PM |
|
|
|  |
 |
ShapeShifter
<- [Staff Member] -> this.brainCells++;

Registered: Apr 2005
Local time: 06:04 AM
Location: Sweden
Posts: 2344
|
first of all - it should be _visible and not _visable 
second.. if the code is on the button and you need to target the button itself from within it's code you can use "this"..
try:
ActionScript:
on (release) {
_root.myMC.play();
this._visible = false;
}
|
__________________
>[ Rate Me 5! ]< >[ Rate Me 4! ]< >[ Rate Me 3! ]<
One who makes no mistakes never makes anything.
Report this post to a moderator | IP: Logged
|
01-26-2006 03:47 PM |
|
|
|  |
 |
JimmyPez
Awesome Devil

Registered: Dec 2005
Local time: 12:04 AM
Location: NY
Posts: 798
|
<<< loves to spell things wrong
Report this post to a moderator | IP: Logged
|
01-26-2006 04:08 PM |
|
|
|  |
 |
|  |
 |
|  |
 |
freakout
Little Devil

Registered: Jan 2006
Local time: 05:04 AM
Location:
Posts: 14
|
Thanks guys, but I couldn't get that to work, the ActionScript:
buttonInstancename._visable=false;
|
script did nothing? not sure what I did wrong there? But I figured a workaround, but only just,,
on scene 1, I have the "play button",and the actions for this are, ActionScript:
on (release) {
gotoAndPlay("Scene 1", 1);
}
|
Then I have a new layer on my Mclip timeline labelled button, which I have a keyframe on frame 1,I also have the "play button" on this frame with same code as above. on frame 2 I added a blank keyframe and this then I found removes the button so it is not on view, "which I wanted", and at end of my Mclip I inserted another keyframe and on this one I placed my "replay button". with the following actionscript, ActionScript:
on (release) {
_root.john.play();
}
|
/ which works the same as this ActionScript:
on (release) {
gotoAndPlay("Scene 1", 1);
}
|
So, what I got is a movieclip that plays when I click on the "play" button, and then the "play button" dissapears from view as the movieclip plays out it's frames, then on the last frame of the movie a new button,"replay?" appears. all good so far...
But what the "replay?" button does, is take me back to frame 1 where I am presented with the "play ?" button.
I'm not sure how to get the replay button to, "when clicked", play the movie without seening the "play button". Anyone got any ideas?
ModAdd: Please use AS-tags to embrace your code
Report this post to a moderator | IP: Logged
|
01-26-2006 08:10 PM |
|
|
|  |
 |
ShapeShifter
<- [Staff Member] -> this.brainCells++;

Registered: Apr 2005
Local time: 06:04 AM
Location: Sweden
Posts: 2344
|
use _root.john.gotoAndPlay(2) instead.. this would move the playhead to the second frame (after the play-button) and play the animation to the end (where your replay button is)..
I would reccomend to you to get rid of the scenes.. scenes are BAD.. they are a plague.. search this forum for "bad scenes" and you will get a LOT of threads where we explain why they are so bad 
__________________
>[ Rate Me 5! ]< >[ Rate Me 4! ]< >[ Rate Me 3! ]<
One who makes no mistakes never makes anything.
Report this post to a moderator | IP: Logged
|
01-26-2006 08:29 PM |
|
|
|  |
 |
freakout
Little Devil

Registered: Jan 2006
Local time: 05:04 AM
Location:
Posts: 14
|
Thanks ShapeShifter, but I tried that and it didn't work, ? I also used (5) and so on, but it still takes me back to the start of movie? where the "play" button is. OH, there is only one Scene 1 no others, just the default one? I'll keep trying... BTW, love that little character you have within your texts, ha ha, I haven't reached that stage yet!
Also what does the moderator mean by....AS-tags?
Report this post to a moderator | IP: Logged
|
01-26-2006 08:47 PM |
|
|
|  |
 |
ShapeShifter
<- [Staff Member] -> this.brainCells++;

Registered: Apr 2005
Local time: 06:04 AM
Location: Sweden
Posts: 2344
|
hm.. can you zip up the file and post it here?
sorry 'bout that short add.. I usually write these short attention-messages but never think of that one might not know what it is.. check the picture you should use AS-tags to embrace your code-snippets.. this way the code's readability improves a lot.. I fixed your last post - you can see how it looks now 
haha.. I found that gif in my Temps and thought that it represents the best with programmig 
ShapeShifter has attached this image:
__________________
>[ Rate Me 5! ]< >[ Rate Me 4! ]< >[ Rate Me 3! ]<
One who makes no mistakes never makes anything.
Report this post to a moderator | IP: Logged
|
01-27-2006 01:21 PM |
|
|
|  |
 |
freakout
Little Devil

Registered: Jan 2006
Local time: 05:04 AM
Location:
Posts: 14
|
Sorry late reply, bin busy. Here it is zipped for you to try work out, I appreciate your involvment. It is nothing special the movie clip, just a test of how to use a play and play again button. Thanks for taking a look.
Report this post to a moderator | IP: Logged
|
01-27-2006 07:33 PM |
|
|
|  |
 |
freakout
Little Devil

Registered: Jan 2006
Local time: 05:04 AM
Location:
Posts: 14
|
I just noticed it didn't attach? I used winrar,, so will send again when i've downloaded Winzip. And try using that. Cheers.
Report this post to a moderator | IP: Logged
|
01-27-2006 07:37 PM |
|
|
|  |
 |
freakout
Little Devil

Registered: Jan 2006
Local time: 05:04 AM
Location:
Posts: 14
|
Here is the zip file ,, I hope, I used WinZip 10 this time.
Attachment: johntest.zip
This has been downloaded 425 time(s).
Report this post to a moderator | IP: Logged
|
01-27-2006 07:44 PM |
|
|
|  |
 |
freakout
Little Devil

Registered: Jan 2006
Local time: 05:04 AM
Location:
Posts: 14
|
Finally figured it out, phew! Thanks all for your help, great forum this.
Here is the zip file with finished movie.
Attachment: new john2.zip
This has been downloaded 839 time(s).
Last edited by freakout on 01-27-2006 at 08:41 PM
Report this post to a moderator | IP: Logged
|
01-27-2006 08:20 PM |
|
|
|  |
 |
| All times are GMT. The time now is 05:04 AM. |
 |
|
 |
|
|
|  |
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
< FlashDevils - Terms of use
>
Copyright, FlashDevils Community, 2002 - Flash Archive
|
|