Email / Back to MewTube

Michael Ewing
Flash designer/developer
Email:michaelewing(at)michaelewing.co.uk

30th July 2009
Excellent article here: We've forgotten the force which really drives political change.

29th July 2009
And now for something completely different! The first page of 'Hugo & Co. Investigate' appears. This new webcomic in the classic style will be updated as frequently as I can find the time. Follow the adventures of Hugo, Claude and Margot. http://www.michaelewing.co.uk/hugo/

16th May 2009
Quite technical - today's post!

Recent projects have highlighted some of the most challenging and interesting issues in Flash development I've had to solve. For gaming, one key aspect is speed and memory management. Developers who are used to movieclips and tweening, which normally lend themselves so well to animation, soon discover how unwieldy these can become in a realtime game, like Meowcenaries.

In that game, not only are there over a dozen separate animated game objects moving around on screen at any time, but the speed of their movement is important. Add to this the fact that several of the levels are huge, which means lots of information stored at runtime, and the slowdown becomes apparent very quickly.

For Meowcenaries the solutions were varied, but key to maintaining the speed was 'flattening' the nested movieclip structure, and using the BitmapData class to copy flat images onto the screen. The advantage is that all the memory that would usually be reserved to store all those movieclips is released.

We also discovered that tweening, especially transformations, such as colour or transparency caused significant slowdown. This was due to the additional maths required for Flash to calculate the overall required colour for any given pixel where semi-tranparent colours are overlayed. We found the best way to keep the cool animations without the memory overhead was to pre-render them or 'trick' the eye. For instance, some animations are not tweened, they consist instead of a staggered set of keyframes representing the different states of the tween.

Also, the game was built in AS3 which introduces the issue of memory leaks - a problem that Flash developers, including me, did not really have to worry about in AS2. It soon became apparent that memory leaks could crop up in the unlikeliest places making debugging a serious issue.

After much hair-pulling a solution was found to speed up debugging. This was to use Flash CS4 to create a movie loading environment. Using the System.totalMemory property we could monitor the memory usage at any given time. A button could be pressed to load and unload the flash movie being tested. When the movie was unloaded System.gc() was called, which is only available in CS4. The advantage of this technique is that after a number of times hammering this button, it would become apparent if something was stuck in memory. Testing different modules of code made it much quicker to pinpoint where the problem was.

In summary, game development brings up many new challenges, some which seem to take you deeper and deeper into the rabbit hole. Luckily, the end result is very rewarding - improving gameplay is a very satisfying job.

23rd April 2009
Today is an exciting day, after months of sweat and tears and spitting up hairballs! Our new game, Meowcenaries goes live... cat on cat violence isn't pretty, but it's kinda cute. lolz!!
http://www.adultswim.com/games/index.html

17th February 2009
More recent work goes online: Sega Pool and Sega Columns

24th December 2008
Merry Christmas!

20th December 2008
Our company is featured in this month's Develop magazine! It also features a photo of our team on games quiz night. Unfortunately for us, they published the results! :S http://www.developmag.com/

28th October 2008
The latest project we've been working on for the last six months is coming to fruition! Playsega Goes Live

21st August 2008
Featured on PV3D Showcase
It's quite an honour to be featured on the Papervision blog for the 100 Best Films project. Thanks to Papervision and respect due to Tudor El'Deng who I collaborated with!

2nd May 2008
3D Experiments
100 best films
is an exciting new project I'm working on. This is still in beta (Yes I'm using geek words now) and is a fully dynamic swarm containing Time magazine's top 100 films. Check out the ripple effect, if you don't see it you're missing out. Also, is it the first Papervision site to have a 3D preloader? There are a few niggles with the interaction and the graphics, but as soon as we've ironed this out it will go straight onto the front page!

3rd March 2008
Colin Moock in London
I had the pleasure of attending Colin Moock's Actionscript 3.0 tour in London which cleared up a few details but generally confirmed a lot of ground we have already covered in Actionscript 3.0. Several senior members of Adobe were present and so we had a rare opportunity to get some insight into the thinking behind the Flash / Flex divide and the reasons for it. The two are quite separate and lack interoperability and this is a result of their being developed at opposite ends of the development spectrum to solve quite different issues.

