I’m using AS3 to create some motion tweens in a game that I’m creating, though they have been pretty temperamental so far…
Here’s some code that places a movie clip on the stage and tweens it:
function fatController():void
{
var officeEquipment:Array = new Array();
officeEquipment[0] = new TableSmall;
setTimeout(placeTable, 1200, officeEquipment[0], 1650, 300);
}
function placeTable(table:DisplayObject, posX:int, posY:int):void
{
//trace('placed');
addChildAt(table, 1); // add this object to the stage
table.x=posX; // move to X-Co-ordinate
table.y=posY; // move to Y Co-ordinate
var xMove:Tween = new Tween(table, "x", None.easeIn, posX, posX-2300, 192, false);
}
// start everything...
fatController();
Sometimes for some reason when I export the Flash file to test it, the movie clips start to tween across the stage and then freeze. Other times, the movie clips manage to successfully make it all the way to the other side without any problems…
Most recently I added a simple introduction animation to the main timeline before the frame that the above actionscript is in.
When the frames of the animation are there, the tween is not completed successfully. If the frames of the introduction animation are removed, the tween works fine
I’m really not sure what’s going wrong!
Can anyone lend a hand?
Thank you!