Right off the bat, with the few new things that I’ve messed around with so far, I haven’t really run into much in FP 10.1 that’s both interesting and working with my particular setup.
Examples:
Gee, thanks, I guess I won’t be testing that. The classes do exist in the player, but it looks like
loaderInfo.uncaughtErrorEvents
is null for the release that we got.
Unfortunately, the only computer I have that has some
multitouch capabilities is my Macbook Pro, so I can’t even use the trackpad gesture additions. It doesn’t seem to work if I’m just viewing the SWF in a browser (without it being embedded in HTML), either, and a standalone player hasn’t been released yet. Just for kicks, I tried running Windows 7 in VMware and seeing if that would let me use gestures. It didn’t.
The one thing new thing that did work was the collection of new accessor methods for memory… but that’s not very exciting to test out.
If anyone’s interested, here’s the test file that I’m using to test some of these new features. It’s not really well-structured, but I figured that it didn’t need to be for a test:
Demo file: http://reclipse.net/kirupa/fp_10_1/FeatureTest.html
[whisper]requires FP 10.1, of course, although I didn’t modify the player version requirement in the HTML[/whisper]
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
public class FeatureTest extends Sprite {
public static var self:FeatureTest;
public function FeatureTest(){
// do globally needed init stuff
init();
// do the actual testing of new features
rest();
}
private function init():void {
FeatureTest.self = this; // make the stage cheaply accessible from my internal classes
addChild(t.field); // display the t.race output field
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
t.field.width = stage.stageWidth;
t.field.height = stage.stageHeight;
t.race('--- init ---');
}
private function rest():void {
capabilityDump();
new MemoryMonitor();
/*
// these don't seem to work yet
var erEx:ErrorHandlingExample = new ErrorHandlingExample();
erEx.initGlobalErrorHandler();
var gestures:GestureExample = new GestureExample();*/
}
}
}
import flash.display.*;
import flash.events.*;
import flash.sensors.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;
internal class ErrorHandlingExample {
public function initGlobalErrorHandler():void {
t.race('started error handler', FeatureTest.self.loaderInfo);
//FeatureTest.self.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onError);
//t.race('started error handler');
}
private function onError(e:UncaughtErrorEvent):void {
t.race('error handled', e);
}
}
internal function capabilityDump():void {
t.race('version:', Capabilities.version);
t.race('accelerometer?:', Accelerometer.isSupported);
t.race('multitouch?:', Multitouch.supportsGestureEvents, Multitouch.supportsTouchEvents);
t.race('touchscreen type:', Capabilities.touchscreenType);
t.race('global event handler exists?:', FeatureTest.self.loaderInfo.uncaughtErrorEvents);
}
internal class AccelerometerExample {
public function AccelerometerExample(){
// meh, nothing supports this
}
}
internal class MemoryMonitor extends Timer {
public function MemoryMonitor(){
super(1000, 10);
addEventListener(TimerEvent.TIMER, handler);
start();
}
private function handler(e:TimerEvent):void {
t.race('private: ' + format(System.privateMemory) + ' MB', 'total: ' + format(System.totalMemory) + ' MB', 'free: ' + format(System.freeMemory) + ' MB');
}
private function format(bytes:Number):String {
return (bytes / 1048576).toFixed(2);
}
}
internal class GestureExample {
Multitouch.inputMode = MultitouchInputMode.GESTURE;
public function GestureExample(){
var stage:Stage = FeatureTest.self.stage;
t.race('gesture support?:', Multitouch.supportsGestureEvents);
for each(var mode:String in Multitouch.supportedGestures){
t.race('mode supported:', mode);
}
stage.addEventListener(GestureEvent.GESTURE_TWO_FINGER_TAP, onGesture);
}
private function onGesture(e:GestureEvent):void {
t.race('gesture event is: ', e.type);
}
}
internal class t {
public static var field:TextField = new TextField();
field.multiline = true;
if(Font.enumerateFonts(true).map(function(elem:Font, index1:*, arr:*):String { return elem.fontName }).indexOf('Courier New') != -1){
field.defaultTextFormat = new TextFormat('Courier New', 12);
field.text = '-- with Courier New --
'
}
public static function race(...args):void {
for each(var arg:* in args){
field.appendText(String(arg) + " ");
}
field.appendText("
");
}
}
[whisper]Because I haven’t found a debug player yet, I am just printing to a TextField for now…[/whisper] (Update: there have been debug players for a while now)
Anyway, I haven’t gotten around to testing things like microphone sampling, any of the AIR 2-exclusive features, or things that would take a bit longer to set up (it’s already 4:30am), so I’m not claiming that this beta is totally useless yet (I’m just a bit discouraged). :sure:
What have any of you done with the new APIs so far? Have you been able to get any of the things working that I couldn’t?
Also, does anyone know what’s up with flash.utils.getAliasName? It’s listed in the documentation but not in the updated playerglobal.swc: flash.utils - Details BETA ActionScript® 3 (AS3) Reference for the Adobe® Flash® Platform API Reference