PDA

View Full Version : else if button woes..... :(


chromehenge
01-07-2002, 02:59 PM
ok, i am doing something really simple and stupid here, but I cannot figure where I am going wrong.... I need a little help from a brighter mind apparently.

my button AS:

*******************************************
on (rollOver) {
if (instance_name._currentFrame == 1) {
tellTarget ("instance_name") {
}
gotoAndPlay (2);
} else if (instance_name._currentFrame>1) {
stop ();
}
}

********************************************

as should be apparent, the button should (on rollover) check the MC in question, and if the MC's current frame is 1, advance to 2, otherwise leave it alone.

i would have thought that this is fairly simple, but the target MC ("instance_name" is indeed it's instance name and it is sitting at _root...) just sits there and ignores me!

what the heck have I done or not done here?

thanx in advance!

-kr0m3

mad_A
01-07-2002, 03:05 PM
your code...

on (rollOver) {
if (instance_name._currentFrame == 1) {
tellTarget ("instance_name") {
}
gotoAndPlay (2);
} else if (instance_name._currentFrame>1) {
stop ();
}
}


should be


on (rollOver) {
if (instance_name._currentFrame == 1) {
tellTarget ("instance_name") {
gotoAndPlay (2);
}
} else if (instance_name._currentFrame>1) {
stop ();
}
}

Tilly
01-07-2002, 03:08 PM
i dont know if this is the solution to your problem, but you should place the action 'gotoAndPlay(2)' between the curly braces belonging to the TellTarget action (now it's not).

TellTarget(blah) {
your action
}

But in Flash 5 you do not need the tellTarget action anymore, you can just use the dot notation:

myMovieClip.gotoAndPlay(some frame);

Cheers,

Tilly

chromehenge
01-07-2002, 03:30 PM
that is exactly what i needed! thanks to both of you for your help, it is greatly appreciated!

~peace~