Comunidad de diseño web y desarrollo en internet online

Aumentar una imagen cuando paso el ratón por encima

Citar            
MensajeEscrito el 28 Abr 2009 03:47 pm
Hola a todos. Recurro otra vez a vosotros.
Quiero agregar un efecto, el cual aumente una imagen cuando pasas por encima de ella el raton, con Actionscript 3.0. No vi el tema por ahí, espero que no sea repe. Muchas gracias de antemano.

Por Meloca

16 de clabLevel



 

msie7
Citar            
MensajeEscrito el 28 Abr 2009 03:52 pm
Deberias hacer un mouse event en la imagen, y lo que deberia hacer el evento, es lo siguiente osea tener una funcion que re dimnesione la imagen, no se si esperabas que te demos codigo o te digamos como hacerlo pero en base a eso hacelo, depsues si no sabes como hacer eventos busca que esta.

Por aggust

26 de clabLevel



 

Argentina

firefox
Citar            
MensajeEscrito el 29 Abr 2009 04:33 pm
Hola. Lo que me pasa es que no se como se llama la función para escalar la imagen. Los mouse event si que lo se hacer.
¿Me podeis ayudar?

Por Meloca

16 de clabLevel



 

msie7
Citar            
MensajeEscrito el 29 Abr 2009 10:34 pm
La tenes que hacer vos por ejemplo (supongamos que idImg es la id de la Imagen que tenes
<mx:Script>
<![CDATA[
public function aumentarSizeImg(url:String):void{
//por poner unos numeros de tamaño de alto y ancho.
this.idImg.width = 500;
this.idImg.height = 500;
}
]]>
</mx:Script>

<mx:Image id="idImg" x="10" y="83" width="200" height="200" source="img/Nirvana.jpg"/>


A esta funcion deberia llamar el evento. se entiende?

Por aggust

26 de clabLevel



 

Argentina

firefox
Citar            
MensajeEscrito el 30 Abr 2009 03:35 pm
Buscando un efecto de lupa no hace mucho encontre esto y me sirvio de base para realizar un efecto de zoom con cupa. espero te pueda servir, porque hace lo que necesitas. saludos desde Quito - Ecuador

<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the Zoom effect. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

<mx:Script>
<![CDATA[
import flash.events.MouseEvent;

public function doZoom(event:MouseEvent):void {
if (zoomAll.isPlaying) {
zoomAll.reverse();
}
else {
// If this is a ROLL_OUT event, play the effect backwards.
// If this is a ROLL_OVER event, play the effect forwards.
zoomAll.play([event.target], event.type == MouseEvent.ROLL_OUT ? true : false);
}
}
]]>
</mx:Script>

<mx:Zoom id="zoomAll" zoomWidthTo="1" zoomHeightTo="1" zoomWidthFrom=".5" zoomHeightFrom=".5" />

<mx:Panel title="Zoom Effect Example" width="95%" height="95%" horizontalAlign="center"
paddingTop="5" paddingLeft="10" paddingRight="10" paddingBottom="5">

<mx:Text width="100%" color="blue"
text="Move the mouse over the image to enlarge it. Move the mouse off of the image to shrink it."/>

<mx:Image id="img"
source="@Embed(source='assets/Nokia_6630.png')"
scaleX=".5" scaleY=".5"
rollOver="doZoom(event)"
rollOut="doZoom(event)"/>

</mx:Panel>
</mx:Application>

Por riback

49 de clabLevel



 

Quito - Ecuador

msie7

 

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