Daelgren

Flash Development Snips

More Apple investigations

HTML Canvas is Apples proposed replacement to Flash / Silverlight. Interesting.

http://www.8bitrocket.com/newsdisplay.aspx?newspage=36134

More Flash hater points of interest:

http://www.flashmagazine.com/community/detail/everyone_to_their_bases_-_flash_is_under_attack/

Why Microsoft will NEVER support the HTML 5 video and audio tag as they are currently defined (one word — PATENTS):

http://www.internetnews.com/dev-news/article.php/3828901

Some more details about HTML 5

http://www.webmonkey.com/blog/W3C_Drops_Audio_and_Video_Codec_Requirements_From_HTML_5

A quote that concerns me the most:

“Now that the web has been elevated to a more powerful computing platform by HTML5, Berners-Lee says it has also given rise to complicated security issues.

“You got a piece of code from site A, and you’re person B running a browser you got from company C, and that code wants to access data stored with company E for the purposes of printing it on a printer owned by company D — How do you build that so that it’s not susceptible to all kinds of nasty attacks?” 

http://www.webmonkey.com/blog/Tim_Berners-Lee_Sees_Promise__Challenges_in_HTML5

At least Adobe would release new versions of the Flash player when security issues were identified in record time — explain to me how the HTML 5 spec will change to adapt to issues of security if it’s taken them 6 years so far and they still can’t solidify the spec.

Apple hates Flash?

In all the hub-bub about the iPad (needlessly btw — it’s a hobbled consumer toy and nothing more) Apple has been proposing that the Flash Player is the biggest cause of crashes on the Mac.

Recently I’ve been seeing remote data requests randomly dropping when requested from Flash Player based swf content. I’m sure that Adobe could enlighten me about why these requests would fail but in general if you request an image or some other element, in Apple’s operating system you may receive the ‘response’ that an image has been received prior to the image actually being delivered as data. This would cause any flash movie coded to load data to fail if the Event request returns COMPLETE but the actual data is null until a period of time has passed (I’ve seen 206’s and 200’s returning data AFTER the request has completed). In fact if you code poorly in Flash (handling the Event.COMPLETE and ignoring the content that is returned — just adding the Loader class to the display list using addChild and when the actual data is received the loader will display the data) then you won’t see the issue — but during this weird issue you may see the beachball of death on the Mac if the swf has been coded with the reasonable expectation that the returned data will not be null. If a Flash Player can cause stability issues this is not a problem of a plug in for the browser but it indicates an inherent issue with the operating system that doesn’t do proper process blocking and multitasking. The flash player is a simple dll process and if you have such a poorly built operating system that a dll can crash it then you’ve got real problems and are masking them by blaming folks for coding to your specs and expecting that you’ll get a good experience.

In a regular browser experience this isn’t an issue since the request isn’t as intelligent as a request from a Flash Player based request. There’s no validation generally to whether the image has been received and data loaded into the img src of an html page since that doesn’t really factor into the equation.

What does this mean? Well, this has been a progressive experience issue, that Apple has modified over a period of time rather than immediately.

Is this on purpose? I have no clue, but it does appear to target experiences such as those of Flash and Silverlight as opposed to the browser img loading experience. It just seems odd that they would announce that the Flash Player is the biggest issue for stability after introducing these kinds of changes and recording these issues. I wonder if they would go back in time to an earlier version of the flash player prior to introduction of Mac OS 10.4 and show us the results of the Flash Player experience prior to introduction of the Apple experience of the iPhone where they first targeted the Flash Player as an item that would be considered an experience issue.

I’m just posting my observation since I use both Mac and PC operating systems and have switched to the PC from the mac cause at least the PC doesn’t have these issues that the Mac is experiencing.

Funny, two years ago I would have said the opposite.

I’ve got an example of a link that works great on a PC, but fails on a Mac and it appears that randomly the slate image will return a null value:

http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000410491&tag=googhydr-20&hvadid=4644437547&ref=pd_sl_76g5frn7c1_b

Check it out.

AS3 Netstream Video stops during seek

I’ve noted this in other areas but there is a serious bug in the netstream class or i’m not doing it right.

Here’s the deal — during the seek of a low keyframe video asset the netstream may end up sending a stop even if you try to seek to a point in the video after the last keyframe. It’s pretty consistent and very irritating.

During seek events this event is fired:

  • NetStream.Seek.Notify

And at some point during interaction with the video player the netstream will fire a series of Flush and possibly a Full event.
At this point, if you seek to a point past the last keyframe you’ll generate a:

  • NetStream.Play.Stop

and end your interaction arbitrarily.
[Read the rest of this entry...]

Embedding swf files from Vimeo, YouTube et al

Embedding a video player from an external source is troublesome business in Flash 9 mainly because Flash 9 doesn’t support unloading an external swf properly. Adobe realised this and included ‘unloadAndStop’ as a command on the Loader class for external references for Flash 10 which resolves issues related to references to missing classes on unloaded swfs.

