Posted By

romech on 11/10/12


Tagged

image embed flashdevelop fd


Versions (?)

Embed Image into FlashDevelop


 / Published in: ActionScript 3
 

URL: embed-bitmap-flashdevelop

Embed bitmap into FlashDevelop. From: http://www.streamhead.com/embedding-images/

  1. package
  2. {
  3. import flash.display.Bitmap;
  4. import flash.display.Sprite;
  5. import flash.events.Event;
  6.  
  7. public class Main extends Sprite
  8. {
  9. [Embed(source = '../lib/imgname.png')]
  10. private var layer0Class:Class;
  11. private var layer0:Bitmap = new layer0Class();
  12.  
  13. public function Main():void
  14. {
  15. if (stage) init();
  16. else addEventListener(Event.ADDED_TO_STAGE, init);
  17. }
  18.  
  19. private function init(e:Event = null):void
  20. {
  21. removeEventListener(Event.ADDED_TO_STAGE, init);
  22.  
  23. addChild(layer0);
  24. }
  25. }
  26. }

Report this snippet  

You need to login to post a comment.