May 28, 2009

FlashCamp Birmingham, June 16th

Here’s some news of what promises to be a great (and completely free) conference coming up in June for Flash Platform developers. FlashCamp Birmingham is being held on June 16, arranged by the Midlands Flash Platform User Group, and will consist of a range of presentations and talks for novices and experts alike. Events like this are a great opportunity to network with other novices, experts and developers and will also be an opportunity to see the new Flash Builder 4 in action. Some of the most knowledgable people in the Flash/Flex/AIR community will be there speaking, including Stefan Richter and Simon Bailey, while Adobe will be providing the keynote.

Whether you’re a novice or a seasoned pro, everyone will learn something at Flash Camp in Birmingham. We’ll explore existing Flash Platform technologies like Flash, Flex and AIR , before looking ahead at Flash Catalyst and beyond. Our keynote will be from Adobe Systems, who will also be running an hour-long session later in the day. We have a group of sessions dedicated to the creation and customisation of Flex components, and to add some creative inspiration, there will be presentations on real-time 3D in Flash, and how to take your Flash application architecture to a new level.

More information at http://www.flashcamp.co.uk/ and hopefully see you there!


April 12, 2009

Back to writing about Flex, AIR and Wowza

It’s been a busy few months since my last blog entry about anything related to Flex and AIR development. I blame a Twitter addiction, but there are still some things you can’t write about in 140chars and I do have a few development-related things to blog about, so expect some hopefully interesting entries over the coming weeks. Since November I’ve been working on two projects: an AIR-based media conversion client and a new chat application in Flex and Wowza Media Server. Some things I plan to write about: AIR file upload, more on using the local filesystem APIs in AIR, using Remote Shared Objects for communications, and lots of tips and tricks. I’ve also been playing with Gumbo, AFCS and PureMVC recently, so I hope to post some of my experiences with those as I go.

Anyway, good to be back. :)


November 04, 2008

AIR FileReference and scope

I ran into a small problem recently in my AIR application when using FileReference to initiate and monitor a download operation; no events from a FileReference object created within a method were being fired. After a quick check of the Livedoc entry I found the issue:

if the FileReference object goes out of scope, any upload or download that is not yet completed on that object is canceled upon leaving the scope. Be sure that your FileReference object remains in scope for as long as the upload or download is expected to continue.

So basically a FileReference object needs to be created in such a way that it stays in scope for the duration of your operation; if you instantiate it within a method it there’s a good chance it will go out of scope and any events you were waiting for from it will never fire. The easiest solution is to declare it outside of the method, so instead of:


private function download(event:MouseEvent):void 
{
    var fileRef:FileReference = new FileReference();
    fileRef.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
    fileRef.addEventListener(Event.COMPLETE, onComplete);
    //etc.
}
you need to do something like this:

private var fileRef:FileReference();
private function download(event:MouseEvent):void 
{
    fileRef = new FileReference();
    fileRef.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
    fileRef.addEventListener(Event.COMPLETE, onComplete);
    //etc.
}

Sorted. Afterwards I also found more info about this via a couple of useful blog articles here and here.


October 03, 2008

FOTE 2008 notes

My live notes from the Future of Technology in Education event at Imperial College…

Google lady (from the sales corps)
Talking about the cloud, storage vectors, 60% 3G phones by 2010
Asserting that edu is still catching up with this
Google says it ‘can help’ – by innovating for us(!)
Google apps for education – usual stack; Gmail, Apps, Gears
‘The Big Switch’, book by Nicholas Carr – moving to the cloud
Saying we should concentrate on our ‘core business’ and let Google do everything else.
Q. Why use Google apps? A. Because students already use these apps and expect to be able to use them – I’m not convinced by this, many students I’ve asked don’t know anything about Google apps, and what would we be providing over and above? Why not just let them keep using those things as individuals and promote their use? Provides continuity…
Q. What protection does Google offer regarding data, service models? A. Google guarantees via contract, 5-year rule. Google apps should attract users because its good. Response – what about the erosion of internal expertise over time? Argues that email isn’t core.

Mobile technologies
Saying that mobile has been with us for years, showing pictures saying its just got smaller/more convenient/ubiquitous
Mobile allows new ways of learning? Push content, TV etc.
Concept of centrality via device
(aside – looking round here, there are more Linux ultra-portables and Macs than PCs about)

