Hello guys,

I wrote a simple programme to test the effects of Bitmaps but when i run it,
i can't see anything on the display. does anyone knows why this is the case?
Below is my code:


<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";

   xmlns:s="library://ns.adobe.com/flex/spark"

   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"

   creationComplete="application1_creationCompleteHandler()">

<fx:Script>

<![CDATA[

 import flash.display.*;

import flash.net.URLRequest;

import flash.events.*;

import flash.geom.Matrix;

public var loader:Loader;


 public function application1_creationCompleteHandler():void

{

 var url:String = "image1.jpg";

 loader = new Loader();

 var request:URLRequest = new URLRequest(url);

 loader.load(request);

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, drawImage);

loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,
ioErrorHandler);

}

  function drawImage(event:Event):void

{

 var mySprite:Sprite = new Sprite();

var myBitmap:BitmapData = new BitmapData(loader.width, loader.height, false
);

 myBitmap.draw(loader, new Matrix());

 var matrix:Matrix = new Matrix();

matrix.rotate(Math.PI/4);

 mySprite.graphics.beginBitmapFill(myBitmap, matrix, true);

mySprite.graphics.drawRect(100, 50, 200, 90);

mySprite.graphics.endFill();

 addChild(mySprite);

}

 private function ioErrorHandler(event:IOErrorEvent):void

{

trace("Unable to load image: " + url);

}

]]>

</fx:Script>

<fx:Declarations>

<!-- Place non-visual elements (e.g., services, value objects) here -->

</fx:Declarations>

</s:Application>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api-for-flash?hl=en.

Reply via email to