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 9101159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:03:14+00:00 2026-06-17T01:03:14+00:00

I have made a game in flash CS6 using AS3 and Air 3.2 for

  • 0

I have made a game in flash CS6 using AS3 and Air 3.2 for Android, now this game you go to different menus, when you die, it will go back to main menu and show your score, now when you select a new character and play through again, the monsters speed are doubled!?!?

Any idea why? I can give you a piece of my code but I’m really not sure on what part is the problem? would it be a event listener that wasn’t deleted?

Here is the function that is called to started the level off

public function startLevel1( navigationEvent:NavigationEvent ):void
    {
        //classSelect = null;
        removeChild( classSelect );
        levelManager = new LevelManager( heroGra, hero);
        addChild( levelManager );
        levelManaOn = true;

        gameTimer = new Timer( 30 );
        //On every 30ms we call apon moveEvent function
        gameTimer.addEventListener( TimerEvent.TIMER, tick );
        gameTimer.start();

    }

Here is the tick event that is deleted that calls the updated function for the monsters

    public function tick( timerEvent:TimerEvent ):void
    {
        if(levelManaOn == true)
        {
            levelManager.update();
            if(hero.hp <= 0)
            {
                trace("DEAD");
                onScoreState();
                levelManaOn = false;
                removeEventListener( TimerEvent.TIMER, tick );
            }
        }
    }

From tick event, it will call this function

public function onScoreState( ):void
    {
        scoreState = new ScoreState();
        scoreState.waveCompletedScore.text = levelManager.level.score.toString();
        //
        scoreState.addEventListener( NavigationEvent.ENDGAME, backMainMenu );
        addChild( scoreState );
        removeChild( levelManager );
    }

this removes levelManager, but still the monsters move at double the speed, and every time you restart from the beginning after dieing, the speed is doubled again, and again, any idea why?

Thank you reading and for the help

Canvas

  • 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-17T01:03:15+00:00Added an answer on June 17, 2026 at 1:03 am
        gameTimer = new Timer( 30 );
        //On every 30ms we call apon moveEvent function
        gameTimer.addEventListener( TimerEvent.TIMER, tick );
        gameTimer.start();
    

    I bet this code is being executed again without the first timer being removed.

    You need to call removeEventListener( TimerEvent.TIMER, tick ); as a method on your gameTimer object. Like this:

    gameTimer.removeEventListener( TimerEvent.TIMER, tick );

    Make sure you keep a reference to gameTimer. Also do gameTimer.stop(); before you remove the listener.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have made a flash/as3 Snake game which I want to somehow make
i have made a game using html5 , now i want users to put
I have made a multiplayer game using the GameKit Framework where 2 iPhones/iPods can
I have made this board game which can be run on browser, and I
I have made a flash game for facebook. All happened right expect when I
I have made a game using HTML5 Canvas Element, Javascript for facebook. You can
I have made a snake game using javascript and HTML5 Canvas element. It can
hey all, I have made a socket server in C# for a flash game
I made a flash game where you fly a plane and you have to
I have a Flash game I made way back in 2008. It runs super

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.