inicio mail me! sindicaci;ón

Archive for March, 2008

Only in Amsterdam

UKunt

I just found this on a memory card - It’s from a trip to Amsterdam in 2004. Awesome, eh?

:)

Flash Image Loader As2

Here’s just a really basic example of loading images into flash… simple.

codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
WIDTH="420" HEIGHT="420" id="myMovieName"> NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">

Here’s the code:
//ImageLoader Function - Liamr.com/blog/?p=86

//Load in TweenLite

import gs.TweenLite;
import gs.TweenFilterLite;
import mx.transitions.easing.*

//Preview Button
preview_btn.onRelease = function(){

loadImage("http://www.liamr.com/labs/source/imageLoader/images/image_1.jpg");

}

preview_resize_btn.onRelease = function(){

loadImage("http://www.liamr.com/labs/source/imageLoader/images/image_2.jpg");

}

//Load function
function loadImage(source:String):Void{

var frameSize:Number = 10;
var frameColor:String = "0x000000";
var frameAlpha:Number = 95;

var mclLoader:MovieClipLoader = new MovieClipLoader ();
var mediaPoplistener:Object = new Object ();

mediaPop.holder._alpha = 0;

mclLoader.addListener (mediaPoplistener);
mclLoader.loadClip(source, mediaPop.holder);

TweenLite.to(mediaPop.bg, 0, {_y:0, _x:0, _alpha:50, _width:Number(Stage.width), _height:Number(Stage.height), ease:Strong.easeOut});
TweenLite.to(mediaPop.frame, 1, {_alpha:50, tint:frameColor, _height:20, _width:80, ease:Strong.easeOut});
TweenLite.to(mediaPop.loader, 0.1, {_alpha:50});
TweenLite.to(mediaPop, 1, {autoAlpha:100});
mediaPoplistener.onLoadProgress = function (target:MovieClip, loadedBytes:Number, totalBytes:Number):Void {
TweenLite.to(mediaPop.loader, 0.1, {_alpha:50});
percentageLoaded = Math.round(loadedBytes/totalBytes * 100);
mediaPop.loader.loadertext_txt.text = "Loading " + Math.floor(percentageLoaded) + "%";

}

mediaPoplistener.onLoadInit = function (target:MovieClip):Void {
mediaW = Math.round(mediaPop.holder._width);
mediaH = Math.round(mediaPop.holder._height);
frameW = mediaW + Number(frameSize*2);
frameH = mediaH + Number(frameSize*2);
TweenLite.to(mediaPop.loader, 1, {_alpha:0, ease:Strong.easeOut});
TweenLite.to(mediaPop.frame, 1, {_x:0, _y:0, _width:Number(frameW), _height:Number(frameH), tint:frameColor, ease:Strong.easeOut});
TweenLite.to(mediaPop.frame, 1, {_alpha:frameAlpha, delay:1, overwrite:false});
mediaPop.holder._x = frameSize;
mediaPop.holder._y = frameSize;
TweenLite.to(mediaPop.holder, 1, {_alpha:100, overwrite:false, delay:2, ease:Strong.easeOut});

}

}

And here is the zip (flash 8 ) …

SOURCE