My impressions were that we will see an effort to converge the working methodologies between the Designer/Animation camp and the programming camp; efforts which go much further than Thermo. This is good because it's exactly what we need to maintain the spirit of creativity that has always underpinned Flash.

27th February 2008
Using maths for visual layout
Okay, here's one that ought to be easy but is in fact hard. Distributing items on the screen dynamically.

Scenario: I have a random number of items, maybe being pulled in from xml, and I want to place movieclips on the screen in a grid which are placed evenly in columns. Thing is, how many rows and how many columns do I need? Especially as the height and width of my movieclip may not be square.

To distribute mcs of lampposts you're likely to have more mcs running horizontally than vertically - as opposed to distributing mcs of snakes, which you are more likely to want to stack vertically.

Well the most effective way of doing this I could muster was to get the square root of the total number of items and then multiply that by a suitable aspect ratio.

For example. Let's say I want to distribute to a square stage 500 x 500.

I have 36 items. So, I get the square root which is 6.

var array = [0,1,2 ... , 35];
var sqrt = Math.sqrt(array.length);

Next I'll add these together to get a total 12.
var total = (sqrt + sqrt);

Now I want to multiply this by an aspect ratio to work out the distribution. If the mcs are twice as wide as they are high, the aspect ratio is 2 and an ideal distribution would be 4 columns and 8 rows. 4x2 = 8 and 8x1 = 8... width and height match.

So my total, 12 needs to be somehow split into 4 and 8.

My approach is to divide 12 by height and length ratios, i.e. 1(h) + 2(w) = 3.
var ratiodiff = (total/(ratio+1));

Then multiply the result (4) by the ratio 2, so 4 * 2 = 8.
var ratiodiff = (total/(ratio+1)) * ratio;

Now I can use this for my number of rows, and the remainder for the number of columns.
var cols = total - ratiodiff;
var rows = total - cols;

Now, instead of 32, if i was using scraggly odd numbers like 73 or 113, I can apply the same maths to get an approximation. For 73, the result for the number of columns is 5.7 which is no use... we need a whole number.

Therefore I'll use the ceiling of the number, 6. Then I'm assured of having enough space for all the movieclips .. although there'll be some gaps at the bottom. I'll be treating my columns like buckets.

var cols = Math.ceil(total - ratiodiff);

Since cols is now an approximation I need to calculate the rows differently to make sure I've got all the items from the original array.

var rows = Math.ceil(array/cols);

Wow. That was intense. I'm sure there are other approaches to this problem, and many of them maybe better than this, but this works and it'll suit me for now.

8th January 2008
Spooky 3D
I'm getting used to Papervision3D now, and here's my first effort,a dystopian Terry Gilliam style machine, http://www.michaelewing.co.uk/spooky3D/. The use of transparency helps build the interesting gyroscope effect although next time around I'd use more planes for the screens as mapping them over the sphere makes them look a bit rough. The relative ease with which the 3D object could be controlled with the mouse position was also really encouraging.

3rd January 2008
My Interview
Check out my interview about this site and a whole load of Flash related stuff at http://www.designinterviews.com.

20th December 2007
Creating cloud effects in Flash
In a similar style to the randomising splatter below, attachMovie helped me out again for a new challenge at work. I was looking around for good examples of cloud animations in Flash, and there was nothing out there that looked good enough. The problem was re-creating the random swirling of vapour. The Perlin Noise filter in Flash held some premise, but it turned out that there was a much simpler and more effective solution and this skyscape is the result. The code tweens the alpha, rotation and x and y of various sample bitmaps within a limited range.

21st November 2007
Creating splatter effects in Flash
Have a look at my latest splatter experiments I have been working on for work. Here's the code:


function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNum;
}

for(var i:Number = 0;i<32;i++){
randRot = randRange(-180,180);
randScale = randRange(1,100);
centre.attachMovie('blob','blob'+i,centre.getNextHighestDepth(),{_xscale:randScale,_yscale:randScale,_rotation:randRot});
}


This complexity is created randomly by a few simple rules and uses just one animation which is a couple of frames long.

