MediaEvent (accessing photos in Camera Roll)
I have Flash CS5, Adobe Air 2.7, I got everything installed, I can make apps and run them on my iPhone (developer, payed the money to Apple).
I've done alot of stuff now and wanted to continue learning so I was looking into the Camera Roll and I now need to use MediaEvent, but for some reason all examples I've found on the internet throws the same error:
1046: Type was not found or was not a compile-time constant: MediaEvent.
Why is this?
All the words in the text panel of Flash is blue, except MediaEvent which is grey (import flash.events.MediaEvent)
Two more that are grey and doesn't work are:CameraUI and MediaType.
What I want to do is to open a photo from the Camera Roll, but they all need MediaEvent which doesn't work for some reason.
Stuff like this works: (code to save the screen as an image in the Camera Roll)
if (CameraRoll.supportsAddBitmapData)
{
var cameraRoll:CameraRoll = new CameraRoll();
cameraRoll.addEventListener(ErrorEvent.ERROR, onCrError);
cameraRoll.addEventListener(Event.COMPLETE, onCrComplete);
var bitmapData:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight);
bitmapData.draw(stage);
cameraRoll.addBitmapData(bitmapData);
}
else
{
trace("not supported.");
}
function onCrError(event:ErrorEvent):void
{
// Notify user.
}
function onCrComplete(event:Event):void
{
// Notify user.
}
I find so many examples of how to browse the photos in the Camera Roll, but for some reason none works for me, error messages and grey words, and they should only need AIR 2.5.
