Solved

key focus in AS3

Posted on 2010-11-26
8
584 Views
Last Modified: 2013-11-11
i've just noticed something odd and I was wondering if someone knows why this is.

scenario, basic game - document class.
object 1 - has keypress to move it around
object 2 - start btn.

add both objects to stage.
click object 2 - remove it and listener... object 1's keypress doesn't kick in until you click the swf (in browser)

it sort of makes sense to me but I'm hoping someone has a more decisive explanation why this is.
0
Comment
Question by:blue-genie
  • 4
8 Comments
 
LVL 1

Expert Comment

by:Isu_the_Mule
Comment Utility
some code, maybe?
0
 
LVL 39

Author Comment

by:blue-genie
Comment Utility
Isu it's not a code problem per say, more of a logic thing.

If i get a change today i'll put together a quick mock up.
0
 
LVL 3

Accepted Solution

by:
IceColdas earned 500 total points
Comment Utility
hmm, strange. Doesn't happen to me. I attached a small test pack which works just fine in 3 different browsers. test.zip
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 39

Author Comment

by:blue-genie
Comment Utility
hmm icecoldas indeed your one doesn't seem to do it - haven't had a chance to analyse yet but before this autoprocess close kicks in - i'm going to accept your solution - thanks for making the effort.

it might have something to do with waiting for an added to stage event which I didn't do.
tx.
0
 
LVL 39

Author Comment

by:blue-genie
Comment Utility
sorry mods. coldasice responded after my request.

0
 
LVL 39

Author Closing Comment

by:blue-genie
Comment Utility
coldasice, i've tried changing your code to "break" it to do what mine was doing, and I can't.
very odd indeed.
I'll do a compare when i get to the office tomorrow but thanks so far.
going to close this before i forget.
tx.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now