Copy link to clipboard
Copied
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)?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Ok, I'll try the Flex forum then. Thx
As for visibility...for my amateur understanding it works like this:
When I declare object's hideEffect and then I set visibility=false Flex starts the effect and it lasts for some time. For my Fade effect it's default 1 second. During this "1-second-period" the object is fading out BUT it's still visible. It has alpha>0 but it's visibility property is set to false....
Copy link to clipboard
Copied
For a fade to work the visible property needs to be true and the alpha properly should gradually reduce from where it starts (nominally 1) to 0. IF alpha is 0, the object is next to being as good as invisible... the difference with visible = false is that an object is still intreractable with a mouse when its alpha is 0, but if its visible = false it is not interactable with a mouse.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now