AIR's URL scheme

Today a guy in the FLEX group brought up AIR cache clearing, so I went wandering through the official docs again, and while I was at it I came across AIR’s URL schemes. Two of them I’d never used: app: and app-storage:. Here are the details: The standard URL schemes below are supported in any security sandbox in AIR: http: and https: — these two are of course web URLs. file: — this one is of course a local file URL. The schemes below are used by content running in the application security sandbox: app: Use this to specify a path relative to the top level of the application installation directory (that is, the application source directory) — the directory that contains the application descriptor file. For example, the one below points to the resources subdirectory under the application’s top-level directory: app:/resources

Flash

About RIA

Searching for the term “RIA” on Baidu Baike gives you http://baike.baidu.com/view/706341.htm, which says What is RIA? RIA (Rich Interface Applications), rich interface applications, commonly known as fat client. But the RIA I remember is Rich Internet Application — rich internet application. That difference startled me. When exactly did RIA pick up this other explanation, Rich Interface Applications?

Flash

Security error accessing url when httpService reads XML

When you use httpService in Flex to read XML from a different domain (such as http://xml.weather.yahoo.com/forecastrss), you get a Security error accessing url error. But in the debug folder (bin-debug by default) it reads just fine. This is really annoying — I’m sure plenty of people have been tripped up by this security issue. Why does it only work in the debug folder? It turns out the bin-debug folder works only because [系统盘]:Documents and Settings[用户名]Application DataMacromediaFlash Player#SecurityFlashPlayerTrustflexbuilder.cfg sets it as trusted automatically. At actual runtime, it’s blocked by security. In other words, what we need to do is solve the security-block problem. So how do we fix it?

Flash

AIR manages file associations

For file association management, the flash.desktop.NativeApplication class in AIR provides 4 methods: isSetAsDefaultApplication(extension:String):Boolean returns whether the current AIR application is the default way to open the specified file format. The extension parameter is a file extension string — you don’t write the “.”, for example “flv”. The extension for the next 3 is the same. setAsDefaultApplication(extension:String):void associates the current application with a certain file format. removeAsDefaultApplication(extension:String):void removes the association between an AIR application and a file. getDefaultApplication(extension:String):String reports the path of the application associated with a certain file. Returns a string of the application path.

Flash

Google Site is now open

Came across yet another new Google service — Google Site. This service is roughly the equivalent of a special-interest group site or a personal homepage service, letting you share your articles, photos, videos, schedules, life plans and so on with a group of people who share your interests. It lets you create and edit web pages online as easily as editing a document. You could treat it as just another personal homepage service, but I think it’s better suited as a platform for a club to share and communicate. Take this guy’s, for example: http://sites.google.com/a/googleuniversity.org/ski-club/Home He set up a ski club homepage on GSITE.

Other

A Detailed Guide to the AIR Application Descriptor File

The AIR application descriptor file is an XML file that sets the basic properties of an AIR application. When developing with FLEX, it lives at “project folder/src/main file name-app.xml”; when developing with Flash CS3 it is also generated automatically when you create an AIR project, and you can edit it visually through the menu Commands > AIR - Application and Installer Settings, or edit the XML document by hand. The application descriptor file contains the properties of the AIR application and affects the whole application — its name, version, copyright, and so on. In theory, the application descriptor file can use any file name. When we create an empty file with Flash CS3 and use the default settings, the descriptor file is automatically renamed application.xml and placed in a special directory of the AIR project.

Flash

National Day of Mourning, website black-and-white effect

These three days are a national mourning period. We mourn for our compatriots who lost their lives in the earthquake, and pray that they pull through this ordeal as soon as possible and rebuild the...

Web Frontend

Fanfou AIR client released (1.6+)

Online installation link Click to download Fanfou AIR Client 1.6 Download the latest AIR runtime Download the reference source code 6.26 UpdateMinimize to the system tray is now supported: clicking the minimize button no longer clutters the taskbar — the app minimizes to the system tray instead. Thanks for your support. Download links: Click to download Fanfou AIR Client 1.7 Download the latest AIR runtime

Flash / Works

AIR's HTTP Basic authentication

How do you communicate with a website that requires HTTP basic authentication when building AIR with Flex 3 or Flash CS3? Take 饭否http://fanfou.com/home — the username contains an @ sign, and if you go straight to http://“+loginName+”:”+loginPass+”@api.fanfou.com/statuses/update.xml, you get an ioErr. I asked about this on Blueidea once and I’m still waiting for a reply. I searched online too, but most of what I found talks about how to configure server-side authentication, not how a client logs in… Someone asked about the login approach in C# and Java, but no answer there either. The only usable information was for VB and JS — with Ajax it’s easy, since the XML open method takes user and password parameters. Last year I scanned through the Flex code line by line and found that URLRequest has a setLoginCredentials method. Add the line urlR.setLoginCredentials(loginName,loginPass); and it will send the user credentials. Now that the new version of AIR has been released, that method is deprecated again. Since I never had the time to update the Fanfou AIR client I wrote last year, I didn’t pay much attention to it. Today I went to the official site and dug into it. The replacement:

Flash

Google Kingsoft PowerWord!

(Late May update: Firefox screen word capture is now supported!) On May 8, Kingsoft and Google, the world’s largest search engine company, jointly held a press conference at the Avic Hotel in Beijing to announce the official release of their co-branded product, Google PowerWord. http://cp.iciba.com/news/2008/05/08/120894.shtml Downloads are already available online. http://download.iciba.com/pwl/powerwordlite.25269.3008.exe PowerWord’s size has shrunk from over 300 MB to just over 20 MB! This makes downloads easier for users while saving disk space. PowerWord users will also get timely access to a rich vocabulary sourced from the internet. Google PowerWord has three major features: Free Internet-based Innovative machine translation technology

Other

oEmbed: An open format for embedding media

oEmbed is a brand-new spec, announced by Cal Henderson (Flickr), Mike Malone, Leah Culver (Pownce), and Richard Crowley (OpenDNS). oEmbed is an open format for standardizing how images, videos, links, or other media get embedded, and for sidestepping media providers’ APIs (or the screen scraping you’d need when they don’t have one). When a user posts a link that points straight at a specific media resource, it lets a site embed that media quickly and painlessly. Here’s how it works: it converts the link accordingly — that is, it turns the image or video into XML or JSON that tells you how to embed the media.

Web Frontend

The ASP file clearly exists, yet it shows a 404 error—can IIS not display ASP?

Ran into this weird problem today — guess I’ve been living under a rock… ASP files wouldn’t load… showing a 404 error, but non-ASP files like logo.jpg opened just fine. Any file that was .asp gave ...

Backend Server

Flash File Format Description

SWF File Header Field Type Comment Signature 8 bits Signature byte: F indicates uncompressed C indicates compressed (specific to SWF6 and later) Signature 8 bits Represents W Signature 8 bits Represents S Version 8 bits Represents the SWF file version, e.g. 0x06 represents SWF6 File Length 32 bits The total number of bytes occupied by the entire file Frame Size RECT structure The size of the SWF stage, in units of 1 twip (1/20 pixel) Frame Rate 16 bits Frame Count 16 bits The total number of frames in the movie The file header begins with three signature bytes, which are either 0x46, 0x57, 0x53 (“FWS”) or 0x46, 0x57, 0x43 (“CWS”). An FWS signature indicates that the file is uncompressed. A CWS signature indicates that the entire file, after the first eight bytes — that is, after the file length field — is compressed using the open standard ZLIB. It uses the ZLIB library data format, which is described in the Request for Comments (RFCs) 1950 through 1952 documents. CWS is only permitted in SWF6 and later. The byte following the signature is the version number. This version number is not an ASCII character, but an 8-bit number. For example, the version number of an SWF4 file is 0x04, not the ASCII character “4” (0x35).

Flash

TypeError: Error #1009: Cannot access a property or method of a null object reference when loading a movie in AS3

A problem I ran into today: I have an swf file that I need to load into a main file, but I kept hitting the following issue: after calling loadSwf(“xxxx.swf”), it throws TypeError: Error #1009: Cannot access a property or method of a null object reference. The loading code looks like this: private function loadMainSwf(url):void { var urlR:URLRequest=new URLRequest(url); containtLoader.unload(); containtLoader.load(urlR); containtLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,loadHandler); containtLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompHandler); } private function loadHandler(e:ProgressEvent):void { gLoad=e.target.bytesLoaded; gAll=e.target.bytesTotal; per=Math.floor(gLoad / gAll * 100); percent=per + “%”; perString.text=percent; } private function loadCompHandler(e:Event):void { containtLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,loadHandler); containtLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,loadCompHandler); addChild(containtLoader); }

Flash

Causes of Error#2037 in AS3

The day before yesterday I ran into this error: Error: Error #2037: Function call sequence is incorrect, or a previous call was unsuccessful. at flash.media::Sound/_load() at flash.media::Soun...

Flash
1…25262728