Hi I am having problems with the postloader (preloader after my animation is finished). I have finally got the preloader working, but can’t seem to get the ‘postloader’. I do not want anything fancy. I just want the whole movie (animation) to start again when a user clicks my ‘Play again?’ button. I am sorry I do not know action script and fairly new and beginning. Can someone please help me? Thanks.
Put this on your “Play Again” button:[AS]on (release) {
gotoAndPlay(1);
}[/AS]Change the frame number to wherever the animation starts.
Hi I did as you suggested and got a syntax error that read something about ‘mouse interaction cannot be in a button instance’. I even tried it within the button and no go it wouldn’t let me. I have a separate actions layer as well and do not know what to do with that. Any other ideas? I know this must be simple but I cannot figure it out. I am new to actionscript. Thanks for any help.
Select the Button Symbol on your stage, in this case the “Play Again” button. With your button selected, open the Actions Panel (F9) and then insert that script I gave you.
If this doesn’t work can you give post the exact error message you get?
:red: Which version of flash u r using. Flash 5 doesn’t support on(click) events on MOvieclips. Tryout this method. Give an instance name to the movieclip or button on the stage. Give an instance name. For example instance name “replay”.
_root.replay.onRelease = function (){
_root.yourmovieClip.gotoAndPlay (1);
}
Moreover to replay the animation perfectly that depends on the timeline structure and independent timeline should be restored for the next loop. Anyway i hope this help you to solve the problem,…best of luck :esmirk:
A postloader !? That’s of totally no use. The whole animation will already have been loaded by the time you reach the end of it.
I didn’t know what else to call it. It functions like the preloader as it is advancing to the next scene after the dumb little animation is over, less loading the whole movie. I am using Flash MX, the error message I am getting with wizard’s suggestion is:
scene=Post-loader,layers=button, Frame 102:Line 1: Mouse events are permitted only for button instance
on {release} {gotoAndPlay (1)}
I will try your suggestion ahb. Thank you. I was reading about assigning targets for this, I will possibly try this as well. I will get back to you. Thanks guys. For something that seems so simple this is a major pain.
Sounds like you’re placing the ActionScript on a frame instead of your button.
Yeah I am placing the script on a frame; on my button layer. I tried putting it within the button and the actions panel would not let me. I also tried what abhilashkk suggested. No go. I just want a button to stop the movie when it is done, and give the viewer the option to click on my ‘Play again?’ button and play the movie again if they wish. I am going to look more into target paths. I will try to also figure out how to put the actionscript on the button solely. Thanks.
I’m guessing that you are double clicking your button (as if to edit it) and then adding your script.
You need to go to your main timeline (or whatever is one level up from your button) and single-click the button. Now add the script.
Do what he said. And to stop the animation from re-playing on its own simply place: stop(); on the last frame of your movie.
I added both scripts independently to the button and nothing seems to work. I even tried quoting the string (my project name) and that didn’t work. I have a label layer with the last keyframe labeled for my button; my button layer with the last keyframe for the button and the action on that and an actions layer with the last keyframe with a stop(); I am at a wits end. I am going to try it a little while longer then forget it. Thanks for your help everybody regardless.
No, don’t do that… if you can, post the file and I’ll take a look at it.
Hi thanks. How would I post the file? The flas are each over 30 megs in size. they are huge. Did you want a mock copy of the layers for the scenes? swf?
Oh, I didn’t realize it was multiple files… try placing them inside of a .zip file and upload that.
Hi I finally got it. I put a gotoandPlay script with a quoted string of my project onto the button. As with a stop(); action on that keyframe. Thanks alot guys. You actually helped me size down to a solution. Thanks again. I am glad that it is over. Now I can actually learn actionscript now that this thing is finished. : )
:thumb:
Glad to hear you got it working.
Hi cbirke20 It sounds very strange…could u pls upload the file…
i wish I could but all hte files are huge. trust me it was strange to me. I thot it would be simple but turned out to be a hassle. The logistics of it were simple but I don’t know actionscript that is why. Thanks for your help tho.