Comunidad de diseño web y desarrollo en internet online

Duda con este codigo

Citar            
MensajeEscrito el 30 May 2011 04:30 pm
Buenos dias, sucede que tengo un tooltip con clases en AS3 y pues lo cargo normal con codigo pero al colocar una funcion para un boton que me lleve a una URL me da error, solo en esa parte ya que al quitarlo el tooltip funciona. el codigo es el siguiente:

Código ActionScript :



stop();

import clasesss.ToolTip;
import flash.net.URLRequest;

var tooltip:ToolTip = ToolTip.getInstance();

addChild(tooltip);
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;

btn1.addEventListener(MouseEvent.MOUSE_OVER,onOver,false,0,true);
btn2.addEventListener(MouseEvent.MOUSE_OVER,onOver,false,0,true);
btn3.addEventListener(MouseEvent.MOUSE_OVER,onOver,false,0,true);
btn4.addEventListener(MouseEvent.MOUSE_OVER,onOver,false,0,true);
btn1.addEventListener(MouseEvent.MOUSE_OUT,onOut,false,0,true);
btn2.addEventListener(MouseEvent.MOUSE_OUT,onOut,false,0,true);
btn3.addEventListener(MouseEvent.MOUSE_OUT,onOut,false,0,true);
btn4.addEventListener(MouseEvent.MOUSE_OUT,onOut,false,0,true);

btn1.addEventListener(MouseEvent.CLICK, link1);

function onOver(e:MouseEvent):void
{
   switch (e.target.name)
   {
      case "btn1" :
         tooltip.followMouse = true;
         tooltip.fixedWidth = 150;
         tooltip.multiLine = true;
         tooltip.show("Palabras");
         break;
      case "btn2" :
         tooltip.followMouse = true;
         tooltip.fixedWidth = 150;
         tooltip.multiLine = true;
         tooltip.show("Etapas");
         break;
      case "btn3" :
         tooltip.followMouse = true;
         tooltip.fixedWidth = 150;
         tooltip.multiLine = true;
         tooltip.show("Costos");
         break;
      case "btn4" :
         tooltip.followMouse = true;
         tooltip.fixedWidth = 150;
         tooltip.multiLine = true;
         tooltip.show("Documentos");

         break;
   }


}
function onOut(e:MouseEvent):void
{
   tooltip.hide();

}

function link1 {
   var url:String = "http://www.xyz.com";
   var rege: URLRequest = new URLRequest(url);
   
   try{
      navigateToURL(rege, "_blank");
   } catch (e:Error) {
      trace("erorr de carga URL");
   }
}






Por Sigmax

Claber

136 de clabLevel

1 tutorial

 

msie
Citar            
MensajeEscrito el 30 May 2011 05:38 pm
Sugerencia> pon el error que te pone

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 30 May 2011 05:43 pm
no tendria que ser:

Código ActionScript :

function link1(e:MouseEvent):void{
     //el codigo
}

Por GustavoV

Claber

136 de clabLevel



Genero:Masculino  

firefox

 

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