Comunidad de diseño web y desarrollo en internet online

Como cambiar codigo desde un textinput???

Citar            
MensajeEscrito el 31 Jul 2009 11:12 pm
hola a todos y gracias desde ya por la ayuda
estoy que diseño un graficador de funciones para un proyecto en la universidad ayudenme porfavor
mi codigo es este.............

Código ActionScript :

on (release) {
   var y:Array = new Array();
   var x1:Number = 0;
   var x2:Number = 0;
   var h:Number = 0;
   var k:Number = 0;
   var pres:Number = 0;
   pres = Number(presicion.text);
   x1 = Number(limite01.text);
   x2 = Number(limite02.text);
   lineStyle(0.25, 0x00FF00, 100);
   h = 300;
   k = 350;
   for (x=x1; x<=x2; x += pres) {

      y[x] = Math.tan(x);   [color=#CC0000]==> AQUI TA EL DETALLE (lo que quiero es poder ingresar esta informacion desde un textinput)[/color]

      if (x == x1) {
         moveTo(h+(x1*10), k-(y[x1]*10));
      }
      if (Math.abs(y[x])>=60) {
         moveTo(h+x*10, k-y[x]*10);
         lineTo(h+x*10, k-y[x]*10);
      } else {
         lineTo(h+x*10, k-y[x]*10);
         moveTo(h+x*10, k-y[x]*10);
      }
      if (Math.abs(y[x])<=(0.5*pres)) {
         lista2.addItem(Math.round(x*10000*10000)/100000000);
      }
      lista.addItem(Math.round(x*100*100)/10000+" ---- "+Math.round(y[x]*10000*10000)/100000000);
      lista3.addItem(x+" # "+y[x]);
   }
}

Por Kikeparra

1 de clabLevel



 

msie8
Citar            
MensajeEscrito el 01 Ago 2009 01:23 pm
¿Y la pregunta sería ... ?

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 02 Ago 2009 10:43 pm
lo que sucede es q en la parte del codigo donde esta la funcion a graficar, deseo ingresarlo mediante un textinput

Por Kikeparra

1 de clabLevel



 

msie
Citar            
MensajeEscrito el 03 Ago 2009 11:16 am
Ya estás tomando varios parámetros desde un input, por ejemplo este:

pres = Number(presicion.text);

Crea un nuevo campo de texto, le pones un nombre de instancia que tenga sentido y asóciallo con la variable que necesites

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.