PDA

View Full Version : rollOver works but not rollOut


lelales
10-03-2006, 07:18 PM
Hello,

I have the following code:on(rollOver){home.bar_movement_mc.gotoAndPlay ("in");
}

on(rollOut){home.bar_movement_mc.gotoAndPlay(_tota lframes-_currentframe);
}

rollOver works but not Roll Out. Can anyone tell me why?

thanks

lelales
10-03-2006, 07:22 PM
I also tried: function outRoll() {
_root.home.bar_movement_mc.gotoAndPlay(_totalframe s-_currentframe);
}


then on the button I have:on(rollOut){outRoll();
}
But it doesn't work. I'm publishing in Flash Player 6, actionScript 1.0.

thanks

sophistikat
10-03-2006, 07:29 PM
_totalframes & _currentframe are refrencing the root's timeline not your movieclip's timeline; give this a shoton(rollOver)
{
home.bar_movement_mc.gotoAndPlay("in");
}

on(rollOut)
{
home.bar_movement_mc.gotoAndPlay(home.bar_movement _mc._totalframes-home.bar_movement_mc._currentframe);
}

lelales
10-03-2006, 07:53 PM
It didn't work. Maybe I need to study my set up. Been working on this for over an hour.

Any other ideas?

thanks again.

sophistikat
10-03-2006, 08:10 PM
a couple... first make sure flash is returning a valid frame numberon(rollOut)
{
trace('go to frame: ' + (home.bar_movement_mc._totalframes - home.bar_movement_mc._currentframe));
home.bar_movement_mc.gotoAndPlay(home.bar_movement _mc._totalframes - home.bar_movement_mc._currentframe);
}
second... i may lose you here...if you are sending the timeline to a frame where the previous frame has a stop action flash won't allow you to move because it thinks that the frame you are calling has a stop action... stupid.. i know... i just went through a similar problem.

let me give you an example: let's say your frame label 'in' ends at frame 10 with a stop action. on rollout when you send it to frame 20 flash will see if it has any timeline actions; if it doesn't, it will use the previous frame's timeline action. in this example, it will copy frame 10's stop action.

i have an idea on how to fix this... let me try it and i'll let you know how it goes.

DarrenE
10-03-2006, 08:18 PM
Sophistikat,

You don't suppose you could help me with this issue linked below?

http://www.actionscript.org/forums/showthread.php3?t=118661

I'm trying to do just a simple onRollOver pop-up movie clip with a onRollOut close the clip.

Thanks,

Darren

lelales
10-03-2006, 08:21 PM
go to frame: 6

instead of GotoAndPlay frame 6

thanks for the help:)

lelales
10-03-2006, 08:30 PM
Also, explain exactly what you're trying to do.

I've this before, just can't figure it out now.

thanks

sophistikat
10-03-2006, 08:34 PM
quick question: why do you need _totalframes - _currentframe?
i made a sample but i proved my own theory to be wrong... can you post your file?

lelales
10-03-2006, 08:37 PM
with instructions of course:)

thanks

lelales
10-03-2006, 08:46 PM
Double click on the "home" button. You'll see the frame work for the function call. All the code is the black hit area below the home button.

http://www.caillouette.com/index2.zip

thanks:)

lelales
10-03-2006, 09:27 PM
Thanks Sophistikat for the help.

I had 15 frames instead of 14 and I had the stop command on frame 6 instead of 7. I'll post the new file right now.

Here it is. Http://www.caillouette.com/index2final.zip

double click the home button, then double click again to see the layout.

Then go back to _root, and choose the black box below home to see the code.

thanks again:)

sophistikat
10-05-2006, 05:43 AM
sorry lelales,
my work load got too much that i couldn't come back 'till now... and its only for a brief moment and then there i go back agian. i'm glad you figured it out, good luck with the rest of your project.

:)

lelales
10-05-2006, 11:15 AM
You pretty much solved the prroblem for me in regards to targeting, and the trace function showed the error in my design.

Thanks so much:)

sophistikat
10-05-2006, 08:49 PM
someone in this forum has a great signature or avatar message; use trace not drugs
i have learn a lot about efficent and proper coding because of the trace() function. i have a lot of friend call about about their problem in flash and 90% of the time i can find the problem/solution by simply asking them to place a trace here and there.