A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How to alpha out movieclip on dragOver

  1. #1
    Junior Member
    Join Date
    Jan 2009
    Posts
    14

    How to alpha out movieclip on dragOver

    I posted last week on the topic of getting movieclips to lock into place after you have dragged them in the correct location. Luckily I was able to figure it out by myself, love when that happens.

    Anyway, I have a new issue. What I want to do is have a movieclip alpha to 0% when another movieclip is dragged over it. I want to it to happen by 25% each dragOver though. So it starts at 100% then the user drags over and the alpha is at 75% now, then another drag over and 50% etc...

    The MC that is being dragged is called ragMC and the one that is alpha'd out is greaseMC.


    Thanks

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    You need a counter for the rollOver. Let's say that counter starts at 100, and each rollOver removes 25 out of counter if above 0. You could just say:
    greaseMC._alpha = counter;

    gparis

  3. #3
    Junior Member
    Join Date
    Jan 2009
    Posts
    14
    Thanks for the reply. I've decided to go another root and make it easier on myself by just having the movieclip play once it is dragged over. Easier said than done though for me. I have this code which I think I am on the right track with, but I can't get it to work.

    What I'm am trying to do is have the user drag ragMC over the capgreaseMC. Once that happens then have capgreaseMC play. It sort of works when I have it set up with onRelease, but I only want it to play onDragOver of capgreaseMC.


    Code:
    //When the ragMC is dragged over the capgreaseMC, play capgreaseMC.
    
    dragMC.ragMC.onRelease = function() {
    	this.stopDrag();
    
    // Convert the slash notation to dot notation using eval.
    
    	if (eval(this._droptarget) == capgreaseMC) {
    		dragMC.capgreaseMC.gotoAndPlay("fade");
    	}
    };

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