Adobe Flash Player Premium Features for Gaming

Flash Player premium features for gaming enable developers and publishers to deliver stunning web-based games across browsers to over a billion computers—dramatically expanding the market for a new class of social gaming experiences. In addition, Adobe is opening up the Flash Player to a supported third party ecosystem of specialized gaming middleware and development tools, not just those from Adobe. Adobe’s support of these 3rd party developer solutions targeting the Flash Player is enabled by the new tier of premium features.

  • The new tier of premium features provides access to domain memory in combination with hardware-accelerated Stage3D in Flash Player.
  • This combination of APIs enables unprecedented gaming experiences across the web. Together, they allow native game engines that power premiere titles on the most advanced modern console hardware to run directly on the web with no install, consistently across browsers, while reaching the largest possible audience.
  • All other existing Flash Player capabilities are unaffected by the premium features terms. Developers can continue to use all of the other features of Flash Player—which power many of the most successful games on the web today—royalty-free.
  • Developers can use the premium features without charge in apps packaged for iPhone/iPad (iOS), Android, Windows, or Mac OS using Adobe® AIR®.

[……]

Read more

How to increase the number of AIR mobile applications

目前APP Store里面使用Adobe AIR技术开发的iOS应用并不是很多,虽然其中不乏一些精品(例如曾经登上iPad排行榜榜首的机械迷城),但相对于APP Store里面50多万的应用总数还是略微少了些。

笔者认为使用AIR来开发应用,特别是游戏类应用,效率是肯定远远胜过使用Objective-C的,性能也并不差很多,况且还能不用怎么修改源代码而跨平台到桌面系统,Android系统和黑莓系统。尽管如此,为何目前AIR For iOS应用数量较少呢?Adobe又需要采用什么战略来增加这一数量呢?

我们不妨先来看看AIR的竞争对手之一,Titanium。Titanium几乎与AIR的战略一模一样,一开始AIR支持桌面的时候,Titanium也仅能支持桌面。后来AIR开始支持移动系统Android和iOS,Titanium也效仿之。但是目前使用Titanium开发的应用比AIR要多很多,据统计现在iTunes应用商店中的500,000应用中,有几乎五分之一是基于Titanium开发的。

Titanium是Appcelerator公司旗下的跨平台开源开发框架。一般来说,开发者采用JavaScript在Titanium上开发应用,不过与其他Web移动框架例如PhoneGap不同的是,Titanium独特的cross-compile的跨平台编译技术能将Web应用直接转换为各种平台中原生的应用程序。这一点大大增强了Web应用的性能,而且跟Adobe AIR技术非常类似——将Flash应用直接编译为原生应用。

Titanium的收费页面是:http://www.appcelerator.com/products/plans-pricing/

通过上面那个网址我们可以看到,Titanium的收费方式,主要是如下几种:[……]

Read more

Building Social Applications with AIR

这里是Adobe官方网站对于AIR的介绍:

Adobe® AIR® 运行时使开发人员能使用 HTML、JavaScript、Adobe Flash® Professional 软件和 ActionScript® 构建 Web 应用程序,这些应用程序可以作为独立的客户端应用程序运行并且不受浏览器的约束。Adobe AIR 作为 Flash Platform 的一个关键组件,为跨设备和平台交付应用程序提供了一个一致、灵活的开发环境,使设计人员和开发人员能完全释放自己的创意。现在提供 AndroidΤΜ BlackBerryΤΜ Tablet OS 和 iOS* 移动操作系统及电视支持。

MixMatchMusic首席执行官兼共同创始人,MobBase 移动应用程序服务开发人员,Charles Feinn,这样评价Adobe AIR:

借助 Adobe AIR,我们将相同的代码用于桌面、Tablet 和智能手机,这不仅为我们节省了时间和资金,还提供了部署效率。我们随后可以快速、有效地通过 Adobe 的应用程序分发服务 Adobe InMarket 分发这些应用程序。

