I am facing a situation that I have problem understanding...
I am writing a little Drag and Drop game that comes with its own solution. Game starts on frame 1, solution of frame 150.
To show the solution, I chose to display all drag items in their original position and fade them out one by one while concurrently fading in another instance in the correct position.
In the "game" part, I made sure that all dragged items get added back to the stage to ensure that drags would not pass behind other drag-able objects. So at the end of my drag function, I added the line "this.parent.parent.addChild(this.parent)".
Where I get puzzled, is when I click the solution button, all dragged instances remain in place and no longer respond to Timeline actions. If I take out the "this.parent.parent.addChild(this.parent)" bit, all work fine (except for being able to drag behind other object)
Can someone explain this behavior to me?
TIA
Humm... I guess I spoke too soon!
My scenario is as follows: I placed 5 instances of a choice MC at the first level on my stage. The choice MC contains an instance of dragButton MC (mapped to its own class) and an instance of choiceText MC looking like:
[dragButton] choiceText
The intent is for the user to drag the dragButton MC on top of a specific instance of a choiceGroup MC.
To ensure that any dragged item passes over any other, I added
this.parent.parent.addChild(this.parent);
at the end of the dragButton's drag function. This has the effect of re-adding the choice MC containing the selected dragButton.
After further testing, I came to realize that the objects are getting added to the right "container" BUT cease to be "linked" to Timeline preferences.
This happens in the "correction" area where I fade out the choice and then fade in another instance in its intended location. However, the "fade" (Classic Tween) does not grab any MC that have been re-added to the stage.
Is there a workaround to this short of having to code my "fade-in/fade-out" rather than using timeline tweens?
TIA