This content has been marked as final. Show 3 replies
Look for my use of the show and hide events to dispatch Button MOUSE_OVER and MOUSE_OUT events. Don't forget the one for the ViewStack.
Thanks for the reply and the code. I was able to hack something together that comes close but I've run into other issues as a result of this approach. Basically it boils down to this:
- I want the ViewStack to cycle through the images automatically (check)
- I want the button states to correspond to the current ViewStack image (check)
- I want to rollover the buttons and update the ViewStack (check)
- When I rollover a button I want the automatic rotating of the ViewStack to stop. THIS IS WHERE I'M RUNNING INTO ISSUES.
SOLUTION 1 (Didn't pan out). Call methods for starting or stopping the ViewStack rotation from the button events.
I wrote some new methods for stopping and starting the setInterval method so that the ViewStack would stop cycling through. But I think that I have scope problem or something because it wouldn't work correctly. I think that the stopInterval method was clearing the global variable that I setup, but that it was unable to clear the local variable within the startInterval method. This doesn't make a lot of sense to me, but I think that's what's going on.
SOLUTION 2 (Didn't pan out). Use a boolean check within the advancePlayer method (Cycles stack). IF the boolean is set to false keep cycling otherwise don't update the ViewStack.
The boolean is a global variable that I tried to manipulate using rollover and rollout events attached to the VBOX which contains all of the buttons. This didn't work either. Apparently the rollover and rollout events get triggered when ever the child button rollover/rollout events get triggered.
SOLUTION 3. Keep track of the mouse position if it's over the VBOX container then do not update the ViewStack.
This is similar to solution 2, only I'm hoping that the mouse position will be independent of the VBOX/BUTTON mouse events. I know where the VBOX is positioned, I just don't know enough about actionscript to keep tabs on the mouse position.
Got any suggestions? I've posted my revised code and you can look at it below as well. Thanks.
To anyone looking for the answer to this. Greg points out how to use the dispatchEvent() method to trigger new MouseEvents. You can read more about my project here, where I eventually figure out how to integrate buttons and viewstacks. Thanks.