Flex 4: Move Shape object across screen- initial object remains
I am trying to move a 'Shape' object across the screen. As the object moves, a copy is being left at the initial position. Almost as if only an instance of original object ahs been moved
This is not an issue for moving an image or MXML graphic. Is something wrong in setting to the move object?
The code is as follows
private var arrow:UIComponent;
private function resetAssets():void{
arrow = new UIComponent();
Screen.addElement(arrow); //Screen is the area on screen for animation
var speedArrow:Shape=new Shape;
arrow.addChild(speedArrow1);
//speedArrow1 is created of type Shape and appears perfectly on screen
}
private function An开发者_运维百科imation():void{
var mvarrow1:Move = new Move();
mvarrow1.easer = new Linear(0,0);
mvarrow1.target = arrow;
mvarrow1.duration = 2000;
mvarrow1.xBy=200;
mvarrow1.play()
}
I identified the problem I had made- had mistakenly called the resetassets twice in the project- somehow that creates 2 copies of the object, and only 1 of them is moved!! Sorry- if I wasted anybody's time on the forum
More out of academic interest, any idea why 2 copies are created and only 1 of them gets moved?
精彩评论