PDA

View Full Version : [problem] Creating a Movie Clip Button



KaXaSA
March 29th, 2008, 03:40 PM
hiho I'm new here ^-^, I was following the Creating Movie Clip Button (javascript:Launch('http://www.kirupa.com/developer/flash8/video/creatingMCbuttons.htm')) tutorial and I was trying to make some changes in my button animation, but I got a problem, when I click on the button it'll play the button animation and while the animation is playing if I move my mouse pointer outside the button area the animation reset to the _up position so I want that when you click on the button to run this button animation once even if you move your mouse pointer outside the button area. any ideias?
thanks :thumb2:

pixel_streamer
March 30th, 2008, 03:59 AM
I haven't read the tutorial you mention, but in AS2, it's generally an acceptable practice to move the event handlers off of individual buttons/mc's, etc, and put them on frame 1 of the main timeline.

If it's an older tutorial, chances are that the handlers are on the individual elements.

Check to see if your handlers are named something like " on (release) =function { trace ("released");} ." If so, reference the name of that object on the main timeline and use the handler method (don't know if I'm using the right terminology):


something.onRelease = function() {
trace(this + " was just released"); // yeilds : _level0.something was just released
};

KaXaSA
March 30th, 2008, 11:54 AM
prevbtn3_mc.onPress = function() {
prevbtn3_mc.gotoAndPlay("_down"), gotoAndStop(197)
};
actually my button is working pretty fine except for the button animation, like I said it reset the animation if I move my mouse outside the button area :/~ I want it to play the animation till the end of it even if I move my mouse pointer outside it's area >_<'
but thx anyway ^-^

pixel_streamer
March 30th, 2008, 06:25 PM
Have you tried using
gotoAndPlay(197)

KaXaSA
March 30th, 2008, 07:17 PM
...
prevbtn3_mc.gotoAndPlay("_down"), gotoAndplay (197)
}
prevbtn3_mc = name of my "movieclip button"
prevbtn3_mc.gotoAndPlay("_down") = play the button animation layer (label "_down") that is inside prevbtn3_mc
gotoAndplay (197) = move to frame 197 in my MAIN timeline

the button is working fine it moves to frame 197 and plays my button animation, BUT when the animation is running IF u move the mouse outside the button 'clickable area' it'll cancel the animation and change back to the _up layer position (prevbtn3_mc frame 1), what I want:

click on the button > animation will start > and it must keep the animation running till it ends > EVEN if u move ur mouse outside the button 'clickable area'

I must be missing something very simple D-: