Sunday, May 13, 2012

[Action Script] Run Through Movieclips Code When Created May,2012

Hello, I'm trying to make a game for my class which I am taking right now but I seem to be stumped on one part. I've been debugging it for a while and finally narrowed it down to the fact that when I create a movieclip on to the stage from my library, the code that goes with that new movieclip is not executed until all of the current code is finished. Is there any way to run through the code on the movieclip before continuing on with the rest of the code? Here is an example of what I am trying to do down to the skin and bone:

Code: //Code on the main stage
var myNewBall = new ball()
myNewBall.x = 100.x, slotHead.y = 100
addChild(myNewBall)
//I want myNewBall code to execute now
myNewBall.numberID = 5; //This is a variable inside of the ball class which has not been created yet if myNewBall code has not been executed Code: //Code on the ball class
var numberID:int;I don't feel like I did a good job explaining this so please tell me if you need any more information, I will gladly try my best to supply more!

Thanks!
Run Through Movieclips Code When Created

Related Post



0 comments: