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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:34:21+00:00 2026-05-27T03:34:21+00:00

I have two objects that are searching for one-another on the stage. They move

  • 0

I have two objects that are searching for one-another on the stage. They move in a certain direction with a certain speed. This is done via the Event.ENTER_FRAME. Once an objects finds the other it will start to do certain modifications on both objects, including stopping it.

Now, a certain problem came into mind. What if Object A finds Object B, start to do some modifications on Object B and the CPU is taken from ObjectA and given to ObjectB. Now, Object B will find ObjectA and will start to do modifications on ObjectA even though ObjectA is already in the process of doing this. This can be fixed with a very simple technique: once ObjectA find ObjectB it calls a lock() method. And objectB won’t check for the other object while locked. The problem is that I don’t know how to make the checking of the distance between the objects (this is how they find eachother) and the locking in an atomic way.

P.S. I have done a lot of multy-threading programming in Java in the past months so maybe these things don’t apply here.

Thanks.

  • 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-27T03:34:22+00:00Added an answer on May 27, 2026 at 3:34 am

    There should be no problem. Flash doesn’t do multi-threading.

    You can be sure that once an event function is called, it will run without interruption by other events. The only problem that you may need to consider is that you don’t know the order in which multiple enter frame events will be executed. If the order matters, you should use a single event which calls your objects’ event methods in the desired order.

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

Sidebar

Related Questions

Let's say we have two objects. Furthermore, let's assume that they really have no
I display some objects that have thumbnails in two ways: one in a DataGridView,
I have two objects that can be represented as an int, float, bool, or
Ok, NHibernate question here. I have two objects that I would like to map
I have two LinkedList objects that are always of the same size. I want
I have a list of objects that have two int properties. The list is
Suppose that I have two objects with the same property name that I am
I have an interface and two objects implementing that interface, massively simplied; public interface
I have two threads, a producer thread that places objects into a generic List
I have Process objects that are monitored from two different views. A Windows.Forms.ListView (actually

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.