The animation is of a blob or drip squeezing shut at one end, before moving in the opposite direction. In Flash, this animation is a movieclip called 'blob', and attached to the stage, as above, 32 times. Each duplicate is rotated and scaled randomly, so that when each animation plays simultaneously, it appears that each blob is moving away from a central point over different length distances.

The drips were created by attaching the animation of a falling drip to the end of the 'blob' movieclip, and then rotating it with the inverse rotation of 'blob' so that the drip orientation is corrected to becomes vertical.

Finally, the splatter animation is attached to a random x/y co-ordinate repeatedly with onEnterFrame to create an infinite loop.

19th November 2007
www.cyriak.co.uk - very funny animator from Brighton. Moo! in particular is a fine piece of work indeed. The fly-by of cow DNA is an image that will not leave me anytime soon.

31st October 2007
Western technology companies are helping governments suppress freedom of expression. Click below and sign the pledge.



15th October 2007
Continuing on from my last post, it seems Adobe are already on the case after my colleague pointed me towards Thermo. Previously I pointed out that Adobe's latest offerings were leaving designers out in the dark. Perhaps this new project will buck the trend.

12th October 2007
The design / development gap is widening and it's industry wide. Traditional modes of working in Flash are fast disappearing in favour of a much more technical approach. There are massive benefits to this, not least the ability to build ever more exciting projects. Everything from data manipulation, user interaction, complex visuals and code management benefit from this way of working. However, let's not forget the original appeal of Flash. When I first played around with Flash, my concept of it was Photoshop with interactions. It was a design tool. The freedom to start designing, and then code and design as I went was fun. What a great combination. It bridged a divide between the realms of creativity and technology, and anyone who wants to learn how to make really exciting user experiences without getting bogged down in theory can learn a lot from it. These days, however, there is less and less room for this type of working. Flash projects these days tend to require a great deal of traditional programming methodology to avoid becoming cumbersome and unprofitable. This makes a lot of sense, but something still niggles.

Why aren't AS3, Flex and the other advances in Flash not intuitive to designers? Flash used to make this complex stuff easier for visual people, so why are increasingly technical minds required to understand it? What we need is some bright ideas for new ways of working. We want all the advances the technology offers, but we need to be fast enough to think of great concepts for working that maintains that spirit of creativity which Flash offers.


5th October 2007
This week has been a chance to find out more about Papervision, Away3D and APE physics engine. The renewed excitement came after a colleague pointed me towards the Magic Carpet. Bringing together physics and 3D like this is very impressive and I'm all over figuring out how to leverage it and over the next few weeks I plan to keep this page up to date with what I find out. After downloading the class packages and playing around, one question that came to mind was how to catch mouse events so I could interact with the 3D?

The answer I learn, is an event called MouseEvent3D, built into Away, which means the 2 dimensional x,y co-ordinates can be converted into the x,y,z co-ordinates of the 3D world. There is also a set of functions which allow mouse events to be attached to objects in the 3D world. With this in mind, extremely rich and immersive flash experiences are on the cards.

3th October 2007
Well shame on me. Tomorrow never comes. So now it's time to catch up on the maths for a scrollbar. There are probably many ways of doing this, but this is my favourite because it's easy, and this example uses a scroll track that is of no significant height. i.e. just a blob or something. Three bits of information are needed. Firstly, the height of the overhang from the movieclip that is being scrolled. So:

overhangHeight = movieclip._height - scrollbar._height;

The next piece of information is how far the scrollbar has been dragged. This is a percentage of the height of the scrollbar.

percentScrolled = (100/scrollbar._height) * distanceScrolledSoFar;

The final piece of information depends on the previous two and tells us the distance the main movieclip has to move to match the position of the scrollbar. I called it offset.

offset = (overhangHeight / 100) * percentScrolled;

So now we have the number we need to move the main movieclip. mc._y = (0 - offset);

Very simple but useful to have it written down, lest I ever have to try and remind myself again.

26th September 2007
Creating scrollbars is simple, right? Well, building one from scratch requires some head scratching and a feeling of deja vu. The best advise is to do it once and never again. However, in a recent project, the graphics for the scrollbar were quite unique and didn't easily fit into any prebuilt component. The thumb track was a fixed size and the gutter was a little bit...well... bendy.

