View Full Version : movieclip timelines
emceedee
August 22nd, 2007, 06:55 PM
hello,
how can i check if two separate movieclips on the main timeline have reached certain frames within their own timelines? what i'm trying to do is say, if movieclip1 has reached "thisFrame" and movieclip2 has reached "thisOtherFrame", then gotoAndPlay ("somewhereElse").
i've searched a lot of places and still can't find the answer. i appreciate any and all help.
thank you very much!
SacrificialLamb
August 23rd, 2007, 12:45 AM
._currentframe
this will give you the number of the frame that it is on
so you want some thing like:
if (movieclip1._currentframe== thisFrame && movieclip2._currentframe==thisOtherFrame){
_root.gotoAndPlay ("somewhereElse").
}
emceedee
August 23rd, 2007, 10:19 AM
thanks for you help!
for some reason it's still giving me trouble, though.
will ._currentframe reference a frame label or does it only recognize the frame number? i've tried it both ways and it's just not working for me :(
phena
August 23rd, 2007, 11:09 AM
.... someone was faster
SacrificialLamb
August 23rd, 2007, 02:21 PM
i think it only works for numbers but never tried labels. I had interpreted " thisFrame" as a variable of a number. What type of problems are you having? Can you upload A .fla
emceedee
August 23rd, 2007, 03:45 PM
thanks again for the help. when i put in the code, the gotoAndPlay never happens.
in the interest of time (and because i'm frustrated with this) i'm going to see if i can do what i'm trying to accomplish a little differently.
however, can you see if you know what i'm doing wrong?
let's say i have two movie clips on the main timeline (one_mc and two_mc). i have one button for each movie clip that tells the movie clip to go to frame 5 and stop on(release). when they are both at frame 5, i want the main timeline to go to the frame labeled "complete"
is this what my code should look like on the main timeline?
if (one_mc._currentframe == 5 && two_mc._currentframe == 5) {
_root.gotoAndPlay ("complete");
}
i know the buttons are working and i've tried different variations on the above code as well and it never goes to "complete"
i don't know what i'm doing wrong!
SacrificialLamb
August 23rd, 2007, 11:26 PM
have you tried using a "trace()"? Just to see if the if statement is working. Other than that if you copyed my code and it looks like you did the is no space between '_root.gotoAndPlay' and here '("complete")' that one might be my fault but I did type this in MSword and it dose not know any better. Other than that try _root.one_mc._currentframe or using that little target thing so you know you got all the names right.
emceedee
August 24th, 2007, 09:06 AM
i have tried "trace()" and that's how i know the buttons are working. it's the gotoAndPlay that's the problem, because i added an
"} else {
trace ()"
in there and that came up!
sigh...
oh, well. thanks for your help anyway :sigh:
Charleh
August 24th, 2007, 09:51 AM
You know you might need an onEnterFrame function there somewhere...
If you just put it in the root frame it will only get evaluated once...
you probably need a
onEnterFrame = function() {
// Your code
}
give it a try
emceedee
August 24th, 2007, 10:11 AM
yippee! it works!
thank you SO much!
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.