A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: checking if two movieclips have been rollOvered

  1. #1
    Senior Member
    Join Date
    Nov 2004
    Location
    Amsterdam
    Posts
    212

    checking if two movieclips have been rollOvered

    Hi,



    I have two movieclips. I would like to check if both movieclips have been rollOvered and then do an action. You can't rollOver them at the same time. So, I need something like: if movieclip 1 has been rollOvered and movieclip 2 has been rollOvered (no matter what following order) , then do action.



    I tried this using booleans and an if statement but no luck.

    Could someone show me how to do this?



    Thank you very much,



    Jerryj.

  2. #2
    Army Web Designer
    Join Date
    Jun 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    140
    I think that would be easy enough. All that you have to do is set some variables.

    code:

    var isRoll1:Boolean = false;
    var isRoll2:Boolean = false;

    movieClip1.onRollOver = function(){
    isRoll1 = true;
    if(isRoll2==true){
    //...perform some action here.
    }
    }

    movieClip2.onRollOver = function(){
    isRoll2 = true;
    if(isRoll1==true){
    //...perform some action here.
    }
    }

    Jason Beaudoin
    Web Designer
    Canadian Army

  3. #3
    Senior Member
    Join Date
    Nov 2004
    Location
    Amsterdam
    Posts
    212
    thanks!

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