Why portability matters – BBC Backstage
Users is now back in control?
Multiple accounts, identity management is hard, OpenID
Thin clients, EEE etc. cloud has propretiary pitfalls, Second Life
Mentions GetSatisfaction.com, Yammer, using Basecamp, saying that the info is being collated/stored by another party, has issues. Basecamp lets you export your data for instance when you close an account, Flickr suggests alternative/rival services when closing your account with migration tools
Downtime scheduling clashes with UK, is Twitterdown.com etc.
Shows how Flickr will ‘enhance’ your content with other stuff, tags, comments.
Some good stuff here in general about being careful about reliance on the cloud.

James Broad, Yahoo, Opening up the web
Works on finance.yahoo.com
Open standards driving adoption/innovation, esp. auth mechanisms
Communities
Mentions customisable pages, BBC, Facebook apps, integration of Facebook into Yahoo homepage, Read and Write web, microformats, YQL, WAI ARIA.
Says that Flash is the future (just checking you’re reading this)

Personalisation of Learning, Philip Butler, ULCC
‘Harnessing Technology Review 2007’, BECTA report
‘Technology motivates learning’ – going back to Google’s earlier message, does that suggest that the alternative is that technology integration actually is core business for HE? It’s easy to twist that argument both ways
Cultural shifts – networking, community, personalisation, immediacy, interactive, asynchrony, technologies in your pocket
VLE, Personal Learning Plans within VLE, progression, ownership
Taken screen from LearnZone (BBC), showing personal gateway, updates, timetable etc.

Tim Marshall, JANET
IPTV, trends, demo of HDTV stream, 1100kbps
Student-produced content, needs leadership, some kind of community of student producers?
IPTV briefing 6 Nov – better streaming technologies are inevitable, the key is ubiquity and standards. If this (quite cool) streaming platform requires students to install another plugin, it isn’t going to catch on unless it’s adopted as a standard

Miles Metcalf, Ravensbourne
User-owned technology, using commodity computing, no longer need to supply laptops, hardware
Opportunities for integrating with user-owned computing
Software as a service, user choice now matters, can’t dictate so much
Role of IT Services – arbiter of fair use, defender of scarce resource, agent of transformation, or just plain service provider?
Control is being lost, network access via 3G for instance
Extra-institutional practice into institutional learning
Personal Learning Environments – allows external and internal integration of material
Ad-hoc comms mean different social behaviours
Thinks the VLE should still be part of the stack, but still a bounded system
OpenID far from perfect, but says better than Shibboleth because it would cross boundaries (education/commercial)
Talking about why we shouldn’t be on Facebook as an institution

Building 21st Century LEs, John Hickey, Apple
Students creating new fields of study
Guidance, scaffolding
Different models of engagement, media-rich, producers of content
Going into a classroom almost like ‘taking a flight’, turning off devices, disconnecting
Widening gap between the outside world and education – perception of outside world being more advanced
‘Shift in power’, consumerisation of IT
Example – don’t provide generous email quota, students just move to Gmail – easy to do
Catch-up mode
Context/Core analogy; Core being the things you do yourself as an institution, Context is everything else – flip the 80/20 rule so that 20% is context – suspicious about the driver here, enterprise would say that, but Apple do have a track-record (e.g. iTunesU).
Showing iTunesU promo video, targets student/public – shows how to navigate, get to institutional homepages, how the feeds work, iPod use etc.

Tom Abbott, Warwick University
Explosion in HE – creativity, student as producers
Moving from extraordinary to ‘core’, sustainable output
Students are digitally-literate, but faculty generally less so
Lectures possibly outmoded (although still relevant)
Fail again, but fail better
Talking about Warwick’s toolset – CMS, blogs, easy publishing, video and audio
Recording applications demoed and worked!

Alastair Mitchell, Huddle
Good choice of Dilbert cartoons – ‘Everything is a platform’
I quite like Huddle – vastly different from the early betas, with doc workflow management and more collaborative features than most other platforms I’ve seen (that aren’t Sharepoint).


September 26, 2008

AIR: Rendering native system icons, Pt.1