You may ask, is there a way to do this in Flash 9? Well… sort of. If you were to fool the loaded swf into using a patched version of the basic dynamic classes for event listeners and including a manager class that noted all the added events and then removedEventListener from each event added you could properly clean up the classes but that’s sort of a tricky situation. You would basically be fooling the swf into cleaning up and may end up with other issues. The main item is the unloading of assigned Events. That’s important and easily fixed with a recommendation to move to Flash 10 (which is not as unreasonable as it sounds — Flash 10 is pretty much at 90% these days and on review of my analytics almost all my visitors are on Flash 10 these days, which I can thank YouTube, Hulu and all those heavy video sites pushing upgrades out, check out penetration for the current numbers). For smaller sites this would be a non-issue, but for a Yahoo homepage takeover for example Yahoo recently acquiesced to go with a Flash 9/AS3 push last month after I explained and outlined the benefits and needless to say Flash 9/AS3 has been out since 2006.

[Read the rest of this entry...]

Calling a JSON service function from Flash AS3

Here’s a quick way to call a JSON request without loading a bunch of Classes and wrangling Adobe’s methods:

[Read the rest of this entry...]

Firefox 2 mac / pc and errant empty navigate/getURL requests

I had a bug that was nagging me for a while, mainly because it only shows up on Mac and XP machines (neither of which i use for development) and i thought i’d share it here since it’ll show up again for someone somewhere.

[Read the rest of this entry...]

Dataservices — What to chose when running a client/server application and flash?

I was looking for data on which backend implementation of data services was the best to use in flash, and everyone is talking REST these days and just straight xml data.

But there’s still much to be desired in using a more optimized pipeline, especially when dealing with large amount of data or many concurrent connections or heavy bandwidth utilization. Does the service really scale? Is REST really battle tested? Doesn’t KISS still apply when it comes to online applications that really need to be responsive to the user of the system? I deal with architects with many odd and varied bias’, but in general if you can show them real world tests they’ll come around generally.

I came across an excellent example of many great tests being run realtime at James Ward’s site:

Example of many of the popular data services available today to flash developers
Example of many of the popular data services available today to flash developers

Try it yourself here.

Daelgren presentation engine

As i’ve been hinting at for months i’ve been working on a presentation system for flash. I’m very close to rolling my first project using the system and having extrapolated what is part of the framework from what is custom development for the project in question is very close to complete you should expect that i’ll have more details related to the effort posted soon.

In the meantime, here’s a short overview of what is included in the system:

  • External Font and Styling
  • Page description templating
  • Navigation and deeplinking support (using swfaddress, swfobject and swffit)
  • Animation attributes (using Tweener)
  • TextField support
  • Loader Extensions
  • Sound Extensions
  • Broadcaster implementation
  • Preloading and asset management
  • IPreloader, IComponent, DComponent and additional support classes for building custom controls for use in the presentation system
  • Focus on separation of UI and content for easy modification without recompilation of the source (for enhanced stability and reductions of QA cycles required to build a AS3 based Flash site)

This project is at a production ready state, but at this point i would consider the engine at a version 1 RC state. I expect that over the next few months there will be enhancements that will substantially change the core functionality but not the defined templating format or external asset managment requirements.

Keep an eye on this site for more information soon.

Dynamic Masks and Flash player 9 / 10

I came across a very interesting bug that i’m in the process of working around.

Basically, i’ve created an image gallery with dynamic masks that contain wipes that are transitioned over the individual movieclips.

The stack is composed this way:

Container MC >

    Image MC >

        Loader MC for Loader content

        Mask Sprite (attaches to Loader MC)

        Mask MC is used to transition the effect.

In Flash 9 on PC, there’s no problem and all the wipes execute correctly.

In Flash 9 on Mac, the wipes do not function after the first wipe completes.

In Flash 10 on both platforms, the wipes function as they do on Flash 9 for Mac — which is to say they do not work correctly.

I’m working on a solution for this project which will be a workaround for Flash 9 Mac (and i’m assuming Flash 10), but I don’t like the alternative solution since it’s not as elegant as just doing it all in code and creating masks dynamically.

Needless to say, test on both platforms, and in the newest player when developing, since they don’t all behave the same.

Crossdomain changes in Flash 10 affect S3 users

There’s been a few posts recently regarding crossdomain policy changes in Flash 10 affecting S3 users:

http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=675&threadid=1367135&enterthread=y

A little more detail regarding the changes to the top level crossdomain allowing site administrators to control sub directory located crossdomains.

http://neurofuzzy.net/2008/08/27/flash-player-10-will-not-work-with-amazon-s3/

Essentially, using S3’s subdomain feature instead of bucket location (sub directory) allows you to properly control access to your data. There shouldn’t be any issues with this solution but it’s good to be aware of these changes.

Some more info for possible redirection of your domain to another site such as the subdomain on s3:

http://www.carltonbale.com/2007/09/how-to-alias-a-domain-name-or-sub-domain-to-amazon-s3/