# Embedding bitmap jpg file from library using actionscript

**URL:** https://forum.kirupa.com/t/embedding-bitmap-jpg-file-from-library-using-actionscript/248745
**Category:** flash
**Created:** [January 11, 2008, 7:18am UTC](https://forum.kirupa.com/t/embedding-bitmap-jpg-file-from-library-using-actionscript/248745 "2008-01-11T07:18:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sargeonline](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@sargeonline](https://forum.kirupa.com/u/sargeonline)
#### Post date: [January 11, 2008, 7:18am UTC](https://forum.kirupa.com/t/embedding-bitmap-jpg-file-from-library-using-actionscript/248745/1 "2008-01-11T07:18:25Z")

</div>

I have exported a .jpg file for actionscript with class name Picture in the library. I have a class called EmbedAssets. For some reason it keeps coming up with the error: 1136: Incorrect number of arguments. Expected 2 and 1067: Implicit coercion of a value of type Picture to an unrelated type flash.display:DisplayObject.

I have created another example where I have embedded a movieclip and that works find, but for some reason it doesn’t seem to want to work with a .jpg file.

Here is the code:

```auto
package {
    
    import flash.display.Sprite;
    import flash.display.Bitmap;
    import flash.display.DisplayObject;
    import flash.display.BitmapData;
    
    
    public class EmbedAsset extends Sprite {
        
        
        
        
        
        public function EmbedAsset() {
            init();
        }
        
        private function init():void {
            var picture:Picture = new Picture(); 
            addChild(picture);
            
       
        }
        
    }
}

```

Any help would be greatly appreciated.

Thanks in advance!
