Skip to main content
Participant
March 11, 2021
Question

currentFrame in Javascript

  • March 11, 2021
  • 1 reply
  • 1593 views

Hello guys, hope you all are well.

I got a question, I have to convert the function bellow from ActionScript into JavaScript function, the problem is I have no idea in JS a function like "currentFrame" to get the frame in what I am.

any idea how to do it?

 

I have checked already this page, but doesn't say anything about it.

Sorry if this question is so so noob, but this my first time working witn ActionScript

 

btSubmit40.addEventListener(MouseEvent.CLICK,function(e:MouseEvent):void
{
    if (mcArea1.currentFrame == 2 && mcArea2.currentFrame == 2)
       {
          gotoAndStop("S3");
       }
   else if (mcArea1.currentFrame == 1 && mcArea2.currentFrame == 1)
      {
          mcNoselect1.visible=true;
       }
   else if (mcArea1.currentFrame == 2 && mcArea2.currentFrame == 1 || mcArea1.currentFrame == 1                    && mcArea2.currentFrame == 2)
      {
            mcNoselect2.visible=true;
            mcNoselect1.visible=false;
      } // end else if
}
);

    This topic has been closed for replies.

    1 reply

    chenjil43641795
    Legend
    March 12, 2021

    I don't know where the path of S3 is.

    So suppose it's in a movie clip.

    Logic I change the "+" up to judge.

    This makes the code easier to see

     

     

    exportRoot.btSubmit40.on("click", ()=>{
    let Mode=exportRoot.mcArea1.currentFrame+exportRoot.mcArea2.currentFrame
    if(Mode==4){exportRoot.mcArea2.gotoAndStop("s3");exportRoot.mcArea1.gotoAndStop("s3");}
    if(Mode==3){exportRoot.mcNoselect2.visible=true; exportRoot.mcNoselect1.visible=false;}
    if(Mode==2){exportRoot.mcNoselect1.visible=true;}
    });  
    
    this.stop()