Tag Archives: Flash Platform

Speaking at 360|Stack!

360stack

Building GPU-Accelerated Mobile Application Interfaces with Starling and Feathers
Apache Flex is great for application UI… but it isn’t GPU-accelerated :( New versions of Adobe AIR perform quite spectacularly on mobile and really blaze when tapping into the device GPU. If your mobile application requires this sort of performance – there is a solution to be found in the Starling framework along with Feathers (a fully-skinnable, open source component and layout framework)! This session will demonstrate how to use Feathers to create great, performant mobile interfaces for not only games but applications as well!

This will be my second year speaking for 360|Stack… er… my first for 360|Stack – but I did have a talk at 360|Flex last year as well. If you haven’t attended a 360|Whatever in the past – I encourage you to do so. These are consistently great community events with a bunch of passionate, intelligent people specializing in Flash Platform and web stack technologies. I hear there is going to be a bunch of other neat stuff represented too; Google Glass, TypeScript, Arduino, C#, and more!

Check out the SPEAKERS! Look over the SCHEDULE! See you in DENVER this August!

Flash Runtimes Roadmap Updated for 2013

Adobe has updated the Flash Runtimes Roadmap whitepaper for the new year and there are some significant changes from previous iterations. Some of this is good, some questionable… and some bad:

  • New documentation of the SWF file format has been made available (good)
  • XC APIs are no longer designated as Premium Features (good)
  • New info on “Folsom” and “Geary” (good)
  • ActionScript “Next” development has been cancelled (questionable)
  • Flash Player “Next” development has been cancelled (questionable)
  • AIR for Windows 8 “Modern UI” has been cancelled (bad)
  • Web-based VM work hinted at (good)

On top of these announcements, Adobe has recently submitted the RTMFP p2p protocol for consideration as an open web standard and has been loudly trumpeting their gaming initiative and has increased funding toward the Away Foundation who are building AIR-based tooling for the Away3D framework. All of this news is very good and welcome.

Let’s examine some snippets from the roadmap:

Adobe will focus its future Flash Player development on top of the existing Flash Player architecture and virtual machine, and not on a completely new virtual machine and architecture (Flash Player “Next”) as was previously planned.

In general, I’m disappointed that the new runtimes and language are not happening… even though I do understand the reasoning for it. It would certainly be disruptive (though some would argue that disruption is what is needed), but this initiative demonstrated that Adobe was invested in the long term. This is now somewhat questionable. 

Adobe AIR is available and supported for Windows 8 Desktop on x86-based computers. Adobe currently has no plans to support Adobe AIR for Windows 8 Modern UI applications.

In my opinion, lack of support for the Windows “Modern UI” is a huge gap in the cross-platform story of AIR – perhaps even larger than the current Linux-sized hole we are now dealing with. The stated reasoning behind killing off Flash Player for Android was to focus on mobile AIR. Ooops.

Adobe plans to continue its next-generation virtual machine and language work as part of the larger web community doing such work on web-based virtual machines.

This is interesting. Really interesting. Does this mean Adobe envisions taking what has been done for the stillborn Flash VM and writing some sort of JavaScript-based virtual machine that is truly cross-platform with some of the advantages of AS3/Flash? Such an initiative could have tremendous possibilities if this is the case. Adobe is keeping tight-lipped about these plans… but hopefully we’ll hear something by MAX.

There is a lot more to the roadmap. I simply examined the bits I have the most concern/interest about in this post. I suggest that everyone go over and read it for themselves if any of this is of interest.

For those interested in public discussion, there is a very active one going on over on Google Plus with contributions from Adobe employees and the community. Join in.

Notes around Starling and the Display List

I learned a couple of neat things while working on TelemetryEASY that have to do with some limitations of Starling and also communication between Starling and the traditional display list. You might wonder… why bother using Stage3D frameworks at all for a simple utility app? Mostly to increase my familiarity with Starling and especially to discover some of the little trouble points I’m writing about here, along with some solutions.

Problem #1: NativeDragManager

TelemtryEASY allows for a user to drag and drop files onto the utility app from the desktop or file system. Using AIR, this is pretty easy using flash.desktop.NativeDragManager. The problem comes into play when you are using a Stage3D rendering view like Starling though; because when using the acceptDragDrop() method, you must pass in an object which extends flash.display.InteractiveObject… and there seems to be no equivalent for Starling.

So what I ended up doing was mixing the display list and Starling and using a normal Flash Sprite to accept the drag and drop procedure. Now, you are not supposed to mix Stage3D and the display list for performance reasons… but nothing much is really going on here – so it is  suitable concession.

private function addedToStage(e:Event):void
{
	this.removeEventListener(Event.ADDED_TO_STAGE, addedToStage);
	
	_dragTarget = new Sprite();
	_dragTarget.graphics.beginFill(0x00000, 0);
	_dragTarget.graphics.drawRect(0,0,stage.stageWidth,stage.stageWidth);
	_dragTarget.graphics.endFill();
	this.addChild(_dragTarget);
	_dragTarget.addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, onDragEnter);
	_dragTarget.addEventListener(NativeDragEvent.NATIVE_DRAG_DROP, onDragDrop);
			
	if(this.stage)
	{
		this.stage.align = StageAlign.TOP_LEFT;
		this.stage.scaleMode = StageScaleMode.NO_SCALE;
	}
			
	DeviceCapabilities.dpi = 200;
	DeviceCapabilities.screenPixelWidth = stage.stageWidth;
	DeviceCapabilities.screenPixelHeight = stage.stageHeight;
			
	this.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);
}

