flash actionscript:
I posted a message earlier in the day and have half an answer. Would anyone be able to give me a solution? I have a button (called "button1") inside a movieclip("disc"), which when pressed will hopefully load an external image into a movieclip called "imageMC"? However the mc "disc" has a mouse handler on it which means the button is being ignored. I really need to get this button to recognise the press. The actionscript I have on the button is: on (release) { _root.imageMC.loadMovie("images/picture1"); } The movieclip "disc" has the following code inside it: circlemc.onRollOver = function() { circlemc.onEnterFrame = null; } circlemc.onEnterFrame = function() { circlemc._rotation -= 0.75; } circlemc.onRollOut = function() { circlemc.onEnterFrame = function() { circlemc._rotation += 0.75; } } I've been informed I need to call in a mouse handler for the button before the above script, but I don't know how to do this. Any help would be gratefully received. Thanks in advance.
actually, you can't have mouse handler's assigned to a parent movieclip and expect a child to detect mouse events. they will be intercepted by the parent. to remedy, either use a hitTest(), a mouse position detection or define your mouse handlers for the youngest generation that needs handlers.
Hi kglad, Thanks for your help again. If I put the hittest on the button, would this counteract the parent/child issue? I don't suppose I could send you the file to have a look at? TIA Steve
yes, it would. for example: lo = new Object(); lo.onMouseDown = function() { if (circlemc.button1.hitTest(_xmouse, _ymouse)) { _root.imageMC.loadMovie("images/picture1"); } }; Mouse.addListener(lo);
Don't see what you're looking for? Try a search.
|