Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash Button Not Clicking When Attached (AS3)

Status
Not open for further replies.

grande

Programmer
Feb 14, 2005
657
0
0
CA
Alright, let me try to explain my situation....

I have a class (AppCore) that extends MovieClip.
I have a MovieClip called StageContents.
I have a class (DefaultCaption) with a button on it, that extends MovieClip.

In AppCore, I essentially do this:
Code:
var StageContents:MovieClip = new MovieClip();
var dc:DefaultCaption = new DefaultCaption();
dc.setCaption("Text");
StageContents.addChild(dc);

This doesn't work. I see the button, but it's not clickable, and the mouse-over doesn't work.

If I change it to this:
Code:
var dc:DefaultCaption = new DefaultCaption();
dc.setCaption("Text");
addChild(dc);
it works fine.

I'd really rather have the children go on StageContents (for reasons I'd rather not go into).

Does anyone have any idea why this would be happening?

-------------------------
Matt Grande
C# Master.
Ruby on Rails Admirer.
ActionScript Student.
JavaScript Hate-Monger.
 
Hi kennethkawamoto,

Thanks for the reply but I'm doing that already. Just forgot to put it in my code. Sorry.

-------------------------
Matt Grande
C# Master.
Ruby on Rails Admirer.
ActionScript Student.
JavaScript Hate-Monger.
 
Okay, after your last post, I tried removing, clearing then adding StageContents, instead of just clearing it. Here's what I found.

I have a small menu on the left side that slides out. When it is hidden, dc is visible, but when the menu pops out, you can no longer see dc.

If I remove then add StageContetns, StageContents is added above the menu. Then dc works fine.

So I guess my question is... How can I click something that's underneath something else?

-------------------------
Matt Grande
C# Master.
Ruby on Rails Admirer.
ActionScript Student.
JavaScript Hate-Monger.
 
Yar-tee-tar! I figured it out!

I had a mask on the entire stage to fake fading. When alpha got to 0, I forgot to set mc_mask.visible = false. I put that it, and it worked!

-------------------------
Matt Grande
C# Master.
Ruby on Rails Admirer.
ActionScript Student.
JavaScript Hate-Monger.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top