Created
August 17, 2010 19:11
-
-
Save califa010/531518 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.Sprite; | |
import flash.events.Event; | |
import flash.system.System; | |
import flash.utils.Dictionary; | |
public class Main extends Sprite | |
{ | |
private var _test:Test; | |
private var _dict:Dictionary = new Dictionary(true); | |
private var _count:int = 0; | |
public function Main():void | |
{ | |
init(); | |
addEventListener(Event.ENTER_FRAME, handleEnterFrame); | |
} | |
private function init():void | |
{ | |
_test = new Test(); | |
addChild(_test); | |
_dict[_test] = true; | |
} | |
private function handleEnterFrame(e:Event):void { | |
_count++; | |
if (_count >= 10 && _test != null) { | |
removeChild(_test); | |
_test = null; | |
System.gc(); | |
System.gc(); | |
} | |
var items:int = 0; | |
for (var i:* in _dict) { | |
trace(i); | |
items++; | |
} | |
trace(items); | |
} | |
} | |
} | |
import flash.display.Sprite; | |
import flash.events.Event; | |
class Test extends Sprite { | |
public function Test() { | |
addEventListener(Event.ENTER_FRAME, handleEnterFrame); | |
} | |
private function handleEnterFrame(e:Event):void { | |
trace("Test::enterFrame"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment