Archive for March, 2008

18
Mar

Adobe - Make Some Noise

Adobe, MAKE SOME NOISE

Just read a post by Andre Michelle a guy who has done some amazing stuff with sound in Flash. Anyway, he is asking for Adobe to address a serious issue that is threatening to break a lot of sites that people have done trying to work around Adobe’s crappy implementation of the sound API in the Flash Player, so I am putting up his widget in support and adding my £0.02’s worth.

For a long time I have wondered why Adobe have not paid the same attention to the sound side of Flash than they do with the visual side - in Flash 8 they gave us Bitmaps and Filters to mess with these, but no access to the sound API beyond panning and volume. With ActionScript 3 came a leap in the speed acheivable for applications, but no major improvements in the sound API beyond compute spectrum - which everyone can now use to make visualisations of soun, great, but I want to play with the sound please…
Fortunately Andre & some other people found workarounds to create sound on the fly in the Flash Player. It takes some interesting ActionScript hacks to do this, but they made some really good real-time music stuff with it. http://code.google.com/p/popforge/

http://www.flashbrighton.org/wordpress/?p=9

Now I think Adobe understand that music is an important part of the “experience”, so why they don’t make it easier for people to play, when they have done lots of the hard work with bitmaps, is beyond me. They really should be taking the stuff that people like Andre have done on board and realise that giving us tools to play with sound is something that would open up huge avenues for creativity in Flash…

Manipulating bitmaps is done in 2 dimensions as opposed to working with sound, which only requires one dimension, so the processing requirement for sound is usually less - depending on the complexity of calculations for effects. This should be a no brainer Adobe - are you tied down by some dubious industry patent bollox or is there something else you are not telling us? Maybe they are all tone-deaf with extremely acute visual acuity to compensate, because that’s the impression I get from the apparent bias towards visuals.

So what do I want in the Flash player:

The ability to apply filters to a sound channel ~ adding filters to a movieclip.

The ability to grab the sound data and do wtf I want with it ~ grabbing bitmap data.

Midi control built into the Flash player please.

Maybe a MOD player - that would make games a bit more retro sounding :)

I have asked them for this, if you want it, fill in the wish list…

http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform


15
Mar

Flex font embedding preloader gotcha

I just ran into a frustrating problem with Flex using embedded fonts and a custom preloader…

I have been working on a small app, was ready to upload it all the other night then tested it again and noticed my fonts were not working properly - they had previously been fine.

It was really wierd, the bold version of my font was fine, but where I was using the normal weight typeface, my character set was limited to a few characters:

“adgino0123456789L.”

I tried changing the font I was using and embedded a different font and everything was okay - wtf?

I spent about 2 hours fiddling round without any luck and was about to change the font I was using permenantly because it seemed that Flex was having problems transcoding all the glyphs I wanted to use in my project - time for a break.

Sitting down and feeling refreshed, I noticed a strange thing about my characters - look again and see if you can work it out:

“adgino0123456789L.”

Still no wiser (it’s an anagram)…

Oh b****r, it says “Loading.”

Guess what, the last thing I had done before uploading was tweak my custom preloader for the project to display the % loaded.  There are a few useful tutorials about doing a custom preloader for Flex:

http://www.onflex.org/ted/2006/07/flex-2-custom-preloaders.php 

http://www.bit-101.com/blog/?p=946

http://jessewarden.com/2007/07/making-a-cooler-preloader-in-flex-part-1-of-3.html 

Unfortunately by making my preloader use dynamic text, I had also embedded the font in the SWF file.  This overrides Flex’s embedding of the font - not sure why, I guess the font in the preloader is “loaded” before the main application fonts, so Flash Player thinks it is already there - what a nightmare.

So, beware if implementing a custom preloader - don’t use the same fonts as you use in your app, or embed all the characters you are going to use, which defeats the object of having a preloader if you ask me…

Nasty, on further reading, it seemed that Jesse Warden has also run into the same problem…

 http://jessewarden.com/2006/12/integrating-a-flash-interface-into-flex-2.html

15
Mar

Creative Britain…

I have just been reading the Guardian’s article about the government via Ethan Eismann’s blog and here is my impression…

Funding for creative enterprises is pretty good for some areas in the UK. Across the rest of the UK, the “arts” receives lottery money and other funding, but probably not as much as some of the people would hope for - is it ever enough?

The area I live in received large amounts of money for lots of projects, not just creative  ones, under the EU’s Objective One funding.  This is changing in 2008, but more money will be coming in http://www.objectiveone.com/index.htm

With Objective One a lot of money has been funneled into generating new industry streams and the creative industry has been a major recipient with numerous organisations offering grants & funding for the creative industries - for example, some “funding funnels”:

http://www.flickernow.org

http://www.creativeskills.org.uk

One issue I have with the Objective One approach is that it is very much “gravy train” for a large amount of middle-class people and I feel that a lot of money does not trickle down to those who need the most help, instead they are patronised by various projects that often only skim the surface.  However, creativity is only recently becoming a recognised way of making money rather than something to take up your spare time -whether this is bad or good is a topic for another time.