Emantras Inc. 首席执行官,Sesh Kumar也给Adobe AIR不错的评价:

使用 Adobe AIR 和 Flash Platform 创建应用程序的投资回报和资源节省真正扭转了形势。AIR 是唯一可用的解决方案,它允许您通过重用代码瞄准智能手机、Tablet、台式机和电视。通过多种设备提供电子教学内容的能力令几乎所有人都能进行学习。

Adobe AIR诞生数年来,已经从1.0版本升级至如今的2.5版本,产品日趋成熟,其跨平台理念也从电脑桌面扩展到了移动平台,包括Android系统、iOS系统、黑莓系统等等。

[……]

Read more

AIR Auto update introduction

AIR 1.5 加入了自动升级的类air.update.ApplicationUpdater,这样你的AIR应用程序便可以通过网络自动更新到最新版本了。

注意:Flex SDK 3.2以上才支持AIR 1.5。

自动更新的原理:ApplicationUpdater 会去读取网络上的一个XML版本描述文件,其中包含了版本号和对应的安装文件路径以及更新描述信息,然后和当前运行的AIR程序版本进行比较,来决定是否下载和安装。
这里有一个例子:

<?xml version="1.0" encoding="utf-8"?>  
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="checkForUpdate()">  
    <mx:Script>  
        <![CDATA[  
            import mx.controls.Alert;  
            import air.update.events.UpdateEvent;  
            import air.update.ApplicationUpdaterUI;  
            private var appUpdater:ApplicationUpdaterUI = new ApplicationUpdaterUI();  
  
            private function checkForUpdate():void {  
                appUpdater.updateURL = "http://localhost:8400/team/xml/test-update.xml"; // Server-side XML file describing update  
                appUpdater.isCheckForUpdateVisible = false; // We won't ask permission to check for an update  
                appUpdater.addEventListener(UpdateEvent.INITIALIZED, onUpdate); // Once initialized, run onUpdate  
                appUpdater.addEventListener(ErrorEvent.ERROR, onError); // If something goes wrong, run onError  
                appUpdater.initialize(); // Initialize the update framework  
            }    
            private function onError(event:ErrorEvent):void {  
                Alert.show(event.toString());  
            }  
            private function onUpdate(event:UpdateEvent):void {  
                appUpdater.checkNow(); // Go check for an update now  
            }  
        ]]>  
    </mx:Script>  
</mx:WindowedApplication>  

[……]

Read more

Flash FileReference loose cookies during upload issue (1)

This is a very famous issue since 2005:  Flash FileReference loose cookies during upload under Firefox/Chrome/Safari. Exists in Windows and Mac OS.

Refer: https://bugs.adobe.com/jira/browse/FP-78

Root Cause: These browsers not provide API for Flash to get session cookies while Microsoft IE support it.

First I will give solutions for PHP applications. Then I will give Java EE version in the following articles.

PHP: very easy to verify it, a very simple test page

<?php
  // initialize a session
  session_start();
                    
  // print value
  $_SESSION['animal'] = 'cat';

  echo '<object width="550" height="400">';
  echo '<param name="movie" value="uploadTest.swf">';
  echo '<embed src="uploadTest.swf" width="550" height="400">';
  echo '</embed>';
  echo '</object>';
?>
dispatcher.addEventListener(Event.SELECT, selectHandler);

function selectHandler(event:Event):void
{
    var file:FileReference = FileReference(event.target);
    file.upload(kUrlReq);
}
<?php
session_start();
if ($_SESSION['animal'] != 'cat')
{
    header("HTTP/1.1 403 Forbidden");
    exit();
}
else
{
    header("HTTP/1.1 200 OK");
    exit();
}
?> 

Then it will always go to "HTTP/1.1 403 Forbidden" which lead to Error #2038 in Flash, means that Flash loose session cookies during upload.

How to resolve it? We can’t wait for browsers add support for Flash. So we can get PHPSESSID first, then pass it to server side via GET/POST.

[……]

Read more