As the title of this thread suggests, svn’ing the html-template that Flash Builder relies on to generate the container html files can lead to some headaches. One in particular that has just taken me about 5 hours to solve.
I’ve been migrating my SVN repo over to Springloops (check it out if you haven’t already) and decided to add the html-template folder to source control. Made a few commits, then got to building a deployable swf and that’s when the shit hit the fan. From what I can ascertain, Flash Builder was copying whatever was in the html-template folder (which included the .svn metadata folder) into the build folder. As everything in the build folder was versioned as well (so I can one click deploy to staying and production server) bizarre things started happening when I tried to commit things. In hindsight I should’ve cottoned on to the fact that Flash Builder was actually copying and pasting the html-template’s svn data into a folder that it shouldn’t have been. Of course, hindsight’s a wonderful thing ;-)
This is absolute Gold!
Bravo to those that created it; you’ve made some very salient points with the examples and comparisons given.
Now we just need to ensure that the same number of people (including Managers and tech decision makers) that read the dribble Apple’s CEO posted a few months back could see and experience this site. And hopefully they can if the Flash community band together with the aim of setting the facts straight.
Just a quick note (possibly to self) that when dealing with FileReference you need to ensure that the scope of the FileReference is maintained. This was mentioned in the Actionscript documentation, but it took me a while to figure out that that could be the problem for my code failing silently. Originally I thought it was because I wasn’t using the right playerglobal.swc from within Flex, or that I couldn’t export using Flex SDK 3.2 (as this method is a Flash Player 10 one). It took me a while to reread the documentation for the load method and comprehend that perhaps I needed to declare some instance variables instead of local ones. Some code will hopefully illustrate what I mean:
public function uploadImage():void
{
var __imageTypes:FileFilter = new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg; *.jpeg; *.gif; *.png");
var __fileRef:FileReference = new FileReference();
try {
__fileRef.addEventListener(Event.SELECT, onFileSelect);
__fileRef.addEventListener(Event.COMPLETE, onFileOpen);
__fileRef.browse([__imageTypes]);
} catch (error:Error) {
trace("Unable to browse for files.");
}
}
private function onFileSelect(event:Event):void
{
trace("onFileSelect called");
var fileRef:FileReference = event.target as FileReference;
fileRef.load();
}
private function onFileOpen(event:Event):void
{
trace("onFileOpen called");
var fileRef:FileReference = event.target as FileReference;
var data:ByteArray = fileRef.data as ByteArray;
var encoder:Base64Encoder = new Base64Encoder();
encoder.encodeBytes(data);
trace(encoder.toString())
}
The problem with that code is that the original __fileRef variable is only available within the uploadImage function. As soon as onFileSelect is triggered (which works fine), fileRef (a new local variable within this function) trys to call load(). This was failing silently for me.
So instead of declaring the original __fileRef variable as a local one, I’ve declared it as a private variable in the class. That way it’s always in scope!
Does anyone else find it odd that there’s no Adobe backed central repository for distributing AIR applications? I know that the Central runtime never really went anywhere (apparently due to the technical limitations of the users computer at the time).
So is the world ready for a centralised, built for developers, run for users AIR (dare I say it) App store?
Perhaps it’s time to feed Apple a bit of it’s own medicine, pretending to be innovative in an area that quite clearly has already been done - just not marketed properly.
This time around however, I think Adobe (and it’s throng of Flash developers) can cling to the coattails of Apple’s App Store - but with the promise of being able to use the application across all devices that have the Flash Player installed.
I’m hoping that the latest Flash Player version will allow this to become a reality.
If anyone’s got information about businesses that have already tried to monetise this please add your comments at the bottom.
UPDATE: I’ve been reliably informed by Tink in the comments that there is an Adobe AIR Marketplace. Possibly the fact that I don’t know about it means that there’s still a bit of marketing work to be done somewhere.
Recent Comments