jumping from stateA to stateB back to StateA
I received an "already parented" error.
when jumping between states is faster than the transition times
the error jumps out because when you go back into stateA
his childs have not been removed yet...
tried to use a copy of the AddChild class apart from two points in the
AddChild.apply() and AddChild.remove() methods:
1) where the error jumps out in the AddChild.apply() method:
// Can't reparent. Must remove before adding.
if (target.parent)
{
var message:String = resourceManager.getString(
"states", "alreadyParented");
throw new Error(message);
return;
}
I thought that if the actual parent and the new parent are the same it
should be ok to reparent or to make a removeChild...
so I added to the test condition...
if(target.parent == actualParent)
removechild(...)
else
throw error
2) the point supposed to restore the state
in the AddChild.remove() method:
I've added checks before the removeChild() calls
if(parentObject.contains(target))
parentObject.removeChild(target)
to avoid the 2052 error:
"The supplied DisplayObject must be a child of the caller"
Now I have avoided a few errors
the addition and removal of child seems to work fine
but I'm getting weird behaviors with some other objects
that shouldn't be affected because are on the stage
all the time and the states change only their visibility...
I'm quite new to all the Flex Framework
but after struggling with Transitions
for a while (almost two weeks now) I was wondering
if any of the subscribers of this list has some guidelines,
best practices or advices to give about
how to handle user interaction using transitions.
Thanks in advance for any help
Really hope not to seem stupid or ridicolous in my questions
but sometimes is just difficult to find the right
sources of informations or you have to know a bunch
of things before figuring out what's the better thing to do.
Thanks again
Gio