What’s the largest of the 52 United States of America?
Continue reading ‘Joke…’
Archive for the 'Yaay!' Category
Joke…
Yay Snow!!
Finally we have some proper snow in Cornwall… It’s been about 5 years in the making, but today the weather let rip and gave us a good dousing of the cold white flakes.
As per usual, as soon as the first flakes fall they shortcircuit everyone’s driving ability and we have major gridlock everywhere with my lovely lady taking nearly an hour to travel between Pool & Redruth…
To avoid the prospect of trying to get down then back up two notorious hills, even she had to leave the car a few minutes away from home, but good job too because anyone else who ventured further would have had to abandon their no-longer trusty steeds to fate, sledgers and idiots who think that because they have a Scooby, they can drive like Colin Macrae. This idiot could not even go 10mph without hitting 2 cars, even when the smarter kids on the street suggested he give up. Anyway, he distracted our community copper long enough for the kids to start bombing down the hill again!
Check out some pics of the new craze that’s hopefully not sweeping too hard, but skimming down a hill near you. I would have joined in but I did not have anything slidey that…
a) …belonged to my grandad/older brother/Cormac
b) …I cared about too little not to trash - my sponge.
And, contrary to popular current opinion, a bin lid doth not a slidey thing make…
Best Job Ever…
I have been freelancing for the past year and was getting on okay, but in July I stumbled across a job advert that spiked my curiosity. Anyway, to cut a long story short, I applied for the job, got an interview, trialed - part time over 2 months and started full-time again in October. I am now helping to build an army of robots to take over the world*
Continue reading ‘Best Job Ever…’
SWFAddress and a tip
Working on a revamp of a website, I decided to try out SWFAddress to make the back button work instead of a hand-rolled solution…
I managed to get this up and running really quickly, which was nice, but then I spent 2 hours working out why it no longer worked when I integrated the SWFAddress into the site…
The Flash bit worked okay - change something and the address bar got updated, but the back button never worked - or did not send any events back to Flash.
2 Hours later, after stripping my code back, I found the problem:
If you are using SWFObject, the javascript for this needs to be included before the SWFAddress javascript. Doh!
Apart from that small hiccup, it’s nice and fairly simple to use…
I won something!
I received a cool poster through the post today, courtesy of Ethan Eismann, who works for Adobe.
http://hello.eboy.com/eboy/2008/02/25/poster-for-adobe-air-launch/
Ethan ran a mini-competition on his blog asking for the best comments on “optimisation” and I got an email a few days later saying mine was the best out of 4. I had not realised it was a competition I was just having a slightly sarcastic rant on a pet subject of mine
Anyway, it made my day and I have a limited piece of artwork by Eboy now too!
SAS SOS
I finished a big project last week for Surfers Against Sewage called Save Our Seas.
This is another free educational resource like Operation Beach Clean which I had done previously.
Anyway, this time I did some animation myself and also re-used part of the intro from OBC, adding some extra audio and lip-sync’ing to this.
The Flash is a bit more modular this time, so we can easily create new content and add it to the XML sitemap to be loaded in. It still runs in AS2 as it borrows some code from the OBC project.
Some cool stuff which helped a lot: the XPath implementation from XFactorStudio, Jobe Makar’s Wordsearch game from Flash MX Game Programming Demystified was ported to AS2 and I used the Tween Lite package for the first time when the ripple transitions started slowing everything down - nice and simple. I also had some great help from the FlashCoders mailing list with some tricky problems, cheers guys.
Anyway, check out the finished project and if you know any teachers who might like it, let them know too.
http://www.sas.org.uk/education/sos/
Tip - don’t launch PDF documents as a URL in Firefox, Acrobat Reader keeps hanging the browser for some reason…
Here is some code to help:
Quick Code
private function _showPDF(_pdfURL:String):Void {
//use JS to pass in the browser variable to Flash: - http://www.quirksmode.org/js/detect.html
var browser:String = String(_root.browser).toLowerCase();
if ("firefox" == browser) {
_useDownload = true;
}
if (true == _useDownload) {
var fileRef:FileReference = new FileReference();
if(!fileRef.download(_pdfURL)) {
trace("Failed to download.");
}
} else {
getURL(_pdfURLl, "_blank");
}
}
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
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.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
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:
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.
<?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>