The key thing in a scrollbar is to work out the ratio that is needed to move the target movieclip (which typically would sit underneath a mask with the same bounds of the scrollbox). This needs to account for the size of the scrollbox. When the thumb track is at the top of the box, we want the position to be relative to the top of the movieclip. However, when the thumb track is at the bottom of the scrollbox, we want it to be relative to the foot of the movieclip. So some maths is involved which I will run through tomorrow.

25th September 2007
Today, let's look at how to get a movieclip to point towards the mouse from a fixed location. This is a lot easier when tracking in one direction. For example, on my site, the TV is able to track the horizontal (x) coordinates of the mouse separate to the vertical (y) coordinates. All that happens is that one movieclip is nested in the other, both have a timeline, and the actionscript calculates a frame proportional to the position of the mouse for both movieclips respectively.

In a more recent project, it was an flv video that needed to track the mouse. Therefore, both x and y had to be tracked simultaneously. To achieve this it became necessary to establish the orientation, or angle of the mouse pointer in relation to the target. If we were to draw an imaginary triangle we can calculate the angle.

The three points to use are the mouse position, the target's position and the point where the x value of the mouse hits the y value of the target, forming a right angle triangle. We can then establish the length of the adjacent and opposite sides of this triangle and use trigonometry to calculate the angle. In actionscript, inverse tan can be achieved with Math.atan(opposite/adjacent); After this, a little tinkering around is necessary. The result is in radians and needs to be converted to degrees.

Then the position on the timeline has to be worked out using a formula like this: Math.round((360/number of frames) * result). A final sprig of easing is the final touch for a very cool effect.


24th September 2007
Over the next few days let's take a look at mousetracking in actionscript. My task was to make a movieclip 'point' to the location of the mouse. The primary problem, as scripters will be aware is that as soon as the mouse tracks away from the bounds of the flash movie, the position of the mouse can no longer be tracked. One way to get around this is javascript, which can communicate the position of the mouse to Flash. Another is to use an invisible movieclip which overlays as much of the browser or screen as possible. In anycase, as soon as this issue is addressed there is a bit of maths involved to work out where the movieclip would point. I shall look at this tomorrow.

27th August 2007
I have undertaken my new role at Avenue A|Razorfish and shall be going straight into games development and RIA/rich media production. Which has led me to look into the explosion of complex actionscript code that's now in development. For example, 3D, physics, filters, animation sequencing. Pulling together this technology creatively is the challenge, as well as untapping it's potential. That's where the fun lies too.


17th July 2007
MewTube wins Site Of The Day award at the Web Design Library Showcase.

'This website is maximum Flash - excellent - with high impact graphics, motion, and soundtracks. Every click on this designer's site is a total trip.'

16th July 2007
Very soon I will be enjoying my first 10,000 days of being alive.

13th May 2007
Squids game goes online! A small project that got bigger than expected, but after plenty of coffee and a few late nights it's finally finished.

1st May 2007
Play with this! I've been getting into the Fuse animation tool and it's extremely good fun.

18th April 2007
Wow it's been a long time since I updated this. Well I have a plush new job doing some serious actionscripting, so not looking at the moment, agencies. However I am looking out for piecemeal projects to work on in my spare time. I will do a good job! AS3 is around the corner, and I want to brush up on this, as well as games and apps development. I'm currently working on a game using Pathfinding algorithms, it's gonna be awesome man.

31st August 2006
It's a whopping two months later, the extraordinary speed at which the summer flew by has increased my belief that we are accelerating towards an unstoppable time vortex, which is gathering such extraordinary pace that eventually we will act out our daily lives as if somebody was holding the fast forward button. I am now just 24 hours from being accommodated in a new pad in central London. Oh yes, we're going for the big time now. More details to follow.

