tag:blogger.com,1999:blog-246678122024-02-20T11:46:44.958-07:00Lapsus BloggusSoftware Engineering and Project ManagementDan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.comBlogger50125tag:blogger.com,1999:blog-24667812.post-22640751539914541202011-08-25T10:14:00.000-06:002011-08-25T10:14:51.917-06:00Flash Player 10.3.183.7 ReleasedGlory Be!<br />
<br />
All the issues from the catastrophic release of Flash Player 10.3.183.5 appear to have been fixed. <br />
<br />
<a href="http://get.adobe.com/flashplayer/" target="_blank">get.adobe.com/flashplayer</a><br />
<br />
Still counting the cost of the previous update - well into the thousands of dollars. On the bright side, the hypertension it gave me didn't cause a heart attack!<br />
<br />
Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com0tag:blogger.com,1999:blog-24667812.post-72480724873117112762011-08-16T17:14:00.004-06:002011-08-17T12:13:29.833-06:00Flash Player 10.3.183.5 AS1 Shared Library BugI came across a critical bug in Flash Player 10.3.183.5, a security update that was released on Thursday 11th August 2011.<br />
<br />
Basically, if you use shared libraries from circa Flash 6 / AS1 with a 2 frame preloader that uses either nextFrame() and/or gotoAndPlay(1), the whole containing swf movie will unload itself and you're left with a blank screen.<br />
<br />
Here's the detail:<br />
<a href="http://forums.adobe.com/message/3865740" target="_blank">http://forums.adobe.com/message/3865740</a><br />
<a href="https://bugbase.adobe.com/index.cfm?event=bug&id=2940617" target="_blank">https://bugbase.adobe.com/index.cfm?event=bug&id=2940617</a><br />
<br />
Google Chrome users get Flash updated immediately and automatically and were the first to call tech support. The legacy games would load and then... nothing! Calls from IE and FF users soon followed. As we have lots and lots of swfs for old games still in use, a mild wave of panic started to fill the office. <br />
<br />
Luckily the fix is simple, it's just a case of altering the preloader by removing the offending nextFrame() or gotoAndPlay(1). We ended up removing the preloader entirely as the 40k file size of the shared library is tiny by today's standards. Unfortunately for us, we had to do this on 400+ fla's, test them and release them as a hotfix to our clients.<br />
<br />
Another cracking update from Adobe! In the UK, this is known as "dropping a bollock!"<br />
Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com2tag:blogger.com,1999:blog-24667812.post-28465310633958313902011-02-24T22:16:00.000-07:002011-02-24T22:16:27.354-07:00Particle Code<a href="http://www.particlecode.com/">Particle Code</a>, unlike its name suggests, is a new cross platform SDK for mobile devices. I first became interested in it when I discovered Actionscript was one of the supported languages.<br />
<br />
The basic idea behind Particle Code is to write once and deploy eveywhere and the language you chose to write your code is up to you. The code will then be compiled to native code and packaged as apps for:<br />
<ul><li>iOS</li>
<li>Android</li>
<li>BlackBerry</li>
<li>Windows Phone 7</li>
<li>J2ME</li>
<li>Symbian</li>
</ul>Compiling to native code is an important difference between Adobe's paradigm: AIR apps deployed to mobile devices that require the AIR runtime installed in order to work.<br />
<br />
This looks like a great idea and has the potential to save hundreds of hours porting an app between devices. However, even though Actionscript is supported, it is a completely separate platform to Flash/Flex, <b>you will not be able to write a Flash Platform application with Particle Code.</b><br />
<br />
Looking at the Particle Code API, it looks fairly similar to the way you would develop apps in Android, you can use Java or Actionscript to create your apps, though I suspect more will be added to that list.<br />
<br />
From a Flash Platform developer perspective, there are lots of things missing, MovieClips, Sprites etc. plus you won't be able to do any E4X. You will undoubtedly need to write more code to get anywhere close to the animation capabilities of Flash, but the amount of platforms you can deploy to, may justify that extra effort.Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com0tag:blogger.com,1999:blog-24667812.post-19252722174015490622011-02-09T14:41:00.000-07:002011-02-09T14:41:10.373-07:00Flash Player 10.2 now availableFollowing my<a href="http://lapsusbloggus.blogspot.com/2010/10/xmlappendchild-flashplayer-10-known-bug.html"> previous rant</a> about some issues in FP10.1, you'll be pleased to know they're still there in 10.2. Obviously this fix is waiting for the 11.0 release.<br />
<br />
Still, it's good to see that the CPU usage for video is vastly improved with <a href="http://www.adobe.com/devnet/flashplayer/articles/stage_video.html" target="_blank">Stage Video</a>. However, this comes at a price as it bypasses the usual software rendering pipeline and passes the stream straight to the hardware. Therefore you can only rotate in 90º increments and you can't skew, transform or convert to bitmaps. This is a pure video acceleration feature, which is good news as it saves battery time and will hopefully cause Apple to reconsider its increasingly irrational position regarding the FlashPlayer on iOS.<br />
<br />
Although I wouldn't put much faith in that - Mac users beware - this is a known issue:<br />
<i>"On some Macintosh systems with NVidia 9400, GT 320, or GT 330 GPUs, live video streams render all black with hardware acceleration, or all white when using the software decoder."</i><br />
<br />
Other new features include full-screen support for multiple monitors, hardware rendering support for IE9, custom native mouse cursors (use responsibly people!) and sub-pixel text rendering. That's great news if you're Chinese - you may actually be able to read something in 12pt. text!<br />
<br />
This looks like a good "point" update, plus the 64-bit "square" version is now out of beta too. Time will tell if I have to go through my API's and fix a load of things as I did for FP10.1, but so far it looks impressive.<br />
<br />
<a href="http://get2.adobe.com/flashplayer/" target="_blank">FlashPlayer 10.2 Download </a><br />
<br />
<a href="http://kb2.adobe.com/cps/890/cpsid_89050.html" target="_blank">FlashPlayer 10.2 Release Notes</a>Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com0tag:blogger.com,1999:blog-24667812.post-29442719895388254282011-02-02T17:39:00.005-07:002011-02-02T18:13:58.422-07:00Google vs Bing - my tuppence worth.As you probably know already, Google is accusing Microsoft of copying its search results on the Bing search engine. you can read a detailed account of the complaint here:<br />
<a href="http://searchengineland.com/google-bing-is-cheating-copying-our-search-results-62914">Google: Bing is Cheating, Copying Our Search Results</a><br />
<br />
If you don't want to read all that, it basically says that Microsoft was using IE8 to capture the result of what people were searching for on Google, then copying that result, which would eventually appear on Bing. Google discovered this by adding "synthetic searches", searches made of random strings such as "mbzrxpgjys", added by Google engineers, that would only return results on Google itself. Strange, then, that they started to appear on Bing a few weeks after the Google engineers started searching for those terms using IE8 with the Bing Toolbar and the Suggested Sites feature switched on.<br />
<br />
Is what Microsoft doing illegal? It's certainly cheeky, yet many sites use Google's search, albeit branded with a Google logo. I think the key to this is IE8.<br />
<br />
The article above examines the T's and C's of IE8 and the Suggested Sites feature, which has 2 key points:<br />
<ul><li>"<b>addresses of websites you visit are sent to Microsoft, together with standard computer information."</b></li>
<li><b>"</b><b>Information associated with the web address, such as search terms or data you entered in forms might be included."</b></li>
</ul>By accepting these terms, you are in effect allowing IE8 to act as spyware, to monitor your web activity. It may well be used to improve your search results on Bing, but it also has the ability to glean information from Google search.<br />
<br />
Personally I think passing off the Suggested Sites feature as something other than what it is - spyware - is dodgy in the first place, but the T's and C's probably do give adequate warning. Obviously information gathered by Suggested Sites is used to improve the search results for Bing, which is fair enough, but was the ulterior motive to scrape results from Google?<br />
<br />
Aggregating results from search engines is common practice and can be quite useful, but if Microsoft want to use Google results in Bing, then it's only fair play to add the "powered by Google" logo next to them. If they're too precious to do that, then they should stop using Google's results, or at least pay Google to use their results without have to acknowledge the source.<br />
<br />
At the end of the day, web searches are based on copying, storing and ranking information from all over the web, it's the forming of relevance and context which is the trick, something that Google nailed in the late 90's. As Isaac Newton admitted to "standing on the shoulders of giants" in order to create the Theory of Gravitation, Bing should be equally gracious if they are to use Google as a part of a utopian search service, vastly superior than its competitors. Bing certainly isn't that.<br />
<br />
Cheats never prosper, unless you're Microsoft, which has arguably spent the last 30 odd years copying other peoples ideas. I'd like to think it's time for Google to give them a good hiding, but I doubt this will go any further than exposing Microsoft's practices to the public. If this did go to court, Google may have to openly explain how its precious algorithms work.<br />
<br />
Google had concrete proof of this issue on December 31st, but waited until February 1st to release its findings - why? Because that was the date of the Farsight 2011 search engine conference, perfect timing to undermine everything Microsoft was to eulogise about Bing. Google seems to want to fight this battle with hearts and minds rather than through the courts (to date at least). Blog posts like this are popping up all over the web and if it only serves to steer your average computer user away from Internet Explorer, that can only be a good thing!Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com0tag:blogger.com,1999:blog-24667812.post-72189674410544980982011-01-20T14:08:00.009-07:002011-01-20T14:36:23.070-07:00HTML5 or HTML? Fallen at the First.I found recent developments from <a href="http://www.w3.org/">W3C </a>and <a href="http://www.whatwg.org/">WHATWG </a>rather humorous, as they don't seem to have agreed on the name for<br />
HTML ... erm ... version 5.<br />
<br />
W3C recently pushed out a load of marketing tat for HTML5 which includes a snazzy superhero-laundry-detergent <a href="http://www.w3.org/html/logo/" target="_blank">logo </a>and the geekiest <a href="http://html5shirt.com/" target="_blank">t-shirts</a> known to man. <br />
<br />
"You have HTML5 on the brain. Tell the world!" is the message from W3C.<br />
<br />
Shame nobody spoke to WHATWG, who are also working with W3C (supposedly) on the specification: <br />
<br />
"HTML is the new HTML5" they declare on their <a href="http://blog.whatwg.org/html-is-the-new-html5" target="_blank">blog</a>. They suggest renaming HTML5 back to plain old HTML and dropping the version number. "Time to move on!", they say. What will W3C do with all those t-shirts!?<br />
<br />
The sad truth is, the organisations that are creating the HTML(5) specification can't even agree on the name, which seems like a case of falling at the first hurdle and doesn't inspire confidence in future developments!<br />
<br />
<a href="http://www.w3.org/html/logo/" target="_blank">http://www.w3.org/html/logo/</a><br />
<a href="http://blog.whatwg.org/html-is-the-new-html5" target="_blank">http://blog.whatwg.org/html-is-the-new-html5</a>Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com0tag:blogger.com,1999:blog-24667812.post-16398099543236213642011-01-12T14:12:00.003-07:002011-01-12T14:26:50.916-07:00IntelliJ 10: A Real Alternative to Flash BuilderHave you ever had a large project in Flash Builder and you need to refactor a whole chunk of code into a new namespace and also have it move the files in SVN?<br />
<br />
Have you tried to run an ANT build and got an "OutOfMemory error:PermGen Space" error and needed to up the memory to 1GB or over?<br />
<br />
Has your machine been bogged down by massive memory/processor usage?<br />
<br />
Much as I like Flash Builder, with its UI features and its ability to publish Flash projects, it has one major flaw: it's built on Eclipse. <br />
<br />
Refactoring code and updating SVN in Flash Builder with Subclipse is possible but it can take a few minutes, plus it does have a tendency to go wrong and the whole SVN project can get addled, causing much grief. Doing the same refactoring job in IntelliJ can take seconds and it will also update all your package declarations to match the new namespace. I can link to and run my ANT or Maven builds in a much more pleasing way, and it never seems to run out of memory, and all the while during coding, refactoring or building I'm using < 200MB of memory.<br />
<br />
With IntelliJ you can debug swfs running in the FlashPlayer, unit test and refactor with ease. The downside is you don't get the memory profiler, the ability to publish Flash projects, or Flash Builder design view (I'm sure most proficient Flex developers hardly use it anyway).<br />
<br />
I've been using IntelliJ 9 for 6 months now (I was previously using FDT), and IntelliJ 10 has added extra support for Actionscript, Flex and AIR. If you develop large scale Flash, Flex or AIR projects, IntelliJ saves time and frustration and is also a great editor for many other languages too.<br />
<br />
Here's the Flex features: <a href="http://www.jetbrains.com/idea/features/flex_ide.html">IntelliJ 10 Flex Features</a><br />
<br />
I still use Flash Builder at home for my own projects. At home I tend to follow Adobe's recommended workflows between Flash Platform applications which all works reasonably well. So it's horses for courses, but for my job which deals with many large Actionscript heavy frameworks, IntelliJ is much more pleasant to use than FDT, FlashDevelop or Flash Builder.Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com1tag:blogger.com,1999:blog-24667812.post-68344311857162003072010-11-04T15:33:00.005-06:002010-11-04T15:40:07.470-06:00FlashPlayer 10.1 Throttling ProblemsWhile the idea to throttle SWFs in inactive or minimised tabs/windows down to 2fps to reduce CPU usage is a good thing, it can cause havoc with SWFs that use both time-based and frame-based timing.<br />
<br />
The frames will tick at 500ms, yet any time based event will still fire after <code>TIMER_COMPLETE</code> or after <code>setTimeout()</code>. You cannot rely on sequencing between the two, which is not a good idea anyway, but potential problems are made worse by the throttling.<br />
<br />
If possible, do not mix frame and time based sequencing (which is good practice), but if you need to know when the SWF is minimised you can listen for:<br />
<br />
<code>Event.ACTIVATE<br />
Event.DEACTIVATE</code><br />
<br />
Now, this works on FF 3.5.15 with FP 10.1, it may behave differently between browsers and FlashPlayer versions, so it could be fairly unreliable.<br />
<br />
In another experiment, I played a silent audio track while it was minimised, this kept the movie running at 8fps, which gave better resolution which was just enough to prevent some of the timer / frame sync issues, but again wasn't 100% reliable.<br />
<br />
In short: don't mix your timers, try and keep it frame based. Until Adobe roll out an event we can use to detect throttling, we're stabbing in the dark.Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com0tag:blogger.com,1999:blog-24667812.post-11130330086111500722010-10-08T12:08:00.007-06:002010-10-08T12:38:04.415-06:00XML.appendChild FlashPlayer 10 - Known Bug. But wait...there's more!I just hit a problem with XML.appendChild not accepting String values when you publish a swf for Flash Player 10.1<br /><br />Doing this:<br /><code>myXml.appendChild("<node>"+value+"</node>");</code><br />Will not work, this will:<br /><code>myXml.appendChild(<node>{value}</node>);</code><br /><br />Which is fair enough as it's strict E4X. What irks me is something that has worked now doesn't, which has caused problems with our custom swc API libraries that I've just spent a few hours fixing.<br /><br />In the <a href="http://kb2.adobe.com/cps/838/cpsid_83808.html" target="_blank">release notes</a> for Flash Player 10.1 there is this entry:<br />"XML.appendChild does not function correctly when published as SWF10; works fine as SWF9. (2340839)"<br /><br />"works fine as SWF9" - thanks! Not "fine" when I'm trying to implement 10.1 specific features.<br /><br />Read those release notes some more and you discover fundamental issues:<br /><ul><li>[FP-1569] AS3 Timeline: Child Sprite ADDED_TO_STAGE event is fired twice. (2300936)</li><li>AS3 Timeline: First frame of Movie Clip animation played twice when created and added to stage with ActionScript. (2520095)</li><li>[FP-4423] onEnterFrame gets called more often than necessary. (2614589)<br /></li></ul> All of which look to be related at some lower level.<br /><br />So as long as you're not doing any Flash development that requires listening to ADDED_TO_STAGE, or that requires accurate timing when adding MovieClips or using onEnterFrame, you will be fine!<br /><br />And I certainly won't be using this post to rant about how such critical issues with fundamental features that have worked correctly for years have passed through Adobe QA with little more than a footnote which itself was missing two important words: "Oops, sorry!"Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com1tag:blogger.com,1999:blog-24667812.post-72452824431295428472010-09-22T07:11:00.004-06:002010-09-22T07:15:09.961-06:00Russ Rolling. It's like Rick Rolling, but worse!Yes, that annoying habit of Rick Rolling is so last decade. The new video of the times is Russ Abbot's "Atmosphere", a #7 UK hit back in 1984. It's pretty awful, but what's worse is that it sticks in your head like a botfly larva.<br /><br />Russ Roll someone today: <a href="http://www.youtube.com/watch?v=RFPLk5mJ1D4">http://www.youtube.com/watch?v=RFPLk5mJ1D4</a> , they'll hate you for it.Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com0tag:blogger.com,1999:blog-24667812.post-65670753624633364652010-05-26T02:02:00.002-06:002010-05-26T02:04:38.318-06:00Time to learn HTML5? No... learn AndroidAll the media hyperbole surrounding the recent Steve Jobs rant about Flash has given HTML5 a boost. Reading various blogs and Apple Fan Boy comments would lead you to believe Flash is dead and we're all going to be out of a job in the next couple of years. This is far from the truth. Already Flash is part of the Open Screen project and there will soon be an AIR runtime released for Android.<br /><br />HTML5 is a long awaited update to HTML and, yes, it will render certain applications of Flash redundant, crappy add banners for one - and good riddance! However HTML5 is still not fully supported by all browsers and until browsers support a Javascript language up to ECMA 3 standard, it just feels like taking a step back into the archaic days of AS1 and Flash 4!<br /><br />Apple don't want to support Flash for various reasons and they will push along with HTML 5 and Objective C apps on their closed software platform. Flash is part of the Open Screen project being adopted by all major mobile phone manufacturers, except one... guess who!? iPhone app development is a tempting prospect but it's current popularity, mainly due to lack of competition, will be eroded in the months to come as the mobile phone giants start to offer their own alternatives. Once this happens, the iPhone will look isolated on its proprietary island as apps able to run on a multitude of devices will begin to dominate the market. However, it will be harder for developers to make money in this open arena. It also remains to be seen if Apple really are turning into the Mobile Microsoft and try to stifle development of open source products and force you to use their OS and apps. Unlikely.<br /><br />Flash, Flex and AIR are perfectly poised to enter the Open Screen app space, so really, you could stick with what you know. Yet, if you're feeling the cold hand of progress pushing your office chair towards the exit, learn HTML5 by all means, learn Objective C if you dare, but those of you with Flash/Flex or Java experience should learn Android as soon as you canDan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com4tag:blogger.com,1999:blog-24667812.post-44125521577267441582009-02-02T12:30:00.015-07:002009-02-02T13:43:07.332-07:00Amazon S3 and the "Cloud"I've recently got into Amazon S3 to backup my files off site and at low cost.<br /><br />If you have no idea what Amazon S3 is, you can read about it <a href="http://aws.amazon.com/s3/" target="_blank">here</a>. <br /><br />Once you've set up your S3 account, you need to be able to connect to it. There are many S3 client products to help you do this. I've tried out the following 3:<br /><ul><li><a href="http://code.google.com/p/s3fs/" target="_blank"><span style="font-weight:bold;">S3fs</span></a> for Linux is free and it allows you to simply connect to your S3 "buckets" via the command line.</li><li><a href="http://www.subcloud.com" target="_blank"><span style="font-weight:bold;">SubCloud</span></a> is essentially S3fs with more functionality, most importantly encryption, https transfer and rsync functionality. This costs $129 for a one off licence.</li><li><a href="http://www.jungledisk.com/" target="_blank"><span style="font-weight:bold;">JungleDisk</span></a> has most, if not all of the features SubCloud offers, but it comes in Windows, OS X and linux versions with JungleDisk Monitor, a GUI application to help you configure your connection to Amazon S3. Most importantly it only costs $20 per licence.</li></ul><br /><br />When you use these S3 clients, your Amazon S3 "buckets", which act like virtual folders as they're probably distributed over many servers, are mounted to you file system like any other drive (or folder depending on your Operating System).<br /><br />Without doubt, JungleDisk is the cheapest and easiest to set up for Windows / OS X, however, I couldn't work out how to get JungleDisk working from the command line on Linux machines. It kept coming up with a problem with a missing domain in the config file?<br /><br />SubCloud boasts faster upload speed and it was easier to set up from the Linux command line, but at $129 dollars, I've not seen anything that would tempt me away from JungleDisk on Windows or OS X. <br /><br />In Summary: Use JungleDisk for Windows / OS X and SubCloud for command line Linux.<br /><br /><span style="font-weight:bold;">The Importance of Encryption</span><br />Files transmitted by the connection software are MD5 encyrpted with your Amazon S3 access and secret keys. In addition to that, you need to be using https to make the connection to your buckets.<br /><br />If you're backing up important and/or sensitive information (which is why you'd want this service in the first place, right?) then you wouldn't want anyone to hack into Amazon or have a dodgy Amazon employee looking at your unencrypted information on their servers. That's why JungleDisk and SubCloud allow you to further encrypt your files using a password that only you (or your organisation) will know. This means the files stored on Amazon's cloud can only be read by people who know that password. <br /><br />This password encryption / decryption happens transparently when using the JungleDisk or SubCloud client software, so once you've entered that password then the file system acts as normal. <br /><br />Now, the problem with that is what if you want to change that password? As far as I can tell, the answer is "DON'T"! Which could be a problem you've just fired a disgruntled IT employee. (please feel free to correct me on this)<br /><br /><span style="font-weight:bold;">Using the "Cloud"</span><br />Amazon S3 looks cheap - very cheap but there are some things to consider before you dive in.<br />Firstly, lets deal with a few plus points:<br /><ol><li>Amazon infrastructure is vast and the SLA's Amazon provides means your data is as safe as it possibly can be</li><li>It's incredibly cheap, compared to using other back up / hosting options for most home / small business usage.</li><li>File access should also be incredibly fast anywhere in the world, due to the fact Amazon have server farms everywhere</li></ol>But beware:<br /><ol><li>It is initially cheap, but over time, you will always be storing and transferring more and more data too and from the service. It could become very expensive very quickly.</li><li>Over reliance on this service may suck you in. Cheap prices are good for now, but down the line, you'll be at the mercy of Amazon or whoever holds all your information.</li><li>Once you're hooked by the pencil pushers, this will become yet another monthly bill like your cell phone or electricity. In fact when Steve Ballmer says the future of computing is in the Cloud, this is exactly what he sees: a monthly billed reliance on centralised data services that you can't easily get out of!</li><li>It also begs the question: what happens to your data if you don't pay up, or just miss a monthly payment?</li></ol><br /><br />The Cloud is the future, whether we like it or not. At the moment I like it, but ask me again in a few years when I'm struggling to pay my "data" bills!Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com6tag:blogger.com,1999:blog-24667812.post-61890262858727415442009-01-19T14:17:00.005-07:002009-01-19T15:40:44.619-07:00OS X Leopard Virtual Hosts and Symbolic LinksI'll keep this quick.<br /><br /><ul><li>Say you have an SVN working copy in your Documents Folder: Documents/SVN/MyProject/</li><li>There is a webroot in there: Documents/SVN/MyProject/webroot/</li><li>You've got the following in etc/hosts : 127.0.0.1 localhost dev</li><li>You've created a Virtual Host for "dev" in /private/etc/apache2/extra/httpd-vhosts.conf</li><li>You included FollowSymLinks in the virtual host Directory settings for Documents/SVN/MyProject/webroot</li><li>You get a "Forbidden" error when you try to view http://dev</li><li>You did a chmod -R 777 on the Documents/SVN/MyProject/webroot/ folder and you still get "Forbidden"</ul><br /><br />If this sounds familiar to you, then here's the solution:<br /><br />Use: <span style="font-weight:bold;">chmod a+x</span> <br /><br />Open a terminal window use the chmod command for each folder in the path to the webroot. In the example path, it would be:<br />chmod a+x ~/Documents<br />chmod a+x ~/Documents/SVN<br />chmod a+x ~/Documents/SVN/MyProject<br />chmod a+x ~/Documents/SVN/MyProject/webroot<br /><br />As solutions go, this is quite a bad one as it makes your Documents folder accessible to all. But after hours of trying, that's all I could do to get this to work.<br /><br />Has anyone got a better way?Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com1tag:blogger.com,1999:blog-24667812.post-9660041560199629852008-11-26T15:44:00.005-07:002008-11-26T15:59:43.680-07:00YouTube MashingI was listening to <a href="http://www.bbc.co.uk/6music" target="_blank">BBC 6 Music</a>, a cracking radio station that plays amazing new stuff you've never heard of, when I was sent the standard YouTube comedy clip of kittens doing silly things.<br /><br />I was listening to Smoke Fairies - Living with Ghosts when I opened the kitten video.<br /><br />By pure luck, I opened the video at the perfect moment in an almost seemless mix with the radio.<br /><br />Try it yourself, follow these instructions:<br /><ol><br /><li>Load each video in a separate browser tab or window.<br /><br />Here's the Smoke Fairies video:<br /><a href="http://www.youtube.com/watch?v=4ey8UQ21_jk" target="_blank">http://www.youtube.com/watch?v=4ey8UQ21_jk</a><br /><br />And here's the "Lookin' Kitties" video:<br /><a href="http://www.youtube.com/watch?v=MnR3bAICsDM" target="_blank">http://www.youtube.com/watch?v=MnR3bAICsDM</a><br /></li><br /><li>Press pause on both videos until they're completely downloaded.</li><br /><li>Cue the Smoke Fairies video to about 1:48</li><br /><li>In a quick manoeuvre, start the Smoke Fairies video, then flip to the kitties video and press play.</li><br /></ol><br />Goes together pretty well doesn't it? <br /><br />So budding DJ's, get out there and start a new trend, <br />"YouTube Mashing" ! But don't forget, you heard it here first ;-)Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com0tag:blogger.com,1999:blog-24667812.post-11949023649089013432008-11-24T16:12:00.005-07:002008-11-24T16:26:10.672-07:00Glenbow Museum - Art PadHere lies ArtPad:<br /><br /><a href="http://www.glenbow.org/artpad" target="_blank">http://www.glenbow.org/artpad</a><br /><br />Technically it's a fantastic site. I only worked on a very small part of it myself, but many of my colleagues worked very hard to produce a site which is artistically stunning, yet adheres to strict accessibility standards - a tough job!<br /><br />A big hurrah to everyone who worked on it. A slow clap to the fact it was poorly managed, vastly over budget and released 2 years after it was initially completed.Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com0tag:blogger.com,1999:blog-24667812.post-85893810650931197442008-11-04T10:47:00.005-07:002008-11-04T11:34:42.923-07:00Accessing Scenes in loaded SWFs (AS3)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.<br /><br />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!?<br /><br />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?<br /><br />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! <br /><br />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.<br /><br />*** Update ***<br />Please read comments to this postDan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com2tag:blogger.com,1999:blog-24667812.post-64889542638812004032008-10-16T09:13:00.004-06:002011-03-06T10:40:24.847-07:00My 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. <br />
<br />
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.<br />
<br />
Two things disappoint me here: <br />
<br />
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.<br />
<br />
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!<br />
<br />
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).<br />
<br />
**** UPDATE - MARCH 2011 ****<br />
Thank you everyone for posting. There is a petition you can sign to recall 2006 iMacs.<br />
<a href="http://www.petitionspot.com/petitions/imacrecall" target="_blank">http://www.petitionspot.com/petitions/imacrecall</a><br />
<br />
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.Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com225tag:blogger.com,1999:blog-24667812.post-87153448255514203802008-10-01T13:03:00.003-06:002008-10-01T13:23:01.093-06:00Flash Player Audio Sync and Frame RatesSo, it's the end of my hiatus since I last posted. I got married, changed job, house, car - actually pretty much all my life. <br /><br />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.<br /><br />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.<br /><br />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.<br /><br />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.<br /><br />I'm hoping FP10 has more accurate frame rates that would solve this problem.Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com3tag:blogger.com,1999:blog-24667812.post-21732099439425042472008-03-25T19:54:00.015-06:002008-03-25T20:22:49.167-06:00The 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? <br /><br />Well here's the answer:<br /><a href="http://osteele.com/words/aargh">http://osteele.com/words/aargh</a><br /><br />The most common spelling appears to be "argh", which is really more of an apathetic sigh than a gut wrenching scream of annoyance. <br /><br />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.<br /><br />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.<br /><br />You see? T'interweb has its uses!<br /><br />Back to work.... AAAAARRRRRRRRRRRRRRGGGGGHHHHH!!!!Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com1tag:blogger.com,1999:blog-24667812.post-8345240861187371692008-03-18T22:35:00.005-06:002008-03-18T22:47:18.492-06:00Use Weak References for Your Event ListenersPlease read this:<br /><br /><a href="http://www.gskinner.com/blog/archives/2006/07/as3_weakly_refe.html">http://www.gskinner.com/blog/archives/2006/07/ as3_weakly_refe.html</a><br /><br />Using weakly referenced event listeners means an object can be cleared during Garbage Collection even if there's an event listener acting upon it.<br /><br />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.<br /><br />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.<br /><br />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.<br /><br />Thanks Grant.Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com0tag:blogger.com,1999:blog-24667812.post-30158302732955551162008-02-24T09:01:00.014-07:002008-02-24T10:12:41.629-07:00Creating Class Instances from a DisplayObject in AS3*** The technique below doesn't clone a class instance, but allows you to create a new class instance derived from an unknown DisplayObject ***<br /><br />After selecting an item by clicking the mouse, I needed to create a new instance of the selected item to be added to an item inventory. I needed to find out what type of object was being passed into the MouseEvent handler so I could create a new object of a specific type i.e. <br /><code><br />private function mouseHandler(e:MouseEvent):void<br />{<br />// this is only a DisplayObject - what is it? <br />trace(e.target);<br /><br />// this is what I want to do, but how do I know if e.target is a Rock?<br />var newItem:IItem = new Rock(); <br />}<br /></code><br />The following function uses <code>flash.utils.getQualifiedClassName()</code> to return a string that contains the name of the class including full namespace.<br /><br />It then uses <code>flash.utils.getDefinitionByName()</code> to return a Class object which can then be used to create a new class.<br /><code><br />public function duplicateItem(obj:*):*<br />{<br /> var className:String = getQualifiedClassName(obj).split('::').join('.');<br /> var ClassRef:Class = getDefinitionByName(className) as Class;<br /> var item:* = new ClassRef();<br /> return item;<br />}<br /></code><br />So to create a duplicate object, just use call the duplicateItem function. You can also cast the returned class instance, if required, as shown below:<br /><code><br />private function mouseHandler(e:MouseEvent):void<br />{<br /> var newItem:IItem = duplicateItem(e.target) as IItem;<br />}<br /><code>Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com2tag:blogger.com,1999:blog-24667812.post-52399679853632367602008-01-29T13:39:00.000-07:002008-01-29T14:55:07.132-07:00Flex 2: Embedding Flash 9 swfs and controling the MainTimelineI've been embedding Flash 9 swfs into a Flex 2 project using the following code:<blockquote><code><br />[Bindable]<br />[Embed(source="myFlash9.swf")]<br />private var mySwf:Class;<br /></code></blockquote><br />This creates the bindable variable "mySwf" which can be bound to the backgroundImage attribute of certain components e.g.<br /><blockquote><code><br /><mx:Canvas backgroundImage="{mySwf}" /><br /></code></blockquote><br />However much I tried, I couldn't access the timeline of that swf as it was cast as a Class type and essentially wasn't a MovieClip. Flex only permits Class or String variables when embedding in this way. <br /><br />I needed to find a way to load a swf into Flex and use it as a fully accessible MovieClip. Here's what I did:<br /><ul><li>Create a bindable MovieClip variable</li><li>Load in the swf using the flash.display.Loader class</li><li>Assign the result from the Loader class to the bindable MovieClip variable</li><li>used the Image component in Flex to add the swf to the application</li></ul><br />Here's the complete MXML code:<br /><blockquote><code><br /><?xml version="1.0" encoding="utf-8"?><br /><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()"><br /> <mx:Script><br /> <![CDATA[<br /> import flash.net.URLRequest;<br /> import flash.display.MovieClip;<br /> import flash.display.Loader;<br /> import flash.events.*;<br /> <br /> [Bindable]<br /> private var mySwf:MovieClip;<br /> <br /> private function init():void{<br /> var bgURL:URLRequest = new URLRequest("Test.swf"); <br /> var bgLoader:Loader = new Loader(); <br /> bgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler); <br /> bgLoader.load(bgURL);<br /> }<br /> <br /> private function completeHandler(event:Event):void {<br /> mySwf = event.target.content as MovieClip;<br /> mySwf.gotoAndPlay(20); // access the timeline of the loaded swf<br /> }<br /> <br /> ]]><br /> </mx:Script><br /> <br /> <mx:Canvas width="856" height="527" horizontalCenter="0" verticalCenter="0"> <br /> <mx:Image source="{mySwf}" /><br /> </mx:Canvas><br /></mx:Application><br /></code></blockquote><br /><br />You can now directly access the timeline of the loaded swf using the "mySwf" variable.<br /><br />Using the backgroundImage attribute caused errors as it expected a Class variable to be passed into it. Using Image seems to have got around this problem.Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com5tag:blogger.com,1999:blog-24667812.post-22414173126730448472008-01-15T15:12:00.001-07:002008-01-15T15:35:11.690-07:00Calgary Flash and Flex User Group MeetingsIt'll be an interesting couple of months with the releases of Flex 3 and AIR and as usual, Adobe reps are doing their pre-release tours.<br /><br />There are 2 events in Calgary that can't be missed:<br /><br /><ul><br /><li><a href="http://www.flexcalgary.org/node/10">Calgary Flex User Group - Jan 30th 2008</a><br />Flex and AIR Pre-release Tour with Adobe’s with Duane Nickull</li><br /><li><a href="http://www.flashcalgary.org/announcement/special-event-meeting/">Calgary Flash User Group - Feb 25th 2008</a><br />Presentation by Adobe Chief Software Architect, Kevin Lynch</li><br /></ul>Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com0tag:blogger.com,1999:blog-24667812.post-3907277587636230822008-01-14T15:25:00.001-07:002008-01-14T15:35:53.439-07:00AS3 mp3 streaming problem with FacebookI created a Flash game for Facebook and had a problem with the audio I was streaming through the Sound class. Loud clicks, pops and squelches ruined the audio, hurt my ears and probably didn't do my speakers any good!<br /><br />This problem only occurred when the swf was embedded in Facebook, tests on other servers did not produce this error.<br /><br />To fix this problem I did the following:<br /><ul><br /><li>Set Securtiy.allowDomain("foo.com"); in the document class</li><br /><li>I also specifically set the policy file with Security.loadPolicyFile("http://www.foo.com/crossdomain.xml");</li><br /><li>In crossdomain.xml, add the to-ports attribute:<br /><allow-access-from domain="www.foo.com/" secure="false" to-ports="*" /></li><br /></ul><br />This removed all clicks, bleeps and squelchy noised from the audio. I guess it has something to do with Flash only granting access to ports 1024 and above by default. Specifying to-ports="*" presumably allowed access to all available ports below 1024 and the mp3 streamed without any problems.<br /><br />This documentation helped: <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/system/Security.html#loadPolicyFile()">Security.loadPolicyFile()</a>Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com1tag:blogger.com,1999:blog-24667812.post-63297387304901844782008-01-14T14:02:00.000-07:002008-01-14T14:32:03.117-07:00Canadian Cell Phone Industry - a rant!I've about had it with the cell phone industry in Canada. Coming from the UK, it seems about 5 years behind, the networks and available phones are pants and it's run by a few restrictive monopolies - I guess an oligopoly(!) - that expect you to sign up for 3 year contracts so you can get a Sony Ericsson K790 for only $129 dollars - it's bloody free in the UK on a 1 year contract! And 3 year contracts? I don't know where I'll be in 3 months!?<br /><br />So here's the rant I sent to the Canadian Radio Television and Telecommunications Commission. <br /><span style="font-weight:bold;"><br />Complaint Against Bell, Rogers and Other Network Owning Cellular Phone Companies in Canada</span><br /><br /><span style="font-weight:bold;">Introduction</span> <br />The general consensus among most writers in the technology industry is that mobile communications will become ever more transparent and ubiquitous <br /><br />Most nations in Asia, Europe, the America’s and indeed Africa have comprehensive cell phone networks. The services offered by these networks vary from country to country but of all the 1st world counties, Canadian companies appear to be providing some of the worst service to its consumers. <br /><br />Although tariffs in Canada are also not consistent with other parts of the world (e.g. paying for incoming calls) this complaint concentrates on a more holistic view of the entire cell phone industry in Canada.<br /><br /><span style="font-weight:bold;">How Canadian Cell Phone Companies Fail the Consumer</span><br />Buying a cell phone from any company in any country isn’t simple. There are always hidden charges and contractual obligations that the consumer has to decipher and there are always new plans with different more elaborate pricing structures being created on a regular basis. This is an industry wide problem and not specific to Canadian companies.<br /><br />There are 3 mains reasons why the Canadian companies offer worse service to their consumers than other 1st world (and some developing) countries, with each reason a consequence of the reason before it:<br /><ol><br /><li>Canadian cell phone networks are not up to the standards of other 1st world nations e.g. 3G HSDPA networks in most of Europe, and East Asia.<br /><br />Canada is a vast country, but most dense urban area’s still do not have blanket 3G HSDPA coverage, even as we enter the 2nd decade of the 21st century. It appears a chronic lack of investment has made Canada’s cellular services lag behind.</li><br /><li>Subsequently the range of mobile devices is poor and these devices are not as advanced as those available in other 1st world countries.<br /><br />Why would a manufacturer sell quad-band 3G phones in a country that doesn’t have the network capability to support them?</li><br /><li>Phone subsidies are small and often require 3 year contracts. The consumer still has to pay up-front for the mobile device.<br /><br />3 year contracts are not common elsewhere, but in Canada they’re used as a method to sell smart phones at a cheaper price while also locking the consumer to a company for a long period of time. In other countries, such as the UK, phone companies offer smart phones for free on 1 year or 18 month contracts that have slightly higher monthly payments (the subsidy). Usually you can stay with your provider and upgrade to the latest smart phone for free (or a small charge) at the end of your contract i.e. once per year. The consumer always has the latest device and the company has retained their business with that consumer. </li><br /></ol><br /><br />Phone subsidies also play an important role in empowering the consumer with a device that can generate more revenue for the phone company (see The Monopolies are Stifling an Entire Industry)<br /><br />The bottom line is that Canadians are paying more for less i.e. they’re locked into unrealistically long contracts for phones that are worse than those offered in other parts of the world. <br /><br /><span style="font-weight:bold;">The Monopolies are Stifling an Entire Industry</span><br />Canadians are not empowered with subsidised mobile devices, which is probably why the penetration rate of cell phones in Canada is so low (about 51%). It’s also conceivable that the number of people with top quality smart phones is also low as the consumer has to pay for it up front and/or be locked into an uncomfortably long 3 year contract.<br /><br />Therefore there is only a small audience for any company offering interactive mobile services to Canadians. Services such as: SMS short code payment, Java/Flashlite games or mp3 players, mobile payment handlers, GIS / cell location services, business directories, VoIP etc.<br /><br />Many of these services use data calls that network providers will charge per megabyte. The formula is simple:<br /><br />Network investment + subsidised phones = more people with smart phones = more online/data services = more downloading = more revenue = more business for the networks and a 3rd party economy utilising those networks.<br /><br /><span style="font-weight:bold;">Conclusion </span><br />It seems ridiculous why the like of Bell, Rogers (and others) have not yet seen or acted upon this. We go back to reason #1 above: minimal investment by the network owners has provided a service which is only just good enough. They control the networks and supply of mobile devices. They must be making lots of profit by providing a mediocre service with minimal investment. They know it will cost them billions of dollars to set up modern networks to catch up with the rest of the world. <br /><br />Their myopic vision is stifling not just a business sector, but an entire technological and social revolution which is happening all over the world at an incredible speed. Speak to anyone in Europe and Asia about the mobile services they use and how it fits into their life and ask a Canadian the same thing, is like asking a teenager about filing taxes: they know what it is, but they just don’t quite get it. Why? Because they’ve never been fully exposed to it. <br /><br />The available interactive cellular services in Canada are at about the same level the UK was in 2002/2003 – an age in this industry. Soon, Canadians will look, embarrassed in front of the rest of the world (if they don’t already) and wonder “why are we so behind the times? Why do we not have the phones and services you can get in Europe, Asia and elsewhere?” Look no further than the restrictive monopolies of Bell, Rogers et al and the current communications regulations.<br /><br /><br />/////<br /><br />There... I feel so much better. Anyone fancy joining a Campaign for Free Phones in Canada?Dan Lavenderhttp://www.blogger.com/profile/02834480814503736094noreply@blogger.com2