Jump to content
Search Community

Stage Looses Focus After Tween [SOLVED]

KTrentLR test
Moderator Tag

Recommended Posts

Scenario:

Have multiple MovieClips on the stage with rollover effects (acting as buttons). When I click a button a semitransparent background above the entire stage Tweens up (_alpha) over the entire stage. Blocking clicks from reaching other buttons on the stage while the message box is displayed. At the same time a movieclip (message box) Tweens in from the right. On the message box there is a close button (movieclip). When the close button is clicked, the message box tweens off stage and the background alpha tweens to 0 then background visibility is set to false - allowing the stage to be clicked again.

 

Issue:

When the message box tweens off and the background tweens out and visibility set to false, you can't mouse over the buttons on the stage. However, if I click anywhere on the stage, I can then mouse over the buttons and they react. It's like the stage has lost focus.

 

Note:

Before I added TweenLite and added the TweenLite.to methods, the message box and background effects were written with onEnterFrames and modifying the _x and _alpha values manually. Using this method, once the messages boxes were off stage and the background removed, mouse-over effects worked fine, without having to first click the stage.

 

Using AS2.

 

Thanks for any help. If I can't remedy this effect, I'll have to revert back to using onEnterFrame and removing TweenLite.

 

Thanks!

Wil

Link to comment
Share on other sites

I can just about guarantee you that TweenLite has absolutely nothing to do with the focus changing. All it does is alter properties of objects in an onEnterFrame - that's it. There must be something else going on in your code. Maybe it's just the visibility thing? Not sure. But if you're convinced that TweenLite is to blame, please post a sample FLA that demonstrates the issue (only include the essential code please).

Link to comment
Share on other sites

It was my fault (no surprise) :D

 

Because I can't really send the .fla file, there are about 20 Custom classes and many external files, I built a sample from scratch using the nested MovieClips as used in my production .fla. As I was doing so, I did something I wasn't sure I did in the real .fla - I set the background layer _visible to false. I did a test on the same and sure enough, forgetting to do that causes this issue - because - I in the real .fla I have code added that if you click the background and there's no message on the screen, remove it. (I do this because some thin clients had issues).

 

When I opened the original .fla sure enough I forgot to set _visible to false on the background (it's _alpha is zero). Because of the code to remove the background if there's no pop-up visible, it removed it, and then the rollovers worked - giving the appearance of loosing focus.

 

Once I added _visible false to the function that runs onComplete, it worked perfectly.

 

Thanks for the help (just being there for your users! :) )

 

Issue resovled - not sure how to flag it as such.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...