Hi all
I am trying to use an image and I am having the following problem:
- the image is a png, 2000x2464 pixels
- I embed the image
- Everything works OK during the first few tries
- After some debugging session, without changing anything in the image embedding, the image isn’t loaded anymore, or better, it seems loaded ( in the variables I see the istance of my class and it is not null) but the bitmapdata of the image is null, width and height are 0.
- Now, I resize the image to something smaller and i start again. Everything works fine again and the cycle begins again !
Here’s the code:
In the declarations of the class containing the image:
[Embed(source = "images/italyMapZOUT.png")]
[Bindable]
var mapClass:Class;
var map:Bitmap;
In the initialization method that i call after construction:
map = new mapClass();
var bdata:BitmapData = map.bitmapData;
var myRatio:Number = someNumber / map.width;
...
It seems to me that I am embedding the image as described in zillions of sites and it is actually working… for some times ! Then , after say 5 or 6 debugging sessions, I get an error evaluating “someNumber” because width is zero, and checking the local variable I see that bitmapData is null.
Resizing to a smaller image , saving said image and restarting solves the issue temporarily.
Any idea what’s happening ?
Thank you very much !
Wentu