PDA

View Full Version : Button on(rollOver) not working


Thurston
11-22-2006, 04:13 AM
I have four buttons, but I just use these to trigger my menus that fade in and fade out. The first one works, but the others don't. I have one line with my action script... I'll try to explain it below.

Actionscript in buttons (these are different for each button and the menuItem variable is changed on each rollOver...it's suppose to anyways). There is just a stop() command at each of the frames at 7,19,31,& 41 when the menus are at full alpha:

on (rollOver) {
if( this._currentframe == 7 ) {
stop(); }
else{
menuItem = "Info";
if( this._currentframe == 19 ) {
gotoAndPlay( this._currentframe + 1 ); }
if( this._currentframe == 31 ) {
gotoAndPlay( this._currentframe + 1 ); }
if( this._currentframe == 43 ) {
gotoAndPlay( this._currentframe + 1 ); }
}
}

Actionscript when reaching the end of each menu fade out section:

if ( menuItem == "Info" ) {
gotoAndPlay(2); }
if ( menuItem == "Comm" ) {
gotoAndPlay(14); }
if ( menItem == "Guard" ) {
gotoAndPlay(26); }
if ( menuItem == "Peep" ) {
gotoAndPlay(38); }
else {
stop(); }

I have buttons that check for the rollOver command that fade in a movie clip symbol that contains my menu buttons...I have 4 buttons with 4 submenus. But they don't work...var menuItem is set to "Info" and the first submenu fades in and stops at frame 7 as it should but after that, trace messages from the first "Info" button ONLY will respond on rollOver. ANY CLUES??? Thanks!

Thurston
11-22-2006, 03:01 PM
Should I make my menu buttons something besides buttons, since they really don't have any function but to bring up the submenus on rollOver? Logically, to me, it looks like my actionscript should work, but only the trace messages from my first submenu will work when it starts. The others don't send trace messages...it's sort of like the rollOver is not being detected. Yes, they are at the front too.

Thurston
11-23-2006, 05:23 AM
ok, I fixed my original problem, but I think I have a problem somewhere else. It's like my actionscript is working slower than the timeline. Check out my fla file please. I don't want someone too fix it, just tell me what I did wrong so I don't do it again...well, and so I can fix this menu too! Thanks!

3pepe3
11-24-2006, 10:01 PM
wow, i saw your file and it's a mess and full of tweens and animations, i think you are going to have a lot of problems when you are going to put the displayed information.
Try to leave all the frames clean and buttons more organizated... Almost all the things i saw in you file can be acomplished via actionScript for example
to push the button and make it smaller you just need this code in first frame:

tryme.onPress = function() {
tryme._xscale = tryme._yscale=90;
};
tryme.onRelease = function() {
tryme._xscale = tryme._yscale=100;
};

here you can modify the button very easy and delete all the 49 frames.
also you can
make them more animated


tryme2.onPress = function() {
onEnterFrame = function () {
tryme2._xscale = tryme2._yscale -= 5;
if (tryme2._xscale == 85) {
delete this.onEnterFrame;
}
};
};
tryme2.onRelease = function() {
onEnterFrame = function () {
tryme2._xscale = tryme2._yscale += 5;
if (tryme2._xscale == 100) {
delete this.onEnterFrame;
}
};
};
//this code is not very well configurated but is the example


this is not the solution to you problem... this is the explication and examples.
:rolleyes:

Thurston
11-25-2006, 05:00 AM
Thanks for the reply. I understand what your talking about when you say my file is messy. I guess I should have explained that this is just a menu heading that will just be in a php includes header file to replace a current menu. This will not have any pages or information included inside the actual flash, but will only direct to php pages.

Thanks for the information; I will work with it to see if I can get my problems worked out? I think if I get rid if a lot of what I already have that was making it cumbersome then it might be easier to find my problems. Thanks!