Skip to content

Instantly share code, notes, and snippets.

@fenixkim
Created April 17, 2013 14:23
Show Gist options
  • Save fenixkim/5404711 to your computer and use it in GitHub Desktop.
Save fenixkim/5404711 to your computer and use it in GitHub Desktop.
El siguiente ejemplo demuestra como cargar una imagen externa
// Dependencias
// http://code.goto.com.co
// http://tweenmax.com
import com.goto.display.ImageView;
import flash.events.Event;
var ic:ImageView = new ImageView();
//ic.showMask = true;
ic.source = "http://fc08.deviantart.net/fs71/f/2013/106/9/8/i_am_so_confused_by_woxys-d61y6ri.jpg";
ic.width = stage.stageWidth;
ic.height = stage.stageHeight;
ic.scaleMode = "fitToWidthAndHeight"; // ó full
//ic.align = "topLeft"; // ó topRight, bottomLeft, bottomRight ... etc
this.addChild(ic);
//
// El código siguiente detecta cuando la película de flash se reescala
//
stage.align = "topLeft";
stage.addEventListener(Event.RESIZE, onResize);
function onResize(event:Event)
{
ic.width = stage.stageWidth;
ic.height = stage.stageHeight;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment