| public function main() { | <<<< CLASS CONSTRUCTOR | ||
| this.addEventListener(Event.ADDED_TO_STAGE,startapp) | |||
| } | |||
| private function startapp(event:Event):void{ | |||
| trace('start app') <<TRACING TWICE.. | |||
| //instructionscreen() | |||
| closebtn.visible=false | |||
| closebtn.alpha=0 | |||
| controls.alpha=0 | |||
| } |
package
{
import flash.events.*;
import flash.display.*
public class Testing extends MovieClip
{
public function Testing()
{
addEventListener(Event.ADDED_TO_STAGE,startapp)
}
private function startapp(event:Event):void
{
trace('start app')
//instructionscreen()
closebtn.visible=false
closebtn.alpha=0
//controls.alpha=0
}
}
}
its running for once only
You can do something like this :
package
{
import flash.events.Event;
import flash.display.*
public class Testing extends MovieClip
{
public function Testing()
{
if (stage) startapp();
else addEventListener(Event.ADDED_TO_STAGE,startapp);
}
private function startapp(event:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE,startapp);
trace('start app')
//instructionscreen()
closebtn.visible=false
closebtn.alpha=0
//controls.alpha=0
}
}
}
North America
Europe, Middle East and Africa
Asia Pacific