A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: rollOut problem

  1. #1
    Registered User
    Join Date
    Sep 2013
    Posts
    3

    rollOut problem

    please help me, i have a movieclip with a rollOut event, and a button , the problem is when i pass my mouse arrow over the button it consider that the mouse left the stage and execute the rollOut, i dont want execute the rollOut if the mouse arrow still inside the animation.
    sorry for my bad english, the exemple in the atachement can give you a better idea about my problem.

    plz help !!
    Attached Files Attached Files

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    I'll leave this to somebody else.

  3. #3
    Registered User
    Join Date
    Sep 2013
    Posts
    3
    plz heelp !!! i realy need it

  4. #4
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Hello

    It happens because the stage button you have is BEHIND your button, and when you roll out of that button, the rollOut code will be executed, because you are leaving the stage button, you are just not leaving the stage Now, there is no real solution to this as you can't really solve this accurately, but you can try different ways of preventing this. I'm just gonna give you a simple one, but it's not really good...

    Move your bg layer to the top, so that it's always above everything else. Then, instead of making your button as a Button symbol, make it as a MovieClip. Give your button movieclip an instance name of, for example, my_btn, click on your Frame, press F9 to open actions panel, and type this:

    Code:
    onMouseDown = function(){
    	if(my_btn.hitTest(_xmouse, _youse, true)){
    		gotoAndPlay(1);
    	}
    }
    For this to work, you need to remove on(release) code from bg button. I know this seems a bit too advanced for you, but I can't really come up with any easier solution than that. If you want to add another button, just add them like this:

    Code:
    onMouseDown = function(){
    	if(my_btn.hitTest(_xmouse, _ymouse, true)){
    		gotoAndPlay(1);
    	}
    	if(my_btn20.hitTest(_xmouse, _ymouse, true)){
    		gotoAndPlay(100);
    	}
    	if(my_btn353.hitTest(_xmouse, _ymouse, true)){
    		prevFrame();
    	}
    }
    onMouseDown should always be there, but you just copy and paste this line:

    Code:
    	if(my_btn.hitTest(_xmouse, _ymouse, true)){
    		// your code to be executed here
    	}
    and just change my_btn to your Movieclip button's instance name, and put the code inside the brackets for what you want to happen.

    Not the best way, but hope this helps
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  5. #5
    Registered User
    Join Date
    Sep 2013
    Posts
    3
    thank you Nig 13 for your answer, can you please edit the exemple.flv file to make the changes plz plz plz cause i'm a little lost.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center