Skip to main content
Known Participant
September 23, 2011
Question

problem on rollOver event in as2

  • September 23, 2011
  • 1 reply
  • 2035 views

Hi,

    I am doing some interactive file when i click a movieClip it should stop at frame 4 and when it is roll over it goto frame2 and when i roll Out it should come back to frame 1. But the problem is when i click a movie clip it should no roll out. please me help me

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
September 23, 2011

Show the code you are using for the movieclip.

Known Participant
September 23, 2011

for(i=0; i<3; i++){

          this["myClip"+i].onRollOver = function() {

                    this.gotoAndStop(3);

          }

 

          //this["myClip"+i].onRollOut = function() {

//                    this.gotoAndStop(1);

//          }

 

          this["myClip"+i].onRelease = function() {

 

                    this.gotoAndStop(4);

          }

}

Here i have commented the rollOut function

Ned Murphy
Legend
September 23, 2011

If I understand the problem, try:

for(i=0; i<3; i++){

          this["myClip"+i].onRollOver = function() {

                    this.gotoAndStop(3);

          }

 

          this["myClip"+i].onRollOut = function() {

                   this.gotoAndStop(1);

          }

 

          this["myClip"+i].onRelease = function() {

                    delete this.onRollOut;

                    this.gotoAndStop(4);

          }

}