Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8947285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:43:08+00:00 2026-06-15T12:43:08+00:00

We have assignment at school that we make an action: Everytime I click on

  • 0

We have assignment at school that we make an action: Everytime I click on the green button, the counter counts and the blue rectangle goes to the right, and when it hits the border of frame it returns from left and so does restart the counter from 0.

I was able to make it count and the blue rectangle returns, but what I need help with is how to make the counter restart to count from 0 when the rectangle returns? What code do I have to add or change?

Thank you very much before hand.

Belows is my script (a mess I know)

import fl.motion.MotionEvent;

var mynumber:int = 5

var numclick:int = 0;
mytext.text = ""

mynumber = mynumber+5;

trace(mynumber);

var myword:String = "Hello World!";

trace(5+5);
trace("5"+"5")

r1.x=0;
r1.y=0;

btn1.addEventListener(MouseEvent.CLICK,moveme);

function moveme(evt:MouseEvent):void {

    numclick++;

    if(r1.x < 550){

    r1.x = r1.x+100;


    mytext.text ="number of clicks: "+String(numclick);

    }else{
    r1.x = 0;

    mytext.text ="number of clicks: "+String(numclick);
}


}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:43:10+00:00Added an answer on June 15, 2026 at 12:43 pm

    just assign zero value to numclick variable within else statement

    else{
        r1.x = 0;
        numclick=0;
        mytext.text ="number of clicks: "+String(numclick);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For an assignment at school, we have to use structs to make matrices that
For a school assignment I have to create a C++ program that will create
I have a school assignment that should be written in C++98-compliant code. How can
I have an assignment for school: I need to make a user database. First
I have an assignment at school to build a webserver that handles GET/HEAD/PUT requests,
i have an erd for a school assignment that contains a many to many
I have an assignment for school to make a program which results in either
For a school assignment we have to make a client server chat program in
I have a school assignment that that is giving me and my friends headaches...
We have a school assignment and we were told that all numbers end after

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.