0

I'm quite new to Flex, but I'm porting a web app into it using Away3d. I've got a bit of a dilemma:

In its simplest terms:

I need to set the application background visible=false, not just alpha=0, as it's blocking mouse events for items which need to be behind it.

What I'm actually trying to do:

If I add the View3D to Stage, its index is only relevant for display list and events (Mouse etc), it will always render behind everything else - so I have to set backgroundAlpha="0" in the Application tag to see it. However, this leaves me with two options, neither of which are desirable:

Adding View3D at childIndex(0), the mouse events bound for the View3D are intercepted by the invisble (but still present) application background. However, adding to the stage at the highest index will prevent flex components working as they are technically underneath the view, even though they appear higher.

I need my View3D to react to mouse events and I need to overlay Flex components. I'd rather not use a hidden sprite to intercept/re-dispatch events or something, is there a way to simply set application background visibility?

Thanks in advance

MickMalone1983
  • 1,054
  • 8
  • 17

1 Answers1

0

Shot in the dark, but have you tried setting alpha="0" and mouseChildren="false" on the top level application?

<s:Application mouseChildren="false" alpha="0">
    <!-- content goes here -->
</s:Application>

If that doesn't work, you could also try masking the application with a mask that is nonexistant.

Quick, untested example:

<s:Application mask="{ this.maskShape }">
    <s:Group id="maskShape">
        <!-- Never add anything to this Group -->
    </s:Group>
</s:Application>
Josh
  • 8,079
  • 3
  • 24
  • 49
  • Sorry mate, neither work, cheers anyhow - mouseChildren renders application useless as no mouse events detected, and mask didn't change anything. I added a MouseEvent listener to main application to trace out child name, (ApplicationBackground2 or something), then tried to manually remove this on creationComplete but got a null pointer. It's strange how there's no visible property on it but there is alpha. – MickMalone1983 Jan 31 '13 at 16:25
  • The object is likely a private object. The setting `backgroundAlpha` is actually a style being applied, not a typical getter/setter. You would get the same effect applying `backgroundAlpha: 0;` in CSS. Sorry I couldn't be of more help here. – Josh Jan 31 '13 at 16:31
  • Yeah figured it was, strange that they wouldn't expose that property too though - will keep experimenting, cheers anyway – MickMalone1983 Jan 31 '13 at 17:00