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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:44:27+00:00 2026-05-22T17:44:27+00:00

Im making a transition from Java to Flash/Actionscript and Im having sort of a

  • 0

Im making a transition from Java to Flash/Actionscript and Im having sort of a hard time figuring out where to write my code for my flash game loop(or engine) due to flash having “frames” unlike Java.

Am I able to put the loop inside the Document class even having like game menus in the game? I havent found a way to put it in there without it always running when the flash application begins.

Or should I just have the game loop called every frame? For instance, frame 4 will be level 1 and so the engine will be called out there. And frame 5 will be level 2 and ill call a different instance of the game engine there. Is that possible to do that?

Im just having a difficult time due to the “frames”. So where would be the best place to put the game loop?

Thank you!

  • 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-05-22T17:44:27+00:00Added an answer on May 22, 2026 at 5:44 pm

    You will quickly learn to avoid the pitfalls of frames if you’re a serious Java engineer. In your document class, you can create a main-game loop by listening for Event.ENTER_FRAME:

    package
    {
        import flash.display.Sprite;
        import flash.events.Event;
    
        public class DocumentClass extends Sprite
        {
    
            public function DocumentClass():void
            {
                init();
            }
    
            private function init():void
            {
                addEventListener(Event.ENTER_FRAME, iterate);
            }
    
            private function iterate(event:Event):void
            {
                // loop here
            }
    
        }
    }
    

    You can stop the loop similarly be removing the event listener.

    For more complex games, people commonly need to create more than one ENTER_FRAME listener. In this case, it is often more efficient to use a ‘ticker’ or some other device that minimises the number of event constructions by the player.

    Hope this helps,
    Alec

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

Sidebar

Related Questions

In last few months I have been making a transition from Java to Groovy
I have recently started making (and am still making) the transition from ActionScript 2
I am a Java Developer making the transition to the C# world. I've gotten
I'm making the transition from Eclipse CDT (with Qt integration plugin) to QtCreator 2.0
I'm a developer making the transition from Linux/Emacs to OSX/Xcode. Does anyone have any
I am making the transition from DataTableAdapters in MSVS to creating Stored Procedures in
I'm developing my first Android game and I'm having a bit of difficulty making
i'm slowly making my way over to Flash Builder from doing all of my
I am making a simple game in order to learn a new language. I
I'm thinking about making a networked game. I'm a little new to this, and

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.