Variables

i found different tuts and explanations to the variables in flash, but for some reason, i don’t really get it.

I want to give the variable “contract” the value “gold”, “silver” or “bronze” when clicking on the richt buttons. I need to give them a var, so i can use it to send it to a php form to mail it. So you see what someone has selected in the mail you find.

i added this line to the 3 buttons

on (release) {
set (contract,gold);
}

different value (silver, bronze) for the other 2 buttons, of course.

when i do a trace on it (contract). it gives back an undefined. trace is done on the movieclip where the buttons are placed.

I know that variables in flash are a bit weird, what i already think i understood is that there are variables that only work within that movieclip, variables that work in the entire scene, and so on.
I seem to have real trouble finding out where and how to declare or set up the right variables in my flash movie.Altough i already found many explanations i just seem to really miss the point, and still don’t really get it.

any further help on this subject, plzz…

thx…

what version of flash??

flash mx 2004

http://www.n99creations.com/?pID=tutorials&col=Blue&tut=basics_of_actionscript_for_flash&p=1&l=Flash_MX_04

:wink:

cool site, thx

very helpfull…

I’ve been workingmy way through the tuts on the site mentioned before, again cool site…thx

new question doh: How do the “pro’s” create a flash site? with me i usually end up with a flash site with tons of movieclips and actionscript “all over tha place”. Do you use one main movie that calls other swf’s? Put it all in one (how do you all get it organised)? Any tips and tricks on the bigger view of flash and actionscript?

That wasn’t really ONE question, lol. But i think you know what i mean…

thx

well, you would typically use separate swfs… IF you need preloaders for each page because the files sizes are big, or if when all the pages in one will be massive. Also, if you are using AS focus on some real effecient while effective codes, and keep MC count as low as possible. :wink:

PS glad you like my site… not much on it yet, because of last year of school, haven’t had time :lol:

Nathan.

well, keep up the work on your site… doing good…

So the best way is to make one “head” swf that calls in the others with preloaders…

That makes the actionscript VERY important no, dang…
I love to work in flash, but as i can make a car look good, i always have the biggest problems to get the engine in. I wish the devs of flash would implement more drag and drop thingy’s for the most important things, like sending a mail from a flash movie, or many other things.
Not that i hate actionscripting, i used to do some programming (LOOOONG time ago), but programming in, on or around a timeline makes it all a bit harder. And i can imagine if you work in the “right” way (like you said, one swf calling others) it all gets on another degree of difficulty, if i’m not mistaking.

Well, not really, you can pretty much treat all the movies you load in as one normal movie.