package clases{
	import flash.display.MovieClip;
	import fl.text.TLFTextField;
	import flash.events.Event;
	import clases.randomicoN
	
	public class restasA2 extends MovieClip {

		public var sa1:Number 
		public var sa2:Number 
		public var sb1:Number
		public var sb2:Number
		public var r1:Number
		public var r2:Number
		public var rt1:TLFTextField
		public var rt2:TLFTextField
		public var clip:MovieClip
		
		public function restasA2 (clipPasado:MovieClip) {
			clip = clipPasado
			rt1 = clip.rt1
			rt2 = clip.rt2
			
			sa1 = randomicoN.randomizar(1,9)
			sa2 = randomicoN.randomizar(1,9)
						
			sb1 = randomicoN.randomizar(0,sa1)
			sb2 = randomicoN.randomizar(0,sa2)
			
			r1 = sa1-sb1
			r2 = sa2-sb2
			
			clip.s1.text = String(sa1)+String(sa2)
			clip.s2.text = String(sb1)+String(sb2)	
		}
		public function verificar(){
			if(rt1.text ==String(r1) && rt2.text == String(r2)){
			MovieClip(clip.parent).bien(clip)
			}else{
				MovieClip(clip.parent).queMal(clip)
				}
		}
	}
}