My favorites | Sign in
Project Logo
                
Changes to /trunk/as3/examples/components/Demo_01_Panel.as
r0 vs. r58   Edit
  Compare: vs.   Format:
Revision r58
Go to: 
Project members, sign in to write a code review
/trunk/as3/examples/components/Demo_01_Panel.as   r0 /trunk/as3/examples/components/Demo_01_Panel.as   r58
  1 /**
  2 * This code is part of the Bumpslide Library by David Knape
  3 * http://bumpslide.com/
  4 *
  5 * Copyright (c) 2006, 2007, 2008 by Bumpslide, Inc.
  6 *
  7 * Released under the open-source MIT license.
  8 * http://www.opensource.org/licenses/mit-license.php
  9 * see LICENSE.txt for full license terms
  10 */
  11 package {
  12 import flash.display.Loader;
  13 import flash.net.URLRequest;
  14
  15 import com.bumpslide.ui.Applet;
  16 import com.bumpslide.ui.Panel;
  17
  18 /**
  19 * Barebones Panel Test - content is unare of the panel
  20 *
  21 * @mxmlc -sp+=../../classes
  22 * @author David Knape
  23 */
  24 public class Demo_01_Panel extends Applet {
  25
  26 private var panel:Panel;
  27 private var image:Loader;
  28
  29 override protected function addChildren():void {
  30
  31 // create panel with x=10, y=10
  32 panel = new Panel();
  33 panel.move(10, 10);
  34
  35 // load an image
  36 image = new Loader();
  37 image.load(new URLRequest('http://farm4.static.flickr.com/3053/2572693685_c5a3718e05.jpg'));
  38
  39 // put the image in the panel
  40 panel.content = image;
  41
  42 // show the panel
  43 addChild(panel);
  44 }
  45
  46 // on stage resize, update the panel size
  47 override protected function draw():void {
  48 panel.setSize(width - 20, height - 20);
  49 super.draw();
  50 }
  51 }
  52 }
Hosted by Google Code