Groups | Blog | Home
all groups > flash actionscript > march 2007 >

flash actionscript : transition script and button script don't work together


kingmonkey
3/28/2007 7:36:32 PM
Hi

I've been experiementing with actionscripting transitions between sections...
this is the first site I have tried this with (last 3 had swf loaded in one
after another rather than transitioned between). I used some code from
kirupa.com which works for loading movies in and out, but I also have some code
for my movie buttons. I can get one or the other working, but not together, so
I guess I'm clashing code somewhere, I could do with some help please to find
what I'm doing wrong...

The transistion code and calling-up buttons is;

Code:
Menubar.b1.onRelease = function() {
if (_root.section != "about.swf") {
_root.section = "about.swf";
_root.transition.gotoAndPlay("closing");
}
};
Menubar.b2.onRelease = function() {
if (_root.section != "portfolio.swf") {
_root.section = "portfolio.swf";
_root.transition.gotoAndPlay("closing");
}
};
Menubar.b3.onRelease = function() {
if (_root.section != "contact.swf") {
_root.section = "contact.swf";
_root.transition.gotoAndPlay("closing");
}
};


and the code I have on my movie buttons is;
Code:
on (rollOver) {
gotoAndPlay("rollover");
}
on (releaseOutside, rollOut) {
gotoAndPlay("rollout");
}


Is there a way to combine them???

Thanks. Wayne.
kglad
3/28/2007 8:07:14 PM
there should be no problem with that code assuming at the end of your
transition movieclip you're using targetMovieClip.loadMovie(_root.section) for
some existing targetMovieClip instance.

you have a problem elsewhere.
kingmonkey
3/28/2007 8:38:00 PM
Hi

kglad
3/28/2007 8:44:28 PM
kingmonkey
3/28/2007 9:49:56 PM
Hi kglad

Here is the link to the main file...

www.fullfatdesigns.co.uk/fullfatdesigns.fla

kglad
3/28/2007 10:08:53 PM
your on(rollover) handlers are applied to buttons that are children of a
movieclip that has handlers defined. the parent movieclip (Menubar.b1 etc) is
going to intercept those mouse events.

to remedy move you on(rollover) etc handlers to your movieclip buttons b1, b2
and b3 on MovMenu's timeline.
kingmonkey
3/28/2007 10:25:03 PM
Great, I will try that tomorrow and let you know if I understood what you
meant... i think I do... I've only been using Flash for 6months and script goes
over my head a bit at the moment. Thanks again.
kglad
3/28/2007 10:42:16 PM
kingmonkey
3/29/2007 7:08:24 PM
Hi Kglad

I've tried putting the rollover script in with the script on the main
timeline, but without any success. Could you please point me in the right
direction on how my script should be? Thanks. Wayne
kingmonkey
3/30/2007 12:00:00 AM
kglad
3/30/2007 2:42:45 PM
here's your corrected file. the only changes are as described above:

kingmonkey
3/30/2007 6:01:50 PM
Thank you!!!! You have really helped me out!!!

kglad
3/30/2007 7:18:02 PM
AddThis Social Bookmark Button