2nd July 2006
It was the perfect day for my flying lesson, if a little hazy in the 31 degree heat. But,. as thing said in top gun, I'm going to take a shower. When we arrived at the air strip, we discovered that Dancing Ken (no relation to Ken of Ken's disco) , the local monster raving loony candidate had turned up, which was a big morale booster, and encouraged me to really push for England and put on a good performance in the air. Well chocks away, the instructor talked me through taxiing, and taking off, which was definitely uber cool and we were in the air, being careful not to enter restricted air zones and getting shot down. At about 3,000ft the temperature had dropped to 20c. Realising we had the power to control our own air conditioned destiny, we ascended towards some clouds, to around 7,000ft where the temperature dropped again to 10c. At some point during this well executed operation, we passed some big castle, some big hills and a field with 'Help!' written on it in corn. Having fully absorbed the entirety of these landmarks, we busied ourselves with some manouvres. I got to try a few steep turns, and our instructor wowed us with an 8-turn and a side slip which was just crazy man. The excitement mounted as we came into land, and air traffic casually mistook us for another plane, causing some kind of airborne traffic jam. Once the confusion was cleared up, we landed safely. After that, we setlled on a post-flight beer in the quintessential air strip beer garden - and a disgruntled Dancing Ken drove off into the distance.

18th June 2006
If, like me, you find typing a bit tedious, you can go straight to this site via http://www.mewing.co.uk

1st June 2006
Roger over and out. I'm going to fly a plane woohoo! I will be cruising through the sky and altituding my charlie tango foxtrot. This excursion is timed for just before I move to London and was paid for by my self-imposed fun tax. Everybody should have fun tax.

28th April 2006
Added Ken to the main menu and made a few tweaks. Don't hide your toasted sandwich maker away. Bloorman must continue his experiments.

18th April 2006
Been making a few murals here and there. One for work, the other for my boudoir, using Dulux sample paints. This stuff is the real deal.

11th April 2006
I've decided we're gonna 'remaster' the Flash movies on here. They were ultra-compressed when they were first put online, back in the old days when people had dial-up. But most people have broadband now. (if you don't, go out and get it, you might like it!).

22nd March 2006
Where's the noise Ken? Try here:
Ken's Spectacular Magic Disco
It's a sprawling syncopating soundscape on a supersonic scale. Don't miss this chance to enter Ken's magic disco dome. Works like a dream on a 2GHz P4 with 512MB. Slower machines might pause or act sluggish, in which case you're missing out on the purity of the drum diorama.

21st February 2006
Ok dude, we are approaching the gripping finale of this problem. I've got most of the pieces of the puzzle together now, and the picture is beginning to look a little more complete. Now it's just those niggling little bits that just don't seem to fit. Fortunately, puzzle busting determination normally sets in around this stage. Now as incredible as it sounds, I must pause on this thrilling roller-coaster of an adventure to tell you something you may not know. A zarf is the holder of a handleless coffee cup. Is that referring to the actual holder, i.e. the owner, custodian, proprietor? because that makes me a Zarf. It sounds amusing, and I could put it at the end of my name, on business cards for example. I'm burning up with curiosity because on the other hand it could be referring to the metal thing that you might stack things like cups on, particularly handleless coffee cups. This condition is known as the 'must Google it' stage. But some things are better left unsearched. Curiosities like this are far too valuable to throw away in pursuit of the cold plain truth. So I relish the dawn of a sensational new beginning in my life, the Ungoogled Age. A celebration of the trivial unknown. That's why, despite four weeks of heated brain exertion and deep soul-searching, I still either don't know or can't remember what the name of that animal Luke rides through Hoth is called. Yeah groovy. No don't tell me ...

9th January 2006
How does it affect people to use instant messenger services like MSN and Yahoo? Firstly it seems that time slows down. It seems to take a few hours to have an exchange that would last maybe fifteen minutes in the real world. Secondly, there's no non-verbal communication, which seems so important in real life exchanges. If I have an IM conversation my face gets bored, because there's been such a lack of expression in the communication. It would seem that if you spent all your time communicating with IMs, then your body would atrophy, apart from your eyes and hands. Also, there's very little spontaneity. Everything you say can be planned and edited before the message is recieved. Which seems a little boring. In a real conversation, there's a frisson of adrenaline, in that anything you say can never take back, and you have to respond much quicker to outside events without really having anytime to think about it. You're out there, communicating constantly in the public domain wherhas on IM, the communication is drip fed backwards and forwards. So what's so good about IMs? Why are they popular? Well after much thought, I realised the answer was very simple. And here it is:
SMILEYS SMILEYS SMILEY SMILEY SMILEY :) :):):):):):):):):):):):):):):D :D :D :D :D :DDDDDDDDSMILEY SMILEEEEEEEEE

