|
-- Posted by PiXiE at 4:01 pm on Mar. 13, 2005
I'm having trouble with a loop. I have 17 buttons, instance names are button1, button2, button 3, etc. Each button needs to go to a different frame, those are labeled as part1, part2, part3, etc. This code only works for buttons 10-17: | Code: | for (i=1; i<=17; i++) { _root["button"+i].onPress = function() { myVar = getProperty(this, _name); getCharacter = myVar.charAt(6); getCharacter2 = myVar.charAt(7); if (getCharacter2>=1) { gotoAndStop("part"+getCharacter+getCharacter2); } else { gotoAndStop("part"+getCharacter); } }; } | I believe it is a problem with my if and else statements. Can anyone help?
-- Posted by PiXiE at 4:08 pm on Mar. 13, 2005
Nevermind! I figured it out. I had changed the names of the labels while playing around and forget to switch them back. I hate flash.
-- Posted by lauriebebe91 at 4:09 pm on Mar. 13, 2005
Flash can be a pain. This is the first time I've seen anyone make a topic in here, I was waiting for people to respond and go "I DONT KNOW WHAT YOURE TALKING ABOUT", because people on here seem to find it neccessary to let everyone know when they don't understand a topic.
-- Posted by PiXiE at 4:12 pm on Mar. 13, 2005
Haha, so true. They are just in it for the points. DAMN THEM!
-- Posted by Sol at 9:19 pm on Mar. 31, 2005
You mean I'm not the only one who struggles with actionscript? Hmm, since you have it figured out I dont have to screw my gray matter trying to figure out whats wrong here. I wonder how many people on lw are familar with actionscript. I'd like to have someone who can share my misery and kiss my boo boos when Flash kicks my butt.
|