Skip to main content
Inspiring
July 1, 2014
Question

When does visibility changes when i use hide effect?

  • July 1, 2014
  • 1 reply
  • 452 views

I have an object with hideEffect set to Fade. I listen to 2 events:

1. object's "hide" event - this event triggers right after I set visibility to false and it says "visible = false"

2. when hideEffect ends I trace the "visible" property and it shows "visible = true"

Question is why the 2. event shows "visible = true" when this event is after the 1. one (where visibility is false)?

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
July 1, 2014

I cannot say that I understand the question as I am not familiar with what you are calling the hideEffect.  But when you fade something from a state where visible = false, the first thing you do is set the visibility to be true, then you follow that by gradually increasing the alpha property of the object.  I suggest you try tracing the alpha  property if the problem is that the object indicates it is visible when you still cannot see it.

IbarimAuthor
Inspiring
July 1, 2014

Thanks Ned for hint with the alpha property. It only confuses me though

hideEffect is a mxml property for defining the effect used by flex to hide an object. My effect is Fade. Maybe I should ask this on Flex community?

Here's more detailed explanation:

I start with tracing: visible = true and alpha = 1.

I set visibility = false.

"hide" event listener tells me that at this point visible = false and alpha = 1. These values are correct (I suppose:) because the hide effect didn't start yet, the object is still visible though visibility is false.

Hide effect (fade) starts.

When hide effect ends I trace these values and it shows: visible = true; alpha = 0

I have a problem with finding out why at the end of the effect visibility is "true" and it was "false" while effect started?

Ned Murphy
Legend
July 1, 2014

I have a hard time accepting that as well... not the end part, but the beginning when visible = false.  visible is a binary type of property... an object is either visible or it is not.  Setting the visible property to false should make it invisible.  The values at the end of the hide effect make sense to me.

You might get better help if you ask Flex questions in the Flex forum, but as Actionscript 3 goes, the visible is not really debatable... an object is either visible or it is not.  I can't claim its visible property to be false when it is still visible.