Copy link to clipboard
Copied
Hi,
I had a Flash website that I have been eager to repurpose as an HTML5 Canvas site. I have been working with the code wizard and I'm glad to say that the first page is now 90% there. However, there is one thing that I just can't get to work. Here's what should happen:
A movie clip (van_mc) with a nested clip (vanmove_mc) is covered by an invisible button (van_btn01). The nested clip has a "stop" script on frame 1 (or frame 0 in HTML5 code, but I will use the Animate timeline numbers to explain)). On rollover the button sends the nested clip move to the "over" state on frame 2. On button rollout, the nested movie clip returns to frame 1. On button click, the nested movie clip moves to frame 3 and runs the remaining animation in the movie clip, with the final frame sending the user to a new web page.
All of that is working perfectly. The problem is that whilst I want the rollout function to work until the button is clicked, once it has been clicked I want to disable it; otherwise it interrupts the final part of the nested movie clip and we return to its frame 1. Everything is fine if the user stays over the button, but they are not guaranteed to do so after they click.
Here's the code I've used, adapted from the wizard code:
var _this = this;
stage.enableMouseOver(3);
_this.van_btn01.on('mouseout', function () {
if (_this.van_mc.vanmove_mc.currentFrame < (2)); {
_this.van_mc.vanmove_mc.gotoAndStop('car_still');
}
});
I've also sent the main timeline (_this) to a second frame that does not contain the button, but the rollout still seems to affect the action.
I hope that amkes sense. Any help gratefully received.
Thanks.
Paul
try:
var _this = this;
stage.enableMouseOver(3);
_this.van_btn01.on('mouseout', function () {
if (_this.van_mc.vanmove_mc.currentFrame < 2) {
_this.van_mc.vanmove_mc.gotoAndStop('car_still');
}
});
Copy link to clipboard
Copied
try:
var _this = this;
stage.enableMouseOver(3);
_this.van_btn01.on('mouseout', function () {
if (_this.van_mc.vanmove_mc.currentFrame < 2) {
_this.van_mc.vanmove_mc.gotoAndStop('car_still');
}
});
Copy link to clipboard
Copied
Fantastic. Thank you so much kglad. It worked perfectly.
Now to add it to the other 11 similar buttons.
Best wishes.
Paul
Copy link to clipboard
Copied
you're welcome.