• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

currentFrame in Javascript

New Here ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

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
}
);

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

LATEST

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()

 

 

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines