Advanced Flash Developers needed

The market of today needs more Advanced Flash Developers. Very recently I had witnessed two unpalatable cases where two companies have shifted to another technology just because there are not good Advanced Flash Developers ready to take on such projects, work. Well, there are not enough Flash Developers at all. The companies then just dump Flash and went in for other alternatives. They are the typical RIA that we termed it and I was unable to provide them any developers capable of doing the same. Many of my friends who are fanstastic developers are already filled up to the brim with projects. We had recently laugh at the idea if we could be given an additional 12 hrs to the normal 24 we have.

Continue reading

Magic Framerate

A few Flash Designers and developers alike have asked me or rather challenged me why I use a 31 fps in almost all my SWF documents. Let me archived this on my site so that I can refer to it future, just in case. And thanks to the person who once did an explanation on the same (sorry that I have forgotten who it was).

So this “Magic Framerate“, the fps of some odd number like 21, 31 and why people have choosen that. Frame rates are stored in 16.16 fixed pointer integer. Add to this, the framerate is converted to a millisecond frame delay value. Thus, the overall accuracy of framerates becomes ridiculously low, unless one uses the streaming sound hack aka the kicker layer (for instance 24 frames/sec); converts to a frame time of 41ms which factually converts back to real frame rate of 24.39 frames/sec. And the fact that frame times are handled relative instead of absolute, this eventually leads to a realy screwed up frame rates.

It is heard that timers were quite inaccurate in previous MacOS releases. There is another issue, the maximum time resolution (DoPlay call frequency) on MacOS browsers is currently between 20 and 40ms. With video, the maximum framerate one can achieve is currently around 27 frames/sec. IE WIN has a time resolution of 10ms, hence we can achieve maximum frame rate of around 100frames/sec. There a few framerates which will show a more consistent behavior on MacOS and Windows, those are the famous 21 and 31, the magic framerates.


Caesars Box

Here is the ActionScript code to break the code