22nd December
"How am I not myself? How am I not myself? How am I not myself? How am I not myself? How am I not myself?

I reject the unnameable!"

I heart Huckabees 2004

1st December
There have been no entrants to my book writing competition. Nobody wrote in with a gripping 50,000 word novel for a chance to see my name in print. It's almost as if people don't want to see me take the credit for their hard work! Well I'll leave the competition as an open-ended project.

Wow, writing a book will be difficult. A blog is hard enough. Firstly I never keep it up to date and also I keep thinking what I've written is rubbish, so I keep wanting to delete the old entries. I haven't deleted anything yet (well not that much), on the advice of a wise old man who said 'be present, be true. tell yourself you rock big time for sure man"

28th November
Their law. I've got the poison, I've got the remedy, I've got the pulsating rhythmical melody. Bbbbbbbbbbbrrrrrrrrrrrrrrrrummmmmmmmmmm Brrrrrrrrm. Cardiff Arena shakes, wall cracks. Glass shatters. Awesome.

24th October
Everybody calls me mew, I dreamt I got stuck on a roof, I doze off at every opportunity and today I caught myself rubbing my head on the wall and finding it quite enjoyable. Am I turning into a cat?

21st October
Well the guys at work say I should make a blog, because I hardly ever update this site. Where's the time to write about life, when there's not even enough time to live it. In five days its the big move to the new pad. It's BIG. People ask me what its like and I don't remember, but I don't care, BECAUSE ITS BIG. I'll miss the Bristol nightlife though, and all the strange and wonderful people I've met along the way. i think Bristol rock for sure man!


22nd August 2005
Ok I was ill but I'm feeling a better now. .. I'm so happy I'm typing on my keyboard like it's a piano. Now I'm playing with my back to the computer... there's a cheesy grin on my face. Now I'm typing with my feet ..now with my rear end periodically while I play a cappella on the trombone. I'm wearing tailcoat and fins. All the cowboys in the whole saloon are dancing along, smashing bottles on the counter and chewing on tobacco. What an atmosphere.

8th August 2005
Oww oooh oohhh ow ow ow ow ow. It hurts. Why did I not get registered with a local doctor earlier. :'(

2nd August 2005
Where's the nearest Japanese rock club? We want to put on the shades, manga hair and body pop till 4am. There must be a word for the thing where someone spots the obscure quote you put after your MSN messenger name from that 1970s art film, or from that rare lyric on an Icelandic rock EP and they start talking to you about it. No not anorak.

31 July 2005
Bring it on

10th July 2005
Normally I would go into town for a night out under the careful supervision of my roommates, however this weekend I went out by myself. Lucky for me, Bristol is a very friendly nightspot and I was welcomed into the fray. Unfortunately, with a few drinks down, my ability to perform simple mental tasks was much reduced. For example, 1. how many drinks have I had? 2. How much have I spent? and 3. how much have I embarrassed myself so far? were questions which, mysteriously enough, didn't spring to mind for the whole evening.

Fortunately the people I met were having exactly the same problems so a good time was had by all well into the...er..next day.

8th June 2005
Today the sun is out and it's a great day, eventually, the Gulf stream will overload and the climate of the ensuing years will be more akin to a nuclear winter in Moscow. But Hey kids! Make the most of the sunshine while you can!

Last weekend I descended on the city of lights and dreams, London and met some friends from my mysterious past and reached nirvana above the city skyline on the London Eye. (just pushed 'Smells like teen spirit' on my (non-existent) iPod). All donations welcome. Take care kids.

24th April
I'll try and say something now and actually make sense. It's been one year since returning to the UK. So here's some exciting new websites to look at. Infinite Cat.. the single concept websites now get more complicated.Also see the adventures of the well-adjusted Salad Fingers. I've been to Spain last weeken