Bug #1886742

Bug #1886742. This bug had been giving me nightmares for the past few months. But finally, a happy ending. :) Get the new and shiny AIR 1.5.2 here.

What’s next ?

I don’t know if blogging is dead, or is it just evolving. Welcome to my LifeStream!

4096

4096. What does this number got to do with SWFs ? I’ve been working on a project which involved having to embed a pretty large SWF on a HTML page. How large ? Well.. Little above 6400 pixels in height actually. If you are wondering what ridiculous experiment this might be, i’ll be posting more about it very soon. Ok..Getting back to our topic of 4096, when i tried to embed that over sized swf on a page, i couldn’t see any content below a certain height. This height, with much difficulty, i found to be 4096 pixels. The contents present inside the SWF were of 6000+ px height, however just after 4096px all i could see was whiteness. Yes. Solid white. No problem with embedding, since i tried both SWFObject and also Adobe’s embed code.  What is this mysterious white fill ? Can’t you embed a swf larger that 4096px, eventhough containers inside Flash/Flex can be resized to really huge sizes ? A bit of a childish limitation i think.

Adobe AIR and Multi-touch

Last month we saw a post on Adobe’s INSPIRE magazine regarding the future of multi-touch input.

Programmatically Enable/Disable AIR Autoupdate from an AIR Application

Adobe AIR has an amazing Automatic Updates Checker built in.  But Adobe hasn’t provided any controls to enable/disable this feature, though its enabled by default. Adobe provides an AIR application called the Settings Manager to handle this. This can also be done programmatically.

Download [download id="1"].


<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
 layout="horizontal" height="100" width="600"
 verticalAlign="middle" fontFamily="Georgia" color="#000000"
 backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #FFFFFF]"
 showStatusBar="false" horizontalScrollPolicy="off" verticalScrollPolicy="off" viewSourceURL="srcview/index.html">

 <mx:creationComplete>
 <![CDATA[

 if (Capabilities.os.indexOf("Windows") > -1 || Capabilities.os.indexOf("Linux") > -1) {
 f = new File(File.applicationStorageDirectory.nativePath + "/../../Adobe/AIR");
 } else if (Capabilities.os.indexOf("Mac") > -1) {
 f = new File(File.applicationStorageDirectory.nativePath + "/../../../Application Support/Adobe/AIR");
 } else {
 this.removeChild(btn);
 status_txt.text = "Can't do it [:(] Unsupported OS or something...";
 }

 if (f != null)
 {
 f = f.resolvePath("updateDisabled");
 if(f.exists) {
 //Auto updates is disabled
 btn.label = "OFF";
 } else {
 //Auto updates is enabled
 btn.label = "ON";
 btn.selected = true;
 }

 }
 ]]>
 </mx:creationComplete>

 <mx:Script>
 <![CDATA[
 import mx.controls.Alert;

 private var f:File;

 private function enableDisableAutoUpdater( enable:Boolean ):void {
 if(enable) { //Enable Auto updates
 if (f!= null) {
 //f = f.resolvePath("updateDisabled");
 if (f.exists) { //If the updateDisabled file exists
 try    {
 f.deleteFile(); // Delete it
 } catch (error:Error) {
 Alert.show("Something went wrong!");
 }
 }
 }
 btn.label = "ON";
 } else {
 if (f !== null)    {
 //f = f.resolvePath("updateDisabled");
 if (!f.exists) { //If the updateDisabled file doesn't exist
 try    {
 var fileStream:FileStream = new FileStream();
 fileStream.open(f, FileMode.WRITE); //Create it
 fileStream.close();
 } catch (error:Error) {
 Alert.show("Something went wrong!");
 }
 }
 }
 btn.label = "OFF";
 }
 }

 ]]>
 </mx:Script>

 <mx:Text id="status_txt" text="Adobe AIR - Automatic updates is" fontSize="24"/>

 <mx:Button id="btn" label="ON" toggle="true"
 click="{enableDisableAutoUpdater(event.currentTarget.selected);}" fontSize="24" width="80"/>

</mx:WindowedApplication>

Creative Commons License