It is nice to see that the government has recognised that creativity is such an important part of education, if for the wrong reasons.  Their pledge should hopefully help to counter a worrying trend in education that has seen timetables drop many creative subjects and reduce the time devoted to others in favour of science, maths, business and things seen as useful for making money.  Having worked in creative projects with schools I found it very frustrating that the only time some kids got to do creative stuff was outside school time, so if the government is not spinning us a big line, we will hopefully get some cool stuff happening again. This should also please the teachers who are fed up with the governments “measure everything” approach to education which has made lessons driven towards passing the measurement criteria applied to schools rather than making sure kids get an interesting and well rounded education.  Finally teachers may be able to get a bit more creative with their lessons - which will be a welcome break from the “Teaching for SATS” culture that seems rife in schools at the moment.

So, we will probably be seeing more projects for the likes of Creative Partnerships, Youth Music & other organisations who try to promote creativity for young people. This in turn is good for me, because I like doing projects with young people that gets them being creative… http://glenpike.co.uk/portfolio/automaton.htm

06
Mar

Quick and dirty Flex buttons with separators

I have been trying to get Flex separators between my buttons in a Repeater tag as I did not want to use the LinkBar. I was having trouble trying to replace the Flex separator one with my image and it was getting stretched by the link bar and looked rubbish, so I looked around for a hack to mess with the repeaters and found Peter Elst’s post about working with the Repeater.

Here is a quick and dirty way to put a separator image between your buttons and hoik (remove) the last one out…

MXML for a simple repeater below:
Quick Code


  <mx:Repeater id="navButtons"
    dataProvider="{navData}">  
    <mx:Button id="btn" styleName="navButton"
      click="navClick(event)" label="{navButtons.currentItem.label}"/>
    <mx:Image id="separator" source="embedded_assets/menu_separator.png"/>
  </mx:Repeater>

Now you need to add in a function to remove the last separator image - you only want them between the buttons right?

First add a function that will handle this - easy, you access the thing you want to mess with as an element in an array - the array name is the id of the element you created in the Repeater:

Quick Code


private function removeLastImage():void {
navBar.removeChild(separator[navData.length - 1]);
}

You also need to put in a call to the removeLastImage function somewhere in your component. Mine was called from the creationComplete handler - here is the whole component.

Quick Code


<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
  xmlns:skins="skins.*" creationComplete="removeLastImage()">
 
  <mx:Script>
    <![CDATA[
      import mx.collections.ArrayCollection;
      
      [Bindable]
      public var navData:ArrayCollection;
      
 
      private function navClick(event:Event):void {
        trace("navClick " + event.toString());
      }
      
      private function removeLastImage():void {
        navBar.removeChild(separator[navData.length - 1]);
      }
    ]]>
  </mx:Script>
  <mx:Repeater id="navButtons"
    dataProvider="{navData}">  
    <mx:Button id="btn" styleName="navButton"
      click="navClick(event)" label="{navButtons.currentItem.label}"/>
    <mx:Image id="separator" source="embedded_assets/menu_separator.png"/>
  </mx:Repeater>
  
</mx:Canvas>
03
Mar

PhotoShop Strikes Back

I wrote last week about problems with Adobe’s CS3 trial messing with my file associations.

Well guess, what this has caused bigger problems this week, time=money-wasting problems…

Apparently editing files in PhotoShop CS3 and using the backwards compatibility option when you save, does not guarantee you will be able to open them in an old version of  PhotoShop.  I learned this painfully, when I edited a couple of PSD’s in CS3 (after double clicking to open them, grrrr) and then saved them without worrying about the consequences because the little box tells me I should be able to open the files in older version.  Only this is not true.  When I try to use PS 6 to open my files again, I get the ominous and much discussed “not enough memory (RAM)” error message when I try to open them in PhotoShop.

This means I have lost several hours of work, because Adobe saw fit to dick with my registry.  Backups you say - well I have been backing up, but as this was the start of a project, files did not get put into version control until the end of the day.

I reckon this is some sneaky bastard trick to make me upgrade.  If it’s not, it still makes me angry.

Thanks Adobe, you have cost me at least the price of PhotoShop in lost work.  Guess where I won’t be spending that money.

F***ers.




About

I am a web-monkey / computer junky living in Cornwall and occasionally I tear myself away from my computer to go bodyboarding and playing in some of the beautiful places near my home. I love doing Flash and ActionScript stuff and feel that there needs to be more of this going on around here, so someday, if I have time, I may get my goddamn user group started. I may occasionally make controversial comments here about work, life and such, but this is essentially a diary and we still have the laws for a free press. Feel free to go somewhere else if you don't like it, or maybe comment if I dare turn them on. If you are: * my Gran, then sorry for swearing * my Mum, stop reading my diary dammit * everyone else, then get out more
Adobe, MAKE SOME NOISE