|
-
Thanks for your response. I have two questions:
1) I understand your recommendation for keeping the variable outside of the function. However, in the coding scenario in question how do I create a global variable when I have already defined it with the function (var WordonScreen:tapWords = new tapWords)? Isn't that where the variable is defined? Do simple move the statement "var WordonScreen:tapWords = new tapWords" above the function?
2) I have decided to actually do it another way. I'm starting out with an instance on the screen and then removing it after 4 seconds. However, I was wondering would there be any optimization issues (i.e. the timer still running etc.) with the following code?
//Removes instance already on screen after 4 seconds
var myTestTimer:Timer = new Timer(4000, 1);
myTestTimer.addEventListener(TimerEvent.TIMER, RemoveGraphic);
function RemoveGraphic (e:TimerEvent):void{
getChildByName("TextonScreen")
removeChild(getChildByName("TextonScreen"))
}
myTestTimer.start();
//When timer is finished... does something.
myTestTimer.addEventListener(TimerEvent.TIMER_COMP LETE, timerCompleted);
function timerCompleted (e:TimerEvent):void {
myTestTimer.stop();
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|