View difference between Paste ID: kMWskfgk and kZqT3dnd
SHOW: | | - or go back to the newest paste.
1-
package Managers {
1+
import flash.utils.dictionary;
2
var container:MovieClip;
3-
	import flash.display.*;
3+
var dict:Dictionary = new Dictionary();
4-
	import flash.events.*;
4+
for(var i:int=0; i<container.numChildren; i++)
5-
	import flash.media.*;
5+
{
6-
	import flash.net.*;	
6+
	var mc = container.getChildAt(i);
7
	mc.addEventListener(MouseEvent.CLICK, onBtnClick);
8-
	public class GameFourMachine extends MovieClip  {		
8+
	dict[mc] = mc.animation.currentFrame;
9
}
10-
		private var state:int;
10+
11
var correctSolution = 50;
12-
		public function GameFourMachine() {
12+
function onBtnClick(event:MouseEvent)
13
{
14-
			state = 0;
14+
	var nr = dictionary[event.currentTarget];
15-
			
15+
	trace(nr);
16-
			addEventListener( Event.ADDED_TO_STAGE, onAddedToStage );
16+
	if(nr==correctSolution)
17-
		}
17+
	{
18-
		
18+
		trace('correct');
19-
		
19+
20-
		private function onAddedToStage( e:Event ):void {
20+
	else
21-
			
21+
	{
22-
			removeEventListener( Event.ADDED_TO_STAGE, onAddedToStage );
22+
		trace('wrong');
23
	}
24-
			mc_intro.stop();
24+
25-
			mc_intro.addEventListener( "startsound", nextStep );
25+