Hi. I'm trying to display a single image using pure AS3 code in flashDevelop. My code is this simple thing:
It displays the image using Flash Player. However, it isn't shown in GFx Player or in game.
In the GFX Player this error is thrown in bold red letters:
So, what would be the best way to show embedded images? TIA
Code:
package { import flash.display.*; public class Main extends Sprite { [Embed(source = "../assets/logoAGDG.png", mimeType = "image/png")] private var logoAGDG:Class; public function Main() { super(); trace("loading image"); var sp = new logoAGDG(); addChild(sp); } } }
In the GFX Player this error is thrown in bold red letters:
Code:
Error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at Bitmap Asset instance constructor()[E:\dev\4.y\frameworks\project\framework\src;mx\core;BitmapAsset.as:136] at Main_logoAGDG instance constructor() at Main instance constructor()
So, what would be the best way to show embedded images? TIA
Comment