Ok, ok, I can hear you now, "don't use scenes, silly boy!", but really, they're the best compromise to allow animators to freely draw avatars and allow me to control the avatar orientation with each scene.
Animators would send me swfs containing scenes named as each avatar orientation (N, S, E, W etc). I would then load these swfs into the game and use the scenes to control the avatars orientation. The problem is I couldn't access any of the scenes I got from the animators swfs. My proof of concept worked perfectly, but when I got the real stuff, it wasn't working!?
If I checked loadedMC.scenes.length, I would get a value of 1 instead of the expected 5, yet it would still cycle through all the scenes, but where were they?
I asked for the fla's and all seemed fine. However there was 1 minor difference: the animators were using Graphic symbols on the timeline in each scene, not MovieClips. I added a blank MovieClip to each scene and hey-presto, the scenes were accessible!
So if you use scenes, make sure you have MovieClip symbols inside them, otherwise you won't be able to access them at run-time.
*** Update ***
Please read comments to this post
04 November 2008
16 October 2008
My Intel iMac is dead, logic board failure, how's yours?
With much dismay, I resigned myself to the fact my 2006 17" Intel iMac is kaput. I've had it since July 2006, so in just 2 years and 3 months it's died. It's the first total failure of any PC I've ever owned and also turns out to be the most expensive. To replace a logic board here in Canada costs around $1000, so it's an economic write off, I might as well buy a new machine.
When I bought the machine in the UK, back in 2006 I didn't bother getting AppleCare as I thought it was just another extended warranty you don't need. Somewhat ironically I think there's a European consumer law (which I'll have to research), that covers you outside the 1 year manufacturers warranty, but now I'm in Canada, I doubt that applies.
Two things disappoint me here:
1) It's shattered my perception of Apple producing reliable machines. I've been using Macs for years with no trouble with the machines at all. The expensive price tag stood for style and reliability - something that was made to last.
2) The sheer expense to myself. What ever I do, it's going to cost me. I cannot afford another Mac for a few months now and I'm back to using my old Sony Vaio, which the Mac replaced and is still going (it just about runs Flex 3). I need a machine to do my work, but can I really justify buying another iMac at $1500+ ? In Canada, Apple doesn't offer any credit schemes and I'm only allowed a $500 credit card limit as I've not lived in the country for long. It pains me to be actually considering buying a PC with Vista on it!
Doing a bit of Goolging and speaking to the guy in the Apple Store, it seems early Intel iMacs are prone to this problem. Potentially thousands of machines could be dropping like flies, out of warranty and at great expense to the consumer. Apple are probably keeping this one quiet, so please post here if you've had a logic board failure (or any other catastrophic problem) with the 2006/2007 Intel iMac models (the white ones).
**** UPDATE - MARCH 2011 ****
Thank you everyone for posting. There is a petition you can sign to recall 2006 iMacs.
http://www.petitionspot.com/petitions/imacrecall
Alas I ripped my iMac apart to get the HDD out and sent it for recycling. But if you still have your dead iMac, it may be worth signing the petition and get on a Class Action Lawsuit.
When I bought the machine in the UK, back in 2006 I didn't bother getting AppleCare as I thought it was just another extended warranty you don't need. Somewhat ironically I think there's a European consumer law (which I'll have to research), that covers you outside the 1 year manufacturers warranty, but now I'm in Canada, I doubt that applies.
Two things disappoint me here:
1) It's shattered my perception of Apple producing reliable machines. I've been using Macs for years with no trouble with the machines at all. The expensive price tag stood for style and reliability - something that was made to last.
2) The sheer expense to myself. What ever I do, it's going to cost me. I cannot afford another Mac for a few months now and I'm back to using my old Sony Vaio, which the Mac replaced and is still going (it just about runs Flex 3). I need a machine to do my work, but can I really justify buying another iMac at $1500+ ? In Canada, Apple doesn't offer any credit schemes and I'm only allowed a $500 credit card limit as I've not lived in the country for long. It pains me to be actually considering buying a PC with Vista on it!
Doing a bit of Goolging and speaking to the guy in the Apple Store, it seems early Intel iMacs are prone to this problem. Potentially thousands of machines could be dropping like flies, out of warranty and at great expense to the consumer. Apple are probably keeping this one quiet, so please post here if you've had a logic board failure (or any other catastrophic problem) with the 2006/2007 Intel iMac models (the white ones).
**** UPDATE - MARCH 2011 ****
Thank you everyone for posting. There is a petition you can sign to recall 2006 iMacs.
http://www.petitionspot.com/petitions/imacrecall
Alas I ripped my iMac apart to get the HDD out and sent it for recycling. But if you still have your dead iMac, it may be worth signing the petition and get on a Class Action Lawsuit.
01 October 2008
Flash Player Audio Sync and Frame Rates
So, it's the end of my hiatus since I last posted. I got married, changed job, house, car - actually pretty much all my life.
I'm back to creating Flash games, which is always enjoyable. I'm currently building a multiplayer world and various games attached to it. At the moment I'm building a Dance Dance Revolution type game which initially sounds simple, and it would be, but for the fact the Flash Player frame rate is all over the place.
If you have a 24fps movie, each frame should fire every 41.166* ms - or they *should*. In reality the frame rate can vary +- 20ms, which means after a short while the animation drifts away from the audio quite considerably. This problem is caused by a number of factors, mainly CPU speed/load and platform. It's bad on PC but terrible on an Mac.
So the problem is how do you get your beat hits to be absolutely precise to the music? I've managed to solve this problem by creating a "deltaTime" variable which calculates the drift per frame. If you know how many milliseconds it should be and how much drift you have, you can convert that to pixels to move, based on frame rate.
The net effect is a bit weird. The beat hits are spot on with the music, but this comes at a price because as the instructions scroll down the screen, the distance the instruction icons move is different each frame. This results in a jerky scrolling motion.
I'm hoping FP10 has more accurate frame rates that would solve this problem.
I'm back to creating Flash games, which is always enjoyable. I'm currently building a multiplayer world and various games attached to it. At the moment I'm building a Dance Dance Revolution type game which initially sounds simple, and it would be, but for the fact the Flash Player frame rate is all over the place.
If you have a 24fps movie, each frame should fire every 41.166* ms - or they *should*. In reality the frame rate can vary +- 20ms, which means after a short while the animation drifts away from the audio quite considerably. This problem is caused by a number of factors, mainly CPU speed/load and platform. It's bad on PC but terrible on an Mac.
So the problem is how do you get your beat hits to be absolutely precise to the music? I've managed to solve this problem by creating a "deltaTime" variable which calculates the drift per frame. If you know how many milliseconds it should be and how much drift you have, you can convert that to pixels to move, based on frame rate.
The net effect is a bit weird. The beat hits are spot on with the music, but this comes at a price because as the instructions scroll down the screen, the distance the instruction icons move is different each frame. This results in a jerky scrolling motion.
I'm hoping FP10 has more accurate frame rates that would solve this problem.
25 March 2008
The Statistics of Argh!
You know those days when you just cannae take it any more (Capt'n) and end up typing "AAAAARRRRRRRRRRRRRRGGGGGHHHHH!!!!" into Google? Yet have you ever wondered how many AAAA's RRRR's GGGG's and HHHH's to use?
Well here's the answer:
http://osteele.com/words/aargh
The most common spelling appears to be "argh", which is really more of an apathetic sigh than a gut wrenching scream of annoyance.
Only 14 people seem to have gone with my spelling of 5 A's and 15 R's. You certainly need more than one A to get it going and there definitely needs to be more R's in the "argh" as I consider that the "body" of the scream when it audibly starts to blend with the multitude of A's.
What the statistics don't show are the G's and H's which, in my opinion, round the scream off. You need a good few G's to release that guttural sound of pain, followed by a few strained, aspirated H's as your lungs, exhausted of air, begin to collapse.
You see? T'interweb has its uses!
Back to work.... AAAAARRRRRRRRRRRRRRGGGGGHHHHH!!!!
Well here's the answer:
http://osteele.com/words/aargh
The most common spelling appears to be "argh", which is really more of an apathetic sigh than a gut wrenching scream of annoyance.
Only 14 people seem to have gone with my spelling of 5 A's and 15 R's. You certainly need more than one A to get it going and there definitely needs to be more R's in the "argh" as I consider that the "body" of the scream when it audibly starts to blend with the multitude of A's.
What the statistics don't show are the G's and H's which, in my opinion, round the scream off. You need a good few G's to release that guttural sound of pain, followed by a few strained, aspirated H's as your lungs, exhausted of air, begin to collapse.
You see? T'interweb has its uses!
Back to work.... AAAAARRRRRRRRRRRRRRGGGGGHHHHH!!!!
18 March 2008
Use Weak References for Your Event Listeners
Please read this:
http://www.gskinner.com/blog/archives/2006/07/ as3_weakly_refe.html
Using weakly referenced event listeners means an object can be cleared during Garbage Collection even if there's an event listener acting upon it.
It's very useful when you're spawning / deleting a lot of objects, in my case bubble "bullets" that I'm firing at targets underwater.
It saved my bacon (and my forehead) as I've been banging my head on my desk wondering why objects I thought I'd removed still persisted in memory.
The fact it's not a default setting and not very well explained, nor is its importance highlighted (this should be stapled to the front of the Flash CS3/Flex DVD box), is bloody annoying.
Thanks Grant.
http://www.gskinner.com/blog/archives/2006/07/ as3_weakly_refe.html
Using weakly referenced event listeners means an object can be cleared during Garbage Collection even if there's an event listener acting upon it.
It's very useful when you're spawning / deleting a lot of objects, in my case bubble "bullets" that I'm firing at targets underwater.
It saved my bacon (and my forehead) as I've been banging my head on my desk wondering why objects I thought I'd removed still persisted in memory.
The fact it's not a default setting and not very well explained, nor is its importance highlighted (this should be stapled to the front of the Flash CS3/Flex DVD box), is bloody annoying.
Thanks Grant.
Subscribe to:
Posts (Atom)