Old SWF versions vs old Flash Players

A SWF Version isn’t the same as a Flash Player Version.
The distinction is important when targetting older Flash Players, especially those installed on very old Out of Home Screens.

Here’s a cheat sheet:


     SWF   |        Flash           |  AIR 
------------+-------------------+---------------
        9       |        9.0.115.0    |      N/A
       10      |        10.0, 10.1   |      1.5, 2.0
       11      |        10.2            |      2.6
       12      |        10.3            |      2.7
       13      |        11.0            |      3
       14      |        11.1            |      3.1
       15      |        11.2            |      3.2
       16      |        11.3            |      3.3
       17      |        11.4            |      3.4
       18      |        11.5            |      3.5
       19      |        11.6            |      3.6
       20      |        11.7            |      3.7
       21      |        11.8            |      3.8
       22      |        11.9            |      3.9
       23      |        12              |      4
       24      |        13              |      13
       25      |        14              |      14
       26      |        15              |      15
       27      |        16              |      16
       28      |        17              |      17
       29      |        18              |      18
       30      |        19              |      19
       31      |        20              |      20
       32      |        21              |      21
       33      |        22              |      22
       34      |        23              |      23
       35      |        24              |      24
       36      |        25              |      25
       37      |        26              |      26
       38      |        27              |      27
       39      |        28              |      28
       40      |        29              |      29
       41      |        30              |      30
       42      |        31              |      31

Seeing through transparent video

It’s been eleven years since Steve Jobs revolutionised our back-pockets with the iPhone and dealt Flash what many thought would be a mortal blow. So why is it Flash refuses to die? The recent update of the same in-all-but-name Adobe Animate was incredible.

In banishing the humble SWF to the wilderness I Steve broke something more fundamental, progress. With all, it’s faults Flash tried new things, and challenged conventions. The conservative development community chose standards over tearing up the rule-book and in doing so may have stifled creative expression.

I recently did a project for coca-cola, which required a dynamic flip clock to count-down to Christmas, but it involved an intricate transition involving Christmas wrapping paper tearing across the screen to reveal the dynamic element underneath. To complicate this still further, the whole scene was full of falling snow. As is often the case with Out of Home, so much of what we do is constrained by very archaic bandwidth considerations. So the only way to easily accomplish this kind of execution was to resurrect the trusty transparent FLV and create a multi-layered application using transparent video. I had to download an old version of Adobe Media Encoder CS6 because that was the last app in which Adobe included support for FLV. In the end, the project went off without a hitch although I’m still not sure how I might have accomplished this so easily in HTML.

If anyone out there has any tips on how I might layer-up transparent video, over a dynamic clock element in HTML5 I’d like to hear your thoughts.


Exporting to Flash Player 10.2 from Flash Pro CC2014

As Flash has evolved over the years Adobe has continually jettisoned legacy technology. ActionScript 1 and 2, the bandwidth profiler, even projectors fell by the wayside (in CC at least). Sometimes these features re-surface in new releases, like the motion editor for example, but it seems that once the ability to target a specific Flash Player version is dropped, it remains dropped. In Flash Pro CC2014 the oldest targetable Flash Player is version 10.3.
Sadly, this has been causing me some headaches. There are still some advertising platforms out there which specifically reject anything more recent than Flash Player 10.2. This is a problem because the last time Flash supported this player was way back in Flash Professional CS5.5.

Finally, I decided enough was enough and resolved to solve this problem once and for all. Here’s how I did in.

Firstly download the playerglobal10_2.swc from Adobe’s archive
http://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html#playerglobal

Rename it playerglobal.swc

Go to “Applications/Adobe Flash CC 2014.app”

Right-click the Adobe Flash CC 2014 application and select “Show package contents.”

Go to this folder:

/Applications/Adobe Flash CC 2014/Adobe Flash CC 2014.app/Contents/Common/Configuration/Players/ActionScript 3.0

Duplicate the directory FP10.3 and rename it FP10.2

Replace playerglobal.swc with the version you just downloaded. Remember to change the name from playerglobal10_2.swc to playerglobal.swc

Next you duplicate /Applications/Adobe Flash CC 2014/Adobe Flash CC 2014.app/Contents/Common/Configuration/Players/FlashPlayer10_3.xml and rename it FlashPlayer10_2.xml

Open FlashPlayer10_2.xml in a text editor delete everything and replace with the following:

