Basically what I’m trying to do is load a Bitmap from a URL Request. 2 problems really.
- the mLoader.width and height doesn’t return anything
- When I input the loader manually, nothing comes up just some dots on the screen.
It’s part of a vehicle class, I’ve been searching hours on end for a solution. Even copy and pasted code. Nothing works…
I’m in urgent need of a fix, so any help is much appreciated.
public function loadBitmap(pURL:String) : void
{
mLoader.load(new URLRequest(pURL));
mHeight = mLoader.height;
mWidth = mLoader.width;
trace(mHeight, mWidth);
loadCompleteHandler();
}
//Called automatically from loadBitmap
private function loadCompleteHandler() : void
{
var BitmapData1:BitmapData = new BitmapData(mLoader.width, mLoader.height);
BitmapData1.draw(mLoader);
mPicture = new Bitmap(BitmapData1);
}
and in the main.as
TestCar.loadBitmap("http://www.clker.com/cliparts/d/e/2/8/11949846071340700778car_ride_ganson.svg.thumb.png");