[Resolvido] aumentar tamanho de imagem em as3
bom , tenho esse codigo abaixo tudo funcionante , mas tenho que aumentar a altura das imagens e nao estou conseguindo ..
// Tweener
// http://code.google.com/p/tweener/
import caurina.transitions.Tweener;
slider_info.text = "carregando...";
link_title.text = "";
link_description.text = "";
var folder:String = "thumbnails/";
var start_from:Number = 0;
var no_of_tn:Number = 5;
var i:Number;
var tn:Number = 0;
var current_no:Number = 0;var tween_duration:Number = 0.8; // seconds
var total:Number;
var flashmo_xml:XML;
var flashmo_tn_list = new Array();
var thumbnail_group:MovieClip = new MovieClip();
this.addChild(thumbnail_group);
thumbnail_group.mask = slider_mask;
function load_gallery(xml_file:String):void{
var xml_loader:URLLoader = new URLLoader();
xml_loader.load( new URLRequest( xml_file ) );
xml_loader.addEventListener(Event.COMPLETE, create_thunbnail_slider);
}
function create_thunbnail_slider(e:Event):void{
flashmo_xml = new XML(e.target.data);
total = flashmo_xml.thumbnail.length();
for( i = 0; i < total; i++ )
{
flashmo_tn_list.push( {
filename: flashmo_xml.thumbnail[i].filename.toString(),
title: flashmo_xml.thumbnail[i].title.toString(),
description: flashmo_xml.thumbnail[i].description.toString(),
url: flashmo_xml.thumbnail[i].url.toString(),
target: flashmo_xml.thumbnail[i].target.toString()
} );
}
load_tn();
}
function load_tn():void{
var pic_request:URLRequest = new URLRequest( folder + flashmo_tn_list[tn].filename );
var pic_loader:Loader = new Loader();
pic_loader.load(pic_request);
pic_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, tn_progress);
pic_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, tn_loaded);
tn++;
}
function tn_progress(e:ProgressEvent):void{
slider_info.text = "carregando... " + tn + " de " + total;
}
function tn_loaded(e:Event):void{
if( tn < total )
load_tn();
else
slider_info.text = "";
var flashmo_tn_bm:Bitmap = new Bitmap();
var flashmo_tn_mc:MovieClip = new MovieClip();
flashmo_tn_bm = Bitmap(e.target.content);
flashmo_tn_bm.smoothing = true;
flashmo_tn_mc.addChild(flashmo_tn_bm);
flashmo_tn_mc.name = "flashmo_tn_" + thumbnail_group.numChildren;
flashmo_tn_mc.buttonMode = true;
flashmo_tn_mc.addEventListener( MouseEvent.MOUSE_OVER, tn_over );
flashmo_tn_mc.addEventListener( MouseEvent.MOUSE_OUT, tn_out );
flashmo_tn_mc.addEventListener( MouseEvent.CLICK, tn_click );
flashmo_tn_mc.x = thumbnail_group.numChildren * 150;
thumbnail_group.addChild( flashmo_tn_mc );
}
function tn_over(e:MouseEvent):void{
var mc:MovieClip = MovieClip(e.target);
current_no = parseInt(mc.name.slice(11,13));
Tweener.addTween( mc, { alpha: 0.5, time: tween_duration, transition: "easeIn" } );
link_title.text = flashmo_tn_list[current_no].title;
link_description.text = flashmo_tn_list[current_no].description;
}
function tn_out(e:MouseEvent):void{
var mc:MovieClip = MovieClip(e.target);
current_no = parseInt(mc.name.slice(11,13));
Tweener.addTween( mc, { alpha: 1, time: tween_duration, transition: "easeOut" } );
link_title.text = "";
link_description.text = "";
}
function tn_click(e:MouseEvent):void{
var mc:MovieClip = MovieClip(e.target);
current_no = parseInt(mc.name.slice(11,13));
navigateToURL( new URLRequest( flashmo_tn_list[current_no].url ),
flashmo_tn_list[current_no].target );
}
function move_slider():void{
if( total - start_from < no_of_tn )
start_from = total - no_of_tn;
if( start_from < 0 )
start_from = 0;
Tweener.addTween( thumbnail_group, { x: - start_from * 250,
time: tween_duration, transition: "easeInOutQuart" } );
}
flashmo_previous.addEventListener( MouseEvent.CLICK, move_left );
flashmo_next.addEventListener( MouseEvent.CLICK, move_right );
function move_left(e:MouseEvent):void{
start_from -= no_of_tn;
move_slider();
}
function move_right(e:MouseEvent):void{
start_from += no_of_tn;
move_slider();
}Discussão (8)
Carregando comentários...