Menu Help

yet for some odd reason I am not all here today. I haven’t used flash for a few months, started again 2 days ago. Trying to remember some of the code but its not coming…

if ( j = 5; ) {

lol idk anymore too much in my head…

for some reason now the rollover doesnt work…gg.

to check if a variable is equal to something or not you use ==

= is to set a variable/property/whatever to equal something

== is to check if it equals something

=== is strict equality (meaning “1” is not the same as 1 and such)

ok, now to set it to the text box…and can u suggest some books, or other actionscript advanced tuts…so i can refresh and learn all the things u kno :smiley:

Umm, I’ve never read any AS books so I can’t really recommend any from experience, but I hear Actionscript Definitive Guide 2 (MX) by Colin Moock is a very good source for getting acquainted with AS.

I personally am in love with the AS Reference inside Flash (Window/Reference), this forum, site site, and sometimes I wander over to the Bit-101.com forums and the FlashDevils.com forums. And every now and then I check out Flashkit (not the forums but the tutorials).

If I don’t find what I need at any of those sources I turn to my friend google.com :wink: Or I work my arse off to figure it out myself (good learning experience)

[edit]Oh yeah, and the online version of the Actionscript Reference (aka Actionscript Dictionary) can be found here…

http://www.macromedia.com/support/flash/action_scripts_dict.html

basically what u said is how I learned mostly what I did, but asdf I cant get the blasdf thing to work…

I forgot to incorporate the rollover color change into my version of this script so I did that just now. It turns out to be a bit more complex than I had thought. So after you figure out the last one to “X” thing I will show you how to do the rollOver :wink:

lol im so confused…i have tried all that I kno but i just seem to not get it. I will be back in about 40 min then I will try again. Hey man, do u still have ur aim name or?

Yeah I still have my AIM name, but I am rarely ever on it.

I will try and say it more clearly and maybe it will help you out…

Inside the for loop that labels the buttons (the one that uses “j” for its variable)…

if j is equal to 5, set the text label to be “X” else set the text label to be j (as in the value of the variable not the letter)

You can use the for loop that uses the variable “i” (in the pressed prototype function) as a reference on how to target the textbox if you need to, they use similar methods :wink:

k lemme try it

asdf…

is there a tutorial for this, its kinda hard to follow along.

nope, were actually testing something as we go I guess?

Precisely :wink: No tutorials that I know of.

still trying, what I think it is I am getting a error, so poop.

if (var j == 5) {
		this.button5.numLabel.text = X;
}

but I am getting a error.

X is read as a variable. Since the variable X doesn’t exist you can’t do that. Where “X” is a string (text)… so the quotes make all the difference here.

I get Unexpect “!” occured? Well poop

It should tell you want line it is on, check that line and see if everything looks fine.

Error is here:

Scene=Scene 1, Layer=actions, Frame=1: Line 21: Unexpected ‘!’ encountered
if (var j == 5) {

get rid of “var” in the if statement. I didn’t even notice that was there before. It should be if (j == 5).

the error goes away but the X doesnt show its a 5