So we have a basic Sprite serving as a drop target overlaying the Starling render view. Problem solved.

Problem #2: Stage3D Communication

The second problem was also a bit tricky and I’m sure there is probably more than one way to handle this. I need to be able to pass a modified string variable from my document class (where all of the processing is occurring) down through my Starling classes in order to update a status message view (Feathers component) being rendered deep within the application.

To accomplish this, I created a small method within the document class which simply accepts string values to pass on through to the primary Starling class defined when we instantiate Starling itself. This was probably the most tricky bit to the entire process; figuring out how to access a member of that main Starling class, com.fracturedvisionmedia.telemetryEASY.Main, from the document class root.

private function updateMessage(s:String):void
{
	(_starling.stage.getChildAt(1) as Main).message = s;
}

We can then invoke this updateMessage() method from wherever we want in the process. In this instance, I’m invoking it whenever the native process (Python) exits in order to let the user know what’s going on.

private function onExit(e:NativeProcessExitEvent):void {
	if(e.exitCode == 0){
		updateMessage("Telemetry Tag Added!\n\nHooray :D");
	}else if(e.exitCode == 1){
		updateMessage("Looks like Telemetry is already enabled.\n\nGood for you!");
	}else{
		updateMessage("I AM ERROR");
	}
}

Within the main Starling class, com.fracturedvisionmedia.telemetryEASY.Main, we create a small public variable (or method, if you prefer that instead) to retain any changes fed in through the document class. This variable will hold the new string values to be drawn from by other Starling classes.

public var message:String;

The final piece (in this case) is to have a listener which runs every frame to update the text view by polling the root Starling class, com.fracturedvisionmedia.telemetryEASY.screens.MainMenuScreen, for changes fed in through the document class.

override protected function initialize():void
{
	status = new ScrollText();
	status.text = "Drag a SWF here to enable advanced telemetry.";
	status.addEventListener(Event.ENTER_FRAME, checkMessage);
	this.addChild(this._status);
	status.textFormat = new TextFormat("Arial", 14, 0xffb400, true, false, false, null, null, "center");
}

private function checkMessage():void
{
	status.text = (this.root as Main).message;
}

This enables any updates from the traditional Flash side of things to be pickup up on by the Starling classes and have appropriate modifications rendered on screen!

Flash Builder 4.7 and Adobe Scout 1.0 Released

Two new major Flash Platform releases have occurred: a new version of the Flash Builder development tool and a brand new product: Adobe Scout! This is part of the larger Adobe Game Developer Tools initiative – part of the Creative Cloud.

Flash Builder 4.7
After two beta releases on Adobe Labs, Flash Builder 4.7 has now been released!
This release introduces new development features and enhancements to Flash Builder and provides support for the new Apache Flex SDK and the new ActionScript Compiler 2.0.

