# \[AS3.0\] strange BitmapData behavior

**URL:** https://forum.kirupa.com/t/as3-0-strange-bitmapdata-behavior/222538
**Category:** flash
**Created:** [April 14, 2007, 3:36pm UTC](https://forum.kirupa.com/t/as3-0-strange-bitmapdata-behavior/222538 "2007-04-14T15:36:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![watcher](https://avatars.discourse-cdn.com/v4/letter/w/77aa72/32.png) [@watcher](https://forum.kirupa.com/u/watcher)
#### Post date: [April 14, 2007, 3:36pm UTC](https://forum.kirupa.com/t/as3-0-strange-bitmapdata-behavior/222538/1 "2007-04-14T15:36:43Z")

</div>

Hi there,

I have some problems with Bitmap displaying properly loaded image, when providing variables as width and height in the constructor as opposed to numbers, example:

```auto

if(_bitmapData) {
   _bitmapData.dispose();
}

_bitmapData = new BitmapData(_loader.width *_scaleFactor, _loader.height *_scaleFactor, false, 0xFFFFFF); // 
[*]
// _bitmapData = new BitmapData(1280, 1519, false, 0xFFFFFF); // [**]

// trace(_bitmapData.width, _bitmapData.height) // traces: 1280, 1519

_bitmapData.draw(_loader, new Matrix(_scaleFactor, 0, 0, _scaleFactor, 0, 0));
_bitmap.bitmapData = _bitmapData;

```

Running the app with this code cuts away half of the picture from right and half of the picture from the bottom. Since the BitmapData is filled with solid white background, the clipping is clearly visible.

When line marked with  
[\*] is commented out, and line marked with [\*\*] is uncommented instead, the whole picture displays and all is just as expected.

The only difference between those two lines of code is, that in line  
[\*] are used some properties+variables, and constants are used in line marked with [\*\*].

I have no idea, why this is happening… anybody having the idea, please enlighten me! 🙂

I am using Flex Builder 2.0.

thank You!
