I can’t figure out these variables in whatever timelines
If I had something like
MAIN TIMELINE
mini = 10;
MC TIMELINE
trace(mini);
it displays undefined, right?
so do I ALWAYS have to make it a
trace (_root.mini);
for it to display 10?
and, what’s the difference between
var sweetness = 10
and
sweetness = 10
?
I read the tutorial and all, but that confused me even more if anything
Aslo, since I’m already asking questions, gotoAndPlay(nextFrame) is the same thing as nextFrame alone, right?
How do I have it play the nextframe in a MC without having to type the number every time?
It’s a hassle to go and change the the numbers after you change the length of your frames.
I guess if you do something like this:
to answer your first question, yes… you must always use _root.variable to access the variable if it is on the main timeline and you are in a movies scope. If you do a search on _parent you can use that instead of _root also.
The difference between var variable_name=10 and just variable name=10 is that the var is a “temporary” variable, you use var variable_name=10 in functions so that once the function is over it deletes the variable.
whoa, that answered a lot. Um… functions… one thing I don’t get about them
function sweetness(candy){
something happens;
}
what is the variable (or number) in the ( )'s? How are they used? I’ve read the tutorials on it, but still need someone to break it down sorry for the inconvenience.
for your stop() question: everything will be executed no matter where the stop function is. it stops the frames from proceeding not the line execution number.
for your function count() question:
[AS]
function count(num)
{
var counted = num;
trace(counted);
}
var test = 1;
count(test); // 1
test++;
count(test); // 2
test++;
count(test); // 3
test += 1000;
count(test); // 1003
[/AS]
you cant.
at least not in that format.
you need to give a function a name if you intend to call it more than once…, ie.
function about(){
aboutme_anime.play()
}
then if you want to call it you simply write
about()
if it is on the same directory… ie. if its in a movie clip or the code you are trying to call the function from is in a movieclip you would need a path reference like _parent.about()
if you want to apply it to the button* l_aboutme* you use this (once your function is declared such as above, on the same path):