Foros del Web » Creando para Internet » Flash y Actionscript »

personalizar posicion de un tooltip personalizado

Estas en el tema de personalizar posicion de un tooltip personalizado en el foro de Flash y Actionscript en Foros del Web. Buen dia! estoy buscando la manera de poner el tool tip dependiendo de la posicion del item por la que pases el raton, hasta ahora ...
  #1 (permalink)  
Antiguo 18/01/2011, 09:40
Avatar de superscully  
Fecha de Ingreso: febrero-2009
Mensajes: 56
Antigüedad: 15 años, 2 meses
Puntos: 0
Busqueda personalizar posicion de un tooltip personalizado

Buen dia!

estoy buscando la manera de poner el tool tip dependiendo de la posicion del item por la que pases el raton, hasta ahora no he tenido exito... este es mi codigo.

CustomToolTip:
Código Flex 3:
Ver original
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" implements="mx.core.IToolTip"
  3.      borderThickness="3"
  4.     borderColor="#555555"
  5.     borderStyle="solid"
  6.     cornerRadius="20" paddingTop="10" backgroundColor="#FFFFFF" paddingRight="10" paddingLeft="10" paddingBottom="10" width="500">
  7. <mx:Script>
  8.     <![CDATA[
  9.         [Bindable] public var info:XML = new XML();
  10.        
  11.         //  Implement required methods of the IToolTip interface; these
  12.         //  methods are not used in this example, though.
  13.         public var _text:String;
  14.  
  15.         public function get text():String {
  16.             return _text;
  17.         }
  18.         public function set text(value:String):void {
  19.         }
  20.            
  21.     ]]>
  22. </mx:Script>
  23.     <mx:HBox width="100%" backgroundAlpha="0">
  24.         <mx:Label text="Titulo:"/>
  25.         <mx:Label id="lblTitulo" text="{info.@titulo}"  fontSize="12"/>
  26.     </mx:HBox>
  27.     <mx:HBox width="100%" backgroundAlpha="0">
  28.         <mx:Label text="Fecha:"/>
  29.         <mx:Label id="lblFecha" text="{info.@fecha}"  fontSize="12"/>
  30.     </mx:HBox>
  31.     <mx:HBox width="100%" borderStyle="none" backgroundAlpha="0">
  32.         <mx:Label text="Fotografo:"/>
  33.         <mx:Label id="lblFotografo" text="{info.@fotografo}" fontSize="12"/>
  34.     </mx:HBox>
  35.     <mx:Label text="Resumen:"/>
  36.     <mx:Text text="{info.@resumen}" id="txtResumen" width="90%" height="50"/>
  37.     <mx:HorizontalList height="110" width="80%"   id="tilelista"
  38.          rowCount="1" rowHeight="140"
  39.         maxRows="1" liveScrolling="true" backgroundAlpha="0" borderStyle="none"
  40.         allowMultipleSelection="false" dataProvider="{info.@archivo}"/>
  41. </mx:VBox>

Este es el componente que se manda llamar al CustomToolTip, he intentado hacer esto con el ToolTip.move pero me mueve todos los tool tips y lo que quiciera hacer es que dependiendo de la posicion del item con respecto del tamaño de la pantalla muestre el tool tip mas arriba o mas abajo...

ItemRenderFotos:
Código Flex 3:
Ver original
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" toolTip=" "  verticalAlign="middle" horizontalAlign="center" toolTipCreate="CreateCustomToolTip(event)">
  3. <mx:Script>
  4.     <![CDATA[
  5.         import mx.events.ToolTipEvent;
  6.         import mx.managers.ToolTipManager;
  7.        
  8.         private function CreateCustomToolTip(event:ToolTipEvent):void
  9.         {
  10.             var tooltip:CustomToolTip = new CustomToolTip();
  11.             tooltip.info = event.target.data;
  12.             event.toolTip = tooltip;
  13.             event.toolTip.move(-10,-10);
  14.         }
  15.        
  16.     ]]>
  17. </mx:Script>
  18.     <mx:Image  height="180" width="180" source="http://localhost/previstas_discos/{data.@dir}/{data.@arch1}" verticalAlign="middle" horizontalAlign="center"/>
  19. </mx:VBox>

ha otra cosa es que el TileList del tool tip no me muestra los elementos... antes si lo asi por que no estaban en el tooltip... esto influye o que onda???

les agradesco mucho si pueden ayudarme... saludos!

Etiquetas: flex, tooltip
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:21.