<?xml version="1.0" encoding="UTF-8"?>
<players>
  <player id="FlashPlayer10.2" version="11" asversion="3">
   <name>Flash Player 10.2</name>
        <path builtin="true" />
        <path platform="WIN">Device Central/adcdl.exe</path>
        <path platform="MAC">Device Central/adcdl</path>
        <playerDefinitionPath as2="$(UserConfig)/Classes/FP10;$(UserConfig)/Classes/FP9;$(UserConfig)/Classes/FP8;$(UserConfig)/Classes/FP7" as3="$(AppConfig)/ActionScript 3.0/FP10.2/playerglobal.swc" />
        <feature name="multiScreenPublish" supported="true" />
        <feature name="mobileAuthoringIntegration" supported="true" />
        <feature name="deviceSound" supported="false" />
        <feature name="exportStreamingSound" supported="true" />
        <feature name="exportEventSound" supported="true" />
        <feature name="FSCommand2" supported="false" />
        <feature name="gradient_linearRGB" supported="true" />
        <feature name="gradient_overflow" supported="true" />
        <feature name="shape_strokeHint" supported="true" />
        <feature name="shape_cap" supported="true" />
        <feature name="shape_join" supported="true" />
        <feature name="shape_mitre" supported="true" />
        <feature name="shape_scale" supported="true" />
        <feature name="linkage_exportForActionscript" supported="true" />
        <feature name="linkage_exportForRuntimeSharing" supported="true" />
        <feature name="linkage_exportInFirstFrame" supported="true" />
        <feature name="linkage_importForRuntimeSharing" supported="true" />
        <feature name="linkage_importAndAddToCache" supported="false" />
        <feature name="publish_localPlaybackSecurity" supported="true" />
        <feature name="publish_hardwareAcceleration" supported="true" />
        <feature name="symbol_blendMode" supported="true" />
        <feature name="actionScript_documentClass" supported="true" />
        <feature name="symbol_blendMode" supported="true" />
        <feature name="filters" supported="true" />
        <feature name="component_binding" supported="true" />
        <feature name="component_schema" supported="true" />
        <feature name="screens" supported="true" />
        <feature name="video" supported="true" />
        <feature name="deviceVideo" supported="false" />
        <feature name="accessibility" supported="true" />
        <feature name="dynamic_text_kerning" supported="true" />
        <feature name="static_text_charwidth_nondeviceFont" supported="true" />
        <feature name="static_text_charwidth_deviceFont" supported="true" />
        <feature name="advanced_anti_alias_text" supported="true" />
        <feature name="nine_slice_scaling" supported="true" />
        <feature name="runtimeNumberMinMax" supported="true" />
        <feature name="use8kSampleRate" supported="true" />
        <feature name="useDefineFont4ForDeviceText" supported="true" />
        <feature name="useDefineFont4ForEmbeddedFonts" supported="true" />
        <feature name="textLayoutFramework" supported="true" />
        <encodingPresets>
            <preset uuid="da5cac1a-417a-4d86-b7f7-ef21010a5d7d" name="FLV - Match Source Attributes (High Quality)" ext="flv" default="true" />
        </encodingPresets>
        <testmenu>
            <menu name="ID_testInFlash" default="true" />
            <menu name="ID_testInDeviceCentral" />
        </testmenu>
        <debugmenu>
            <menu name="ID_debugtInFlash" default="true" />
            <menu name="ID_debugInDeviceCentral" />
        </debugmenu>
    </player>
</players>

Now relaunch Flash Pro CC 2014 and behold Flash10.2 has been added to the targetable Flash Player list.

Target Flash Player 10.2 in Flash Professional CC 2014

Finally, if you want, you can delete Flash CS5.5 from your system (unless you want to run the Gaia Flash Framework for Flash – in which case your stuck with CS5.5 for a while longer.)

Flash on the iPhone

There may be times when it is essential that a Flash animation is available to users on Apple devices such as the iPhone and the iPad. Here is a technique that addresses this requirement using Google’s rather wonderful open source project Swiffy.

Firstly, your Flash movie should be no larger than 1MB and ideally exported for Flash Player 5 although Swiffy supports most of the AS2 specification. For those of you who don’t remember, you can do a great deal with Flash 5 and AS2. Probably a great deal more than Safari on the iPhone will allow us to do.

Under the hood, Swiffy processes the SWF file and generates a JSON file. A client-side JavaScript runtime loads that JSON file and renders it using HTML, SVG and CSS which is supported by Webkit-based browsers such as Safari running on Apple devices.

