dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How to fade out when two movie clips hit each other?

  1. #1
    Senior Member WizyWyg's Avatar
    Join Date
    Feb 2001
    Posts
    209

    How to fade out when two movie clips hit each other?

    How to fade out when two movie clips hit each other?


    I have two movieclips on stage and I want one MovieClip to fade out completely if it hits another movie clip.

    Currently I have this script to activate a sound when my two movieclips hit each other:
    PHP Code:
    if (ball.ballHitArea.hitTest(box.bxHitArea)) {
        
    //trace("ball hit box");
        
    success_m.start();

    How do I make my ball MovieClip fade out completely?

  2. #2
    Junior Member
    Join Date
    Jan 2006
    Location
    Santa Monica, CA
    Posts
    10
    Declare a variable on the first frame:

    Code:
    var bPlaying:Numver =0;
    Create a function in the frame:

    Code:
    function mcFade():Void{
         instance_name._alpha --;
            if(instance_name._alpha < 0) {
                  clearInterval(bPlaying);
                  instance_name._visible = 0;
         }
    }
    In you conditional statement where you are testing to see if the movies touch, add this line after you play the sound.

    Code:
    _root.bPlaying = setInterval(mcFade,100);
    Give that a try.

  3. #3
    Senior Member WizyWyg's Avatar
    Join Date
    Feb 2001
    Posts
    209
    Thanks but this one worked out better:
    http://www.actionscript.org/tutorial...ed/index.shtml

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