View Full Version : What's wrong with this script?
dynastyjp
October 1st, 2003, 01:13 PM
(MX)
on (release) {
}
function doneDelay(){
_root.contents.loadMovie("locations.swf");
clearInterval(delay);
}
delay = setInterval(doneDelay, 1000);
}
claudio
October 1st, 2003, 01:17 PM
The function is outside the on(release)event :sigh:
lostinbeta
October 1st, 2003, 01:20 PM
Originally posted by claudio
The function is outside the on(release)event :sigh:
Everything is outside the on (release) event. I am guessing a miscount in curly brackets since there is one extra (the one right before the function declaration).
May I ask why you define the function in the on(release) event though?
dynastyjp
October 1st, 2003, 01:25 PM
Originally posted by claudio
The function is outside the on(release)event :sigh:
Some people can be so arrogant here, but anyway. What I'm trying to do is setup a delay in a movie playing until a certain event is finish. I've been going through the threads and trying to setup to work but I'm getting all types of erros. I'm new to Action Script, at this level anyway. I have a button that loads a movie..but first it plays a frame that fades a certain image out..then i want it to load the external swf. But obviously the .swf loads before the frame label animation is complete. I've been trying to figure out by reading various threads but it's not working out to well. Any help would be appreciated.
lostinbeta
October 1st, 2003, 01:28 PM
Claudio wasn't being arrogant, he was just stating that you closed your on (release) event and then defined all your code outside of it, and that is why nothing was working, because nothing was defined in the on (release) event. You should have gotten an error with that (assuming you did) since any actions defined on a specific clip or button must be within a handler.
As for your problem, why don't you define the loadMovie() code on the last frame of your frame label animation. That way the last frame will be hit in the animation and the loadMovie will be called then.
dynastyjp
October 1st, 2003, 02:11 PM
Originally posted by lostinbeta
Claudio wasn't being arrogant, he was just stating that you closed your on (release) event and then defined all your code outside of it, and that is why nothing was working, because nothing was defined in the on (release) event. You should have gotten an error with that (assuming you did) since any actions defined on a specific clip or button must be within a handler.
As for your problem, why don't you define the loadMovie() code on the last frame of your frame label animation. That way the last frame will be hit in the animation and the loadMovie will be called then.
Duh..why didn't I think of that..I'm an idiot. Thanks! And sorry claudio.
claudio
October 1st, 2003, 08:51 PM
I wasnt being arrogant, i gave that answer without further explanations because i was kinda busy at the moment.
lostinbeta
October 1st, 2003, 09:43 PM
Meh, since it is typing sometimes things just come out wrong and are misinterpreted. Everyone has done it. I've done it, you've done it, he's done it, she's done it, that person over there has done it, my dog did it once too (boy is that an understatement ;)).
dynastyjp
October 1st, 2003, 10:39 PM
i made another thread but since everything is being posted here..I'll ask again...notice how a site like eh 2advanced.com plays an animation each time another button is clicked..meaning it animates itself in and out..how do you achieve this while taking advantage of the interval function? I'm a bit confused.
lostinbeta
October 1st, 2003, 10:42 PM
Well it is sorta like Claudios preloader w/ transition tutorial...
http://www.kirupa.com/developer/mx/preloader_transition.htm
The effect itself may be different but the method and ideas are the same.
Click Button > Play Animation > Load Movie > Play newly loaded movie
dynastyjp
October 1st, 2003, 10:53 PM
Well see I understand the concept but I'm not understanding how to make it work..eh let me explain.
b1.onRelease = function() {
if (_root.section != "profile.swf") {
_root.section = "profile.swf";
_root.transition.gotoAndPlay("closing");
I'm not fully understanding the script above and how to apply it. (even though it's explained at the bottom of the tutorial). I'm confused :(.
claudio
October 1st, 2003, 11:07 PM
You can use another method:
Click button -> Play unloading animation of current movie -> load new movie
claudio
October 1st, 2003, 11:16 PM
Heres one example (i havent used any preload code tough)
here (http://membres.lycos.fr/siteclaudio/)
claudio
October 1st, 2003, 11:17 PM
That piece of code checks for the value of the variable section. Just to avoid loading the same section twice in a row.
dynastyjp
October 1st, 2003, 11:29 PM
So if I have let's say button1
should I have the script to play every unloading animation of each section that may be present?
If I have section 1's unloading animation and it's different than section 2's unloading section. Should I have both unloading animations under button 1? lol, I dont even think I'm making sense.
claudio
October 1st, 2003, 11:33 PM
Check my file
dynastyjp
October 2nd, 2003, 10:26 AM
okay.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.