When you process your swf, Swiffy outputs an html page that you can place on your page using an iFrame. I know, I know an iFrame! However we’re only using our iFrame to serve alternative content to less than 5% of our visitors. There’s nothing for Google to index so it makes very little difference to the end user. I’ve added an alternative version to the header of this page, making the animation, podman cursor follower and all, viewable to iPhone users, for what it’s worth. It’s pretty clunky, probably only making 8 frames a second on my iPhone, but it’s a pretty complex multilayered animation, with lots of bitmaps and transparency. While the animation in the header of this page may not have been designed for WebKit, it could probably be optimised quite easily. A little trial and error goes a long way. Maybe I’ll follow this article up with a sequel.

My Flash strokes look blurry.

This is a tip that I’m sure most people who’ve used Flash will appreciate.  Try drawing a few strokes on the stage – all a pixel thick. They may look fine and dandy in the Flash IDE but try exporting the swf and prepare to be shocked. There’s a fair chance that one, some or all of your lines look blurred and fuzzy. How annoying!

Well here’s a few things you can try to ensure that your strokes remain crisp and perfect, just the way you intended.

First, check the X and Y co-ordinates of your strokes and round them up or down to a round number.

If things don’t improve go into your stroke width setting and change the number from 1 to 0.9

If thing’s still don’t improve try reducing the width of your stroke incrementally from 0.9 to 0.8, 0.7 etc.

It worked for me:

I swear that this is a genuine screen grab of the offending lines – before and after.

Good luck!

Glow filter clipping on text.

Ever noticed that a line of text in a movie clip gets clipped by about 3 pixels at the end of the line? Rather an annoying bug, I tried everything, rounding the positioning up to exact pixels, adjusting the glow, checking tweens but nothing worked. I finally solved the problem by changing the font display quality to ‘animation’ instead of ‘readability’ worked fine!

Anti-alias when scaling images and video in Flash

Here’s one of those tips that you stumble upon, and feel embarrassed that you didn’t know this years ago.

Notice when scaling a bitmap or video up and down the image is subject to serious aliasing. Especially with a transparent background. Everything looks pixelated and choppy. Right?

Here’s the solution. In the properties of your image in the Flash library you will see the following setting.

Smoothing

Note that “Allow smoothing” is checked. This allows Flash to re-sample the image when it is scaled up or down, naturally there is some quality  loss but essentially it solves your problem. Used sparingly it may help with your bitmap manipulation.

What about video? No problem. The same principle applies, but you have to use ActionScript.

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);

myVideo.attachVideo(ns);
ns.setBufferTime(0);
ns.play(“mymovie.flv”);
myVideo.smoothing=true;

The last line is the killer!

Seamless Flash audio loops.

Here’s a tricky little issue that I’m sure a few of you Flashers have come across on your travels.

Problem: You have an audio loop, like a clock ticking. You produce a perfect loop in your sound editor of choice and export it out as an MP3. You then import the sound onto your timeline in Flash and no matter what you do, you can’t get it to loop properly. It’s as if Flash has somehow added a fraction of a second of silence to the start and end of the sound clip, making it impossible to loop seamlessly.

Solution: Export a wave file instead of an MP3 – Not sure why, but MP3s behave differently to wave files in Flash. Wave files loop perfectly. Don’t worry about compression because there’s an MP3 compression option inside Flash anyway, so you still get the compression benefits that the MP3 format has to offer without the loop problems. Loop perfection!

Masks in Flash

Ever tried to animate the masking of multiple areas of an image and found that everything goes wrong?

Well here’s a simple tip.

Flash hates a mask that’s in pieces. Sometimes it’s fine but sometimes it messes up, for example if you have an animation of eyes blinking, using masks to hide / show the pupils, either use one mask that is connected out of the area of interest or two separate masks for each eye.

Note: Beware of strokes or the remains of partially deleted strokes in masks. Select the entire mask frame and switch of all strokes from the selected vectors to ensure that those pesky bits of corners or minuscule remnants don’t get in the way of your masking genius!

Default Publish Settings – SwfObject

It’s been bugging me for a while that I can export HTML with the AC_RunActiveContent.js embedding method directly from Flash CS3. I can replace the RunActiveContent HTML with a SwfObject Template but I can’t get the Flash IDE to export a copy of the swfObject.js file.

Here’s the solution.

Navigate to:

Library>Application Support>Abode>CS3>en>configuration>HTML>Active Content Files
Backup AC_RunActiveContent.js by renaming it or moving it somewhere else. Paste in a copy of the latest swfobject.js and rename it AC_RunActiveContent.js.

Annoying that it has to be called something else, so I add the following comment after the tag:

//re-named swfObject default export

I’d love to find out how I can use swfObject without having to rename it first.