function decodeCaesarsBox (sCode, sDelim, sDict) {
 var a = sCode.split (sDelim);
 var sBox = " ";
 var a2 = new Array ();
 var n = a.length;
 var iRoot = Math.sqrt (n);
 if (iRoot == Math.floor (iRoot)) {
  for (var i = 0; i < n; ++i) {
   sChar = sDict.charAt (Number (a [i])-1);
   sBox += sChar + "\t";
   if ((i+1)%iRoot == 0) {
    sBox += "\r ";           
    a2.push (sChar);
 trace ("> Caesar's Box");
 trace (sBox);
 var a3 = new Array ();
 i = 0;
 var j = 0;
 while (a3.length != a2.length) {
  a3.push (a2 [i]);
  i += iRoot;           
  if (i >= a2.length) {
   i = ++j;
 trace ("> In Straight line");
 trace (a3.join (""));
 } else {
  trace ("Error, Caesar's box only works on perfect squares");

ID property of the Image tag

The img tag allow you to embed external non-progressive jpeg files and other swf files inside a dynamic or an input text field. There is an attribute called id which is supported by this tag so that you can embed an instance of your movie clip from your library and thus control it using Actionscript.

Preview | Download

Actionscript 2 publishing to Flash player 6

First, let me thank Mike Chambers, Peter Hall and Darshan for their help in getting me along on this topic. I will update this further in future when more things are discovered doing something along the way. You can also read something in the similar line at Jesse Warden‘s blog entry “Shared Libraries only work within same version SWF

Actionscript 2 can be published to all versions of Flash Player 6. The main differences in AS2/FP6 and AS2/FP7 are

1. In FP6, when class A extends B, the constructor for B will get executed in a “dummy” fashion. This is because

A.prototype = new B();

is emitted to set up the inheritance chain. This behavior was fixed in FP7 by adding the sactionExtends bytecode, which the compiler now takes advantage of when publishing to FP7.

2. In FP6, casting between strong types will not fail and return null if the types are unrelated.

var a:ClassA; var b:ClassB; a = ClassA(b);

In FP7, if the classes are unrelated, you will properly get null. This is because the sactionCastOp bytecode is not supported in FP6.

3. In FP6, casting between interfaces doesn’t work properly. This is because the sactionImplements bytecode is not supported in FP6.

Everything will also be case-insensitive in FP6, so you have to watch out for that too. Also, if you publish as vanilla FP6, it will be significantly slower than FP6 r65 or FP7. All of the V2 UI components were published to FP6 r65. And someone suggested me never to do casting if you are publishing to F6.

SCORM, what is, what isn’t, Flash and scorm and SCORM FAQ

As a follow-up to my previous post, I was lucky the other day on Flash Lounge on a questions which was not really related but somehow landed on the topic of SCORM. And so, here are more details about the same. Thanks a lot to Aaron E. Silvers., Senior Multimedia Integrator of ADL, Advanced Distributed Learning.

What is SCORM?

SCORM stands for Sharable Content Object Reference Model – SCORM is a set of specifications created by the Advanced Distributed Learning initiative (ADL). SCORM specifies how content can be built and reused across any Learning Management System (LMS), and how LMSs can be constructed to use any Sharable Content Object (SCO).

SCORM speaks to the following “ilities” :

Accessibility : From multiple remote locations through the use of metadata and packaging standardization, and using (but not restricted to) web standards.
Adaptability : By tailoring instruction to individual and/or organizational needs.
Affordability : Developing and aggregating learning content in modular ways to promote learning efficiency, productivity and reuse while reducing development time and costs.
Durability : Across revisions of operating systems and software.
Interoperability : Across multiple tools and platforms.
Reusability : Through the design, management and distribution of tools and learning content across multiple applications.

What isn’t SCORM?

A programming language,
A standard that must be adhered to or complied with,
A design pattern (though through conformance to SCORM, some patterns become clear – like abstraction.

What’s the impact of SCORM conformance on a front-end developer in HTML

You need JavaScript to be able to handle communication between the SCO and SCORM’s API (the communication between learner and LMS via interaction with the SCO). Otherwise, there’s only seven different requests that a SCO can make of an LMS. The only two commands that each piece of content MUST make in order to be a SCO are an Initialize (let the LMS know that the SCO is launched) and a Terminate (let the LMS know that the SCO is no longer in use). Everything else is gravy. So from a front-end developer’s perspective; if you can call the API with JavaScript, you’re set to go.

What’s the impact of SCORM conformance on a Flash / ActionScript developer

Actually, working with Flash and SCORM is pretty easy, because Flash is so flexible. There’s only about 200 ways to skin a cat in Flash, and so it is with SCORM. Many developers rely on FSCommand to communicate with JavaScript, but this method is believe to besloppy, hackneyed, lazy, old practice. Sure, it works but it doesn’t work on everything. GetURL will be your friend. That and and setInterval(), clearInterval(). Using those will enable you to communicate back and forth with JavaScript as it speaks to the LMS.

Perspective of a Personalized SCORM-related FAQ

Q. What specific guidelines and/or best practices do I need to follow as a content developer in order to make sure the Flash & Dreamweaver content is comformant?
A. There are two main practices you’ll follow to make sure your content is conformant. You’ll run it in the 1.3 Run-Time Environment (due to be released as Beta very soon), and if your package loads and runs, well, it works!

In February or March 2004, there the likelyhood of the release of the “SCORM 1.3 test suite”. The diagnostics it returns when you test your content will let you know specifically where each piece of content may fail.

If you can get your content to pass the Test Suite, you’ll be right as rain. Those are the only two benchmarks available to us since there’s no LMS available that handles 1.3, and it will probably be a while until they come around.

Q. Which tools do you use?
A. Use Flash MX 2004 and Dreamweaver MX 2004. You can use other tools available in the market for the same.

Now as far as the technologies that are employable,
XHTML 1.0 strict, CSS2, ActionScript, JavaScript, PHP, MySQL, XML and a little bit of ColdFusion if needed (including CFC’s if you are doing remoting with Flash).

As well, there’s an extension for Dreamweaver MX by DigitalThink (available on Macromedia Exchange) that does a really good job of making 1.2 conformant content, or editing your content to automagically convert to 1.2. A good guess would be that they will support 1.3, even if the sequencing is very simple.

Q. As a developer, what pieces do I really need to know about SCORM?
A. Here are some unsorted tips to follow when creating content:

  1. Avoid using FSCommand() to communicate with JavaScript (in Flash) : Most of the tools already available to Flash for SCORM development rely heavily on FSCommand(). FSCommand() only will work effectively in a Windows environment. So, in the future, if your content is viewed on anything other than Windows, the communication will probably fail. Instead, move your reliance to getURL() to call on your JavaScript functions. Well, this are still personal preferences, you are free to experiment on your own. It is preferable to develop once, and at the same time develop for everything. Switching to getURL() means that your content will interact appropriately in Windows, Linux, Mac – on Internet Explorer, Netscape, Mozilla, Opera – whatever browser is being utilized by the LMS.
  2. Abstract your API wrapper to course-specific functions : If you call on the functions in the API wrapper specifically in all your development, you’re setting yourself up for disaster. The naming conventions have changed in every version of SCORM and it’s likely that it’s going to continue to evolve. Create a separate javascript file that has function names that simply call on the functions in the API wrapper. Call on THOSE functions instead of directly calling on the functions in the API wrapper. That way, even if the function names change in later versions of SCORM, you’re changing only one file instead of digging into every single HTML page and Flash file, copying and pasting all the way through. Save myself the hassle of doing that by abstracting as much as possible.
  3. Utilize XHTML and CSS2 to maximize accessibility and skin-ability : If you’re using XHTML in combination with CSS2, you’re going to make it easy to deploy your content to multiple platforms. Not just different OS’s, either – cell phones, PDA’s – just about any web-enabled device will benefit from the organization you adhere to if you’re conforming to W3C standards. If you use CSS2 style sheets, you can set multiple layout files with the same class names to “skin” your content. In this manner, you can meta-data the CSS style sheet. By abstracting style from the content, you’ll also be able to apply different styles for different deployments. When you author XHTML with <div> tags, you’re dividing up your content in a logical manner. In the absence of the CSS (like on a web-enabled device or a phone), the content still lays out logically. You can’t do that if you’re using <table> tags. The obvious advantage to using these technologies is that your 95% of the way to being 508-compliant in doing so (the other 5% being testing – because a good developer wants to be “sure” that a screen reader can actually read/interact with content appropriately).
  4. Get in on the planning stages for content development early : You have to be really proactive at the
    planning stages of Instructional Development. Don’t wait until the ID’s have a curriculum in-place that they want to develop, telling you what technologies they want available. Determine their real priorities – is it
    the user experience they want or the curriculum plan? Is the SCORM conformance a priority for content object re-use, or is it so it will be compatible with any LMS? These decisions all have impact on how your SCO’s
    will be defined, which will have a huge impact on how you’re going to develop a project.
    For example, if you’re building one large Flash piece that’s going to set objectives and display tons of content – sort of acting as its own LMS, then re-use of individual pieces of content can’t be a priority. You can still tag all those pieces of content as assets, but not SCOs (a SCO can’t launch a SCO). In this example, the large Flash “player” would be the one SCO in this package, with each piece of “content” that it would display being simply an asset. You can launch assets as part of an aggregation – even on their own, and thus re-use assets, but they’re not SCOs.
  5. The ease of SCORM development is in the front-end : Remember that all you need to make a SCO a SCO is an Initialize() and a Terminate(). Everything else is gravy. In total, there are only 7 calls (there is a getValue() and a setValue() and then about 3 diagnostic calls) to the LMS. That’s it. So developing for SCORM is pretty easy when you think about it, because each SCO is dumb. By that it simply means that each SCO is independent of any other SCO, so you don’t have to know what’s going on with other SCOs in order to build one. The LMS handles all that information.
  6. The pain of SCORM development is in the organization of the entire course, and by definition, the manifest : The manifest controls the sequencing, the interactions, the listing of assets – all the magic happens in the manifest.
    A reiteration of what we doubtlessly know : it’s all XML. Which means if you can outline or map your course, even at a high level that just outlines the page titles, you can design your course how you want and assume that you’ll be able to find help by the way of direct help (through some means of support) or indirect help (by assuming tools will come to assist you in sequencing).
  7. METADATA – but be smart about it : Developing MetaData is important. Really important. Forget that SCORM doesn’t require it. The fact of the matter is that you’ll want to reuse the stuff you build, eventually. It’s a heck of a lot easier to build MetaData as you’re developing than it is to go back in years from now to try and tag a SCO.

But, it is also suggested to keep in mind that you’re not going to re-use every single little thing you list as an asset. So restrict your metadata work to those things you’ll likely re-use.

Your SCOs. It makes sense to author MetaData for each SCO, because it increases the likelihood of their re-use. And as each SCO is (supposedly) the smallest chunk of content you have on any specific topic, it’s just common sense that any chunk of content may apply to something else later on, in another aggregation.

Your assets. Does every single JPEG, GIF and SWF need to be MetaData’d? Probably not. Use your time wisely. If you find that you’re using the same graphic more than once in a package, you should probably include MetaData for it. The thumb rule logic would be that if “YOU” are using it more than once, chances are a few years from now, someone else would, too, if they can find it.

Actionscript Viewer 4.0 : Review

Actionscript Viewer 4.0

Well, the weekend seems to be a good time to look at new softwares; this time I got ActionScript Viewer 4.0 and the first thing that came to my mind is “Wow! every teenagers dream is here”. Had James Bond been a Flash Developer, he would have been presented ASV 4.0 by “G” long back. On first looking into it, I could see that it had totally stripped the well dressed SWFs naked; I could see everything, the audio files, the bitmaps and more importantly the Actionscript.

The Timeline, Frame, Library, Instance Names, Actionscript, Special Tags are helpful enough to show you how a SWF was constructed and what do they contain. AS2 Mode for Actionscript is another cool feature to view SWF 7 files, just click on the “ActionScript” section and view each and every script for all frames, symbols. The Classes used can be seen, just copy them and study them yourself; you can see how other developers script and learn from them. You can also use the File > Save SWF data as Text … and have all scripts in a single text file complete with the location of the scripts on the frame of the individual MovieClips etcetera.

ActionScript Viewer is a SWF decompiler and resource extractor that lets you view ActionScript embedded in Flash movie files, extract resources and browse the internals of SWF files. ASV is at its fourth incarnation at the time of writing this review. The current version of ASV supports ActionScript in Flash 7 published files and below. The ActionScript are decompiled and converted to text format, which you can then view on screen and are easy to understand, copied and pasted.

ASV have an easy to use interface which displays lists of frame labels, instance names, library symbols; provides a timeline view with context sensitive preview with many options. “ASV can extract most of the resources from SWF files and displays all the necessary information to help you reconstruct a FLA file you have lost. ASV even tries to help reconstructing a FLA file by generating a JSFL command file for Flash MX 2004 to rebuild the FLA“.

JSFL for Rebuild-Data Extraction : One of the cool and striking feature I noticed was that of ASV’s ability to generate a FLA file using JSFL. ASV extracts and saves resources, a readme file and a JSFL command to a folder of your choice, with the intention of helping the reconstruction of the FLA file for the current SWF. Though there are limitations to this, this feature should be able to help you to get a head start for rebuilding many SWF files and can even rebuild some SWF files without any problems. The FLA file for the SWF may not be rebuilt 100% accurately, depending on the content of the SWF file.

ASV works better with Actionscripts in the SWF file have been compiled by Macromedia Flash 3/4/5/MX/MX2004/MX professional 2004, it learnt from reliable sources that it does not always gives a reliable output when Actioncript at Obfuscated by other tools.

Context Menu and the forbidden word

Well, I have been out of my development table and in another city so I had unsubscribed myself out of all mailing list but then I was tempted to go to the flashcoders list at and saw all the talks about the new public beta flash player 7,0,0,249 and saw many things, including a good listing of the features. Besides many others, Context Menu is one good addition that Flash 7 has bestowed us.

Continue reading