So what are the new features in this version of Flash Builder?

  • Flash Builder is now a 64-bit application
  • Support for the Apache Flex 4.8 SDK
  • Support for the Adobe Scout 1.0 product
  • New ASC 2.0 compiler support for ActionScript Projects
  • Support for creating and managing ActionScript Workers
  • Configuring multiple build targets for multi-screen projects
  • Support for customizing ADT and ADL parameters
  • Support for creating ActionScript Library Projects
  • Real time error highlighting using the ASC 2.0 compiler
  • Enhanced Developer Productivity Features including new Quick Assists
  • Advanced support for iOS deploy/test/debug/sim

Note that Design View, as previously indicated, no longer exists in Flash Builder 4.7. If Design View is desired, you will probably want to use Flash Builder 4.6. Note that both versions can be installed in parallel!

Adobe Scout 1.0
Some of you may be confused about the name… “what is Scout?”… well, Scout is the 1.0 product name of the former Project ‘Monocle’. It’s out now, as part of the Creative Cloud Game Developer Tools. Not only that, but much like Edge Animate – the full version of Scout is FREE for a limited time. After Scout transitions to a paid offering, it will still be available for free with advanced telemetry features disabled.

Adobe Scout is the next-­generation profiler for Flash content running on both the desktop and on mobile devices. It gives you insight into the behavior of your Flash content that simply wasn’t possible in the past.

Scout relies on the new telemetry feature, which was introduced in Flash Player 11.4 and AIR 3.4. This feature gathers detailed information about the internals of the Flash runtime, as well as the ActionScript that it executes, and sends it all to Scout. Scout presents this data clearly, concisely, and graphically, so that you can quickly diagnose performance problems with your content.

To get detailed telemetry data to appear, a project must be compiled in such a way to enable this feature. This can be easily done with Flash Builder 4.7, or through other, less-supported means. Even without advanced telemetry enabled, there is still a good deal of information which can be gathered through the use of Scout.

Adobe Game Developer Tools part of Creative Cloud!

Adobe has announced a great new addition to the Creative Cloud: Game Developer Tools! The addition of this set of tools reinforces a commitment to the Flash Platform on top of the already rapid advances in runtimes we’ve seen over the past year. Making this new set of gaming tools a part of the Creative Cloud places them alongside the excellent Edge Tools and Services offering which became available in October, and the core creative tools which includes Flash Builder 4.7 and Flash Professional CS6.

This new set of tools includes the Adobe Gaming SDK, the FlasCC cross-compiler, and the new Adobe Scout 1.0 advanced telemetry profiler.

FlasCC is the product previously codenamed Project ‘Alchemy’. FlasCC allows developers to bring C/C++ code — including the leading game engines on PCs, Xbox 360, and PlayStation 3 — to the web using Stage3D.

Adobe Scout is the product previously codenamed Project ‘Monocle’. Scout enables advanced profiling and introspection through the advanced telemetry features of Flash Player 11.4 and Adobe AIR 3.4.

Gaming SDK is a new convenience offering which provides a sort of jump-start for developers getting into all of this great new stuff the Flash platform has to offer.

So why a Gaming SDK? The world of Stage3D is very different from that of traditional Flash development. Stage3D was first available with Flash Player 11 and AIR 3 last year on the desktop – and has recently been made available for mobile devices as well. The new APIs offer a huge leap forward in terms of what Flash is capable of- yet the use of these APIs requires some pretty hardcore knowledge of shaders, vertexes, AGAL, and just all around low level programming that most people do not have the time or desire to deal with.

Enter a set of brilliant 3rd party framework developers who enable the use of Stage3D APIs is a functional way for everyone! Frameworks like Starling for 2D rendering views, Away3D for 3D rendering views, and the awesome Feathers component and layout library for GUI elements provides a core set of powerful frameworks upon which to build any number of experiences for games, apps, whatever!

Adobe has recognized the value of these frameworks and have thrown their support behind all three of them. These are core frameworks as part of the new Gaming SDK, alongside the AIR SDK 3.5 and a number of great ActionScript Native Extensions. Rounding out the package is a group of documentation resources, code samples, and a set of tools to work with ATF textures. Installing the Gaming SDK will enable everything needed for a developer to get going with all this new stuff quickly!

Also available now is the final version of Flash Builder 4.7 and, of course, Flash Professional CS6. Both products are include in a standard Creative Cloud membership and trials are available for those accessing the free Game Developer Tools.