I was asked how I got AIR to display native file icons in a component – it’s pretty easy to do, although my method is a little convoluted to explain without posting reams of code, partly because it’s buried in a sequence of Cairngorm events/commands but also because there a couple of important issues to watch for and handle (see bottom of this entry for those). Here’s an overview:

AIR has support for retrieving the native system icons in whatever supported sizes exist. The icons are stored as a property of each File object as BitmapData, in an array, File.icon.bitmaps. Each element in the array is the same icon at different sizes, e.g. 32×32, 16×16 etc.

In order to get at an icon at a given size, you can’t rely on what sizes are available at a given element position, so you need to create a new (empty) BitmapData object at your target dimension, then iterate through File.icon.bitmaps until you hit the matching-sized BitmapData object. Once you have a match, you can put the matching data into your own BitmapData object. Here’s a brief example:


public function get32Icon():BitmapData {
            var myFile:File = new File("C:/foo.txt");
            var bmpData:BitmapData = new BitmapData(32, 32);
            for (var i:uint = 0; i < myFile.icon.bitmaps.length; i++) {
                if (myFile.icon.bitmaps[i].height == bmpData.height) {
                       bmpData = myFile.icon.bitmaps[i];
                   }
               }
               return bmpData;
         }

Obviously you need more than the code above to handle situations where the 32×32 icon isn’t available, but that’s a basic way to grab the icon as BitmapData. At this point you could create a new Bitmap object and give it the captured data, but for my application I set the icon data back onto an Object that represents the File object (I actually used an ObjectProxy because I wanted to bind this data to an ItemRenderer later) – again this becomes important later on.

Okay, so now I have my icon data, in an object that also contains other information about the file, like its name etc. To display it in a TileList, or other component, I just use a custom ItemRenderer. I set up an image tag for the icon within the renderer:

<mx:Image width="32" height="32" source="{getIcon(data)}" />

...and then create a method in the renderer to return the icon data to the image component:


private function getIcon(data:Object):Bitmap {
        var bmpData:BitmapData = new BitmapData(32, 32);
        bmpData = data.icon;
        var iconBmp:Bitmap = new Bitmap(bmpData);
        return iconBmp;
        }

Now each time the ItemRenderer has to render an item, it gets the relevant icon, the filename etc. and displays them within the TileList – easy! Here’s the result, showing the app running in XP and OSX:
Files part screen grab

But there are caveats; AIR does not behave consistently on all platforms with icon data. Here are couple of the problems I encountered:

  • Performance. There seem to be some differences in execution time for file system queries in AIR. Originally I had an ArrayCollection of File objects as the DataProvider for the TileList, retrieving icon data for each one in the ItemRenderer as required. On Windows this seemed fine, but on Mac OSX it proved to be very slow, to the point where my app was unusable. I overcame this by using the Flex Profiler to see what was causing the problem, finding that the underlying get icon() execution time was very long on OSX. By grabbing the icon data once, then caching it and other key File properties into an ObjectProxy, I was able to get OSX performance almost on a par with Windows, and this also sped things up elsewhere because I was calling get icon() once, rather than per-item in the renderer. It also improves scrolling performance of the TileList because that component renders items dynamically as they are displayed. In fact you could go one step further than I did and extend UIComponent to improve render performance even more.
  • Missing icons. AIR on Windows won’t retrieve some icons, in particular for .EXE, .TMP and .INI files. These are stored in shell32.dll on XP, but for some reason AIR can’t get to them. I also found one or two similar issues in OSX. AIR on Linux using the most recent AIR beta just returns a null value for File.icon.bitmaps, so rendering native icons is currently impossible. You need to add some way of checking for a missing icon in these cases, and swop it out for an embedded one if you can; I created a temporary workaround where I parse the BitmapData for null pixel values.

The next part of this article will deal with how I got native icons to render for remote files, but I bet you can already guess how that’s done…


Search:

MXNA link

Tweets



    Tags

    Other blogs I like...

    Black Pepper Software

    Eismann-sf Go to 'eismann-sf'

    Ted On Flex Go to 'Ted On Flash'

    Galleries

    RSS2.0 Atom

    Meetups:

    Not signed in
    Sign in

    Powered by BlogBuilder
    © MMXVI