Ver Mensaje Individual
  #3 (permalink)  
Antiguo 11/10/2013, 01:53
FedeXX58
 
Fecha de Ingreso: octubre-2013
Mensajes: 5
Antigüedad: 10 años, 6 meses
Puntos: 2
Respuesta: [swf=http://www.filz.us/files/5235251e/260/calculadurav2.swf]

Cita:
Iniciado por Tachikomaia Ver Mensaje
Si lo quisiste cambiar y no te anda muestra cómo lo cambiaste, y quizá te podamos decir por qué no te anda. Y podrías ir viendo qué te anda y qué no, en qué línea está la falla.
este es el anterior q ya no estaba andando por que intente hacer switch en vez del if bestial.



Código:
on (release) {
	var entrada;
	var dolar= 5.79;
	var euro= 7.90;
	var libra=9.30;
	var salida;
	var c;
	var rd;
	var chdolar:CheckBox = new CheckBox();
	var heuro:CheckBox = new CheckBox();
	var chlibra:CheckBox = new CheckBox();
	var moneda;
	var error= "Debe tildar una sola opcion";
	entrada = Number(Valor.text);
	//checkbox
	import fl.accessibility.CheckBoxAccImpl; 
	CheckBoxAccImpl.enableAccessibility();
	
package
{
    import flash.events.MouseEvent;
	import fl.controls.CheckBox; 
}

function Switch():void
{
	chdolar.addEventListener(MouseEvent.click,changelistd);
	cheuro.addEventListener(MouseEvent.click,changeliste);
	chlibra.addEventListener(MouseEvent.click,changelistl);
}



private function changelistd (event:MouseEvent;):void
{
	hdolar.selected==moneda=dolar;

}


private function changeliste (event:MouseEvent;):void
{
	cheuro.selected==moneda=euro;
}

private function changelistl (event:MouseEvent;):void
{

	chlibra.selected== moneda=libra;
}
	
	//impuesto
	c = (((entrada*20/100)+entrada)*moneda);
	
	
	
	
	//tabla de ganancia
	//if  ((c >=0.1) && (c < 10)){ 
//		rd = c + 9
//	} else {
//		if ((c >= 10) && (c < 20)){
//			rd = c + 10
//		} else {
//			if ((c >= 20) && (c < 50)){
//				rd = c + 10
//			} else {
//				if ((c >= 50) && (c < 51)){
//					rd = c + 10
//				} else {
//					if ((c >= 51) && (c < 120)){
//						rd = c + 10
//					} else {
//						if ((c >= 120) && (c < 175)){
//							rd = c + 10
//						} else {
//							if ((c >= 175) && (c < 176)){
//								rd = c + 10
//							} else {
//								if ((c >=176) && (c < 200)){
//									rd = c + 10
//								} else {
//									if ((c >= 200) && (c < 380)){
//										rd = c + 10
//										} else {
//											if ((c >= 380) && (c < 400)){
//												rd = c + 10
//											} else {
//												if ((c >= 400) && (c < 590)){
//													rd = c + 10
//												} else {
//													if ((c >= 590) && (c < 650)){
//														rd = c + 10
//													} else {
//														if ((c >= 650) && (c < 720)){
//														rd = c + 10
//															} else {
//																if ((c >= 720) && (c < 800)){
//																rd = c + 72
//														}
//													}
//												}
//											}
//										}
//									}
//								}
//							}
//						}
//					}
//				}
//			}
//		}
//	}
//	salida = Math.round(rd);
//	trace (salida);
//	pesos.text=salida;
//}

y esto lo que voy por ahora....



Código:
/* Click to Go to Web Page
Clicking on the specified symbol instance loads the URL in a new browser window.

Instructions:
1. Replace http://www.adobe.com with the desired URL address.
   Keep the quotation marks ("").
*/

/*FedeXX58.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);

function fl_ClickToGoToWebPage(event:MouseEvent):void
{
	navigateToURL(new URLRequest("http://www.taringa.net/FedeXX58"), "_blank");
}
*/


var selectedValues:Object = new Object();
//En esta caso son 10 componentes checkbox (cb1, cb2..cb10).
var tb;
var moneda;
var Dolar= 5.95;
var Euro= 8.60;
var Libra=9.50;
var Real=2.50;
var entrada=5;
var c;
	
for(var i:int = 1; i <= 4; i++) {
    this["cb"+i].addEventListener(MouseEvent.CLICK, onClick);
}

function onClick(evt:MouseEvent):void {
    if(evt.target.selected) {
	selectedValues[evt.target.name] = tb.appendText(evt.target.label);
    } else {
        deleted selectedValues[evt.target.name];
    }
}