Archive for the ‘Flash General’ Category

Adobe fight fire with fire

Tuesday, July 1st, 2008

Recently Adobe has been needing to deal with a massive force attacking its main domain of dominance, we can call this domain - the highly interactive web or RIA. I don’t refer to Microsoft SilverLight which is supposed to compete with Adobe Flash on the same ground, but to the brutal MS marketing machine. This machine can make every boy and girl blindly recite fallacious facts and numbly say things like “Yeah, but, SilverLight is search engine optimized”.

It took Adobe some time to understand what it is dealing with, and I think I’ve noticed a change in their PR brutality lately, generating big PR out of small things.

This last SEO announcement from Adobe, which claim that Flash will be more searchable by search engines, might have some substance in it, as opposed to the similar one from Microsoft, but, it’s still mainly a marketing battle. I just hope it doesn’t take too many resources out of the real development of the products.

Google were probably working on their own humanoid crawler that has a broader vision then just the Flash Player and can work with any RIA applications even if its written in AJAX or SilverLight. Apparently searching and indexing RIA is not an easy thing to achieve, and it doesn’t seem that even google has managed to do it yet.

The main problem of indexing Flash websites or any other RIA website, is to understand the context of the data and then link to it directly, aka deep linking. The fact that google can now read the text from within Flash even better then it did before, don’t yet solve that problem.

Even so, it doesn’t mean that we shouldn’t be optimistic, and there is a possibility that this will improved the indexing of Flash content. We’ll have to wait and see.

XP SP3 downgrade the Flash Player

Tuesday, June 3rd, 2008

Update: Apparently SP3 doesn’t downgrade the player. It’ll only install an older version 9.0.115 if you don’t have the latest 9.0.124 already installed, according to this blog post from Ryan Stewart. More info here.

The latest Windows XP service pack 3 comes bundled with the old 8.0.24.0 version of the Flash player. This version, beside not being able to play back some of the latest web content, has some major security flaw, along with a weaker security model and some other bugs.

If you apply this update to your windows system, make sure you install the latest Flash player from here.

RIA on the mobile phones and small devices

Monday, March 31st, 2008

Flash, SilverLight, Android, JavaFX, QT and the iPhone. Seems that everyone wants to redefine our mobile phone, the ultimate device/gadget of all time. I’ve written a summary of the latest advancement in the area of rich mobile applications.

Read it here.

My new blog - Human VOIP

Monday, March 24th, 2008

Writing a blog is not a simple task, writing a good blog is very difficult. I’m not sure I’m the kind of person who can handle more then one blog, I’m not Lee Brimelow :), but, I’ll give it a try anyway.

My new blog name is, Human VOIP, it’s supposed to be mainly about telephony related stuff, but, somehow Flash seem to sneak in ;)

Security flaws in FLA files

Thursday, March 20th, 2008

FLA is one of these file format that we’re used to freely open without any fear. Our complete confidence is going to change since a new exploit has been found. This exploit enable an attacker to manipulate an FLA file in a way that, when loaded into the Flash CS3 or 8 IDE, it will execute arbitrary code on our machine.

No need to panic, it’s unlikely that too many of the malicious FLA files are floating around. Just don’t run any untrusted FLA files until Adobe will issue the fix.

More info

Technical info

OSE instead of SEO

Saturday, March 15th, 2008

The promise of google to have a human like understanding of the Internet it crawls has yet to reach reality. My point is that, we should start to expect Optimized Search Engines (OSE) instead of painfully optimizing our content for them (SEO). Currently search engines can’t understand RIA (Rich Internet Application), websites written in Ajax Flash and SilverLight, and the authors of these websites need to invest a lot of resources to make it SEO. As RIA become bigger and more significant part or the Internet daily, what use is a search engine that can’t understand it? It’s the age of obscurity all over again, the age before google.

This clip (02:22) has reminded me of the old promise that google will see and understand the web the same as we humans do, a promise which wasn’t really fulfilled. I know there is a big technological challenge in that, hey google can’t do it yet, but the one that will do it the best might be the next google.

The search engine game might be open again since the late 90th.

Technologies never cry

Sunday, February 24th, 2008

I’ve been thinking lately, will I leave my beloved Flash and jump to the newer SilverLight?! After all that Flash did for me, made me the man I am today, got me this cool job I’m happily manage to wake up (almost) every morning to go to. Will I just leave that all behind? I know SilverLight is still underage but it might become very sexy eventually. What if it’ll become the better technology, can I just dismiss all of our past together, me and Flash, that is? I might also have an easier time pushing SilverLight then Flash, in my area. I’m defiantly gonna play with the real SilverLight (ver 2.0) when it’ll come out, that might be fun.

I believe a lot of us Flashers share the same feeling. Lately this has been recognized even by our native Adobe branch (Israel) which was ignoring us, flashers, completely till now. They have set a Flex3 / Air conference for tomorrow (25.2.2008), which is the exact same day that Microsoft is doing her local Silverlight conference. As for myself, I’m gonna jump between conferences, have the best of both worlds, eat the cakes and have it too, they’ll probably be a lot of cakes :)

Again, I would like to give Microsoft credit for it’s SilverLight showoffs, even though it’s funded with lots of MS money. The latest is the Microsoft Virtual Events. For me, it didn’t worked in FireFox, gave me some error. Tried in IE7, although it was a lengthy load again (more then 8 mega), the experience was not that good, with lots of too long delays and un-intuitive behaviors and eventually some Javascript errors. maybe it’s mainly a matter of design and not the technology to blame, but this is a Microsoft website, if they don’t know how to use their own technology, then who will.

Compare it with one of the latest Flex showoff, funded with developers passion.

What I would really don’t like to see is that MS will win this fight even though it’ll provide the inferior technology. We’ve all seen it happen in the past, but, I still believe, this time the game is different. If they can really excel Flash then they should be the winners, but, as objective as I can possibly be, I believe they’re still far from it.

I would like to see both of these technologies nurturing each other with the competition. I’m not sure that Flash/Flex would have received such frantic amount of updates in such a short time if it wasn’t for MS upcoming competition. So, so far it’s been great and it’s gonna be even more interesting.

P.S. Maybe this guy can already convince you to make the move to SilverLight :D

Thoughts about the pug dog screen cleaner

Monday, February 11th, 2008

If you haven’t seen this cool pug cleaning your screen then click here. This cool Flash video embed inside a simple swf was floating all over the web for the past month or so.

The first think that came to mind was, lets turn this into a screensaver. Which introduced me to this great 100% freeware, swf to screensaver, Instantstorm. Only then I’ve realized that, it fits too perfectly as a screensaver to not already be a screensaver. indeed, after googleing I’ve found it here and a similar concept here (I wouldn’t install these, might contain ad-wares).

The most interesting thing bout this is, how something that had almost no existent became as viral as hell when it was re-distributed as a simple link to a swf file. No play button, no scrubber, and no nothing, follow the link and you get it filling the whole browser space and the experience starts immediately. Sometimes a link to a swf may be the best way of distribution.

If you’ll put in the pressure they will Flex

Friday, February 1st, 2008

I have written before about my previous working place and how I’ve desperately tried to convince my superiors over there to make the move to Flash/Flex instead of our homebrew Active-x. Back then my CTO rudely dismissed the idea every time it came up.

More then two years after I’ve written this article, he (the CTO) was let go, and the company decided to make the move to Flash. I was no longer working there, but, it became a live or die situation for the company. It might seems that the CTO was the main blockage for this move but he wasn’t the only one. Almost anyone that had an opinion was against Flash. I remember my team leader determining repeatedly “It will never be Flash”. How about some hat eating, if you got any hats left ;)

It might sounds like I’m breaking even with them in this post, and it’s a somewhat true, but I still care for their success and do still keep in touch with most of them and help when I can. It’s just annoys me that people can be so short sighted sometimes.

Anyway, they are currently in an advanced phase of the development, rewriting the homebrew active-x functionalities in Actionscript 3.0. They use the Flex 2 editor although they use little to none of the Flex 2 framework.

Though it saddens me a little, that it was such a painful process for them to turn to the right path and also that I didn’t get to develop this cool Flash product by myself. I believe that I have set the foundation for this move, brightening on the capabilities of AS3 and the Flash VM2 and how it can switch the active-x. So I do feel comforted by the fact that they managed to do it, even if it’s in the 11th hour.

These days I work for jajah, which though it is a larger company, it is still much more younger and dynamic. But still, I encounter some of the same ignorance regarding Flash and non Microsoft technologies. While the use of Flash/Flex isn’t something that is life changing for jajah, yet. We can use it in a lot of places to improve our products. We recently released the Jajah Flash widget and currently working on some Flex stuff.

I still, from time to time hear the same old cliche, “How is your Macromedia/Adobe stocks are doing?”. The fact is that I’ve never had any Adobe stocks, the fact is that I’ve never argued for the use of Flash when it wasn’t simply the best or the only solution. When their will be any alternatives then we’ll see. Since then - Open your eyes, be flexible!

I will present my previous company cool new, Flash driven, product and all of the details, in here, ASAP.

Social Engineering Exploits using Flash

Sunday, January 27th, 2008

Apparently Adobe has fixed the bug I've found that enables a swf file to crash the browser, with the last version of the Flash Player (9,0,115,0). I don't know if it's related to my post, but, anyway it's good that it's been fixed.

Since it's already fixed, I just want to give an example of how this could have been exploited with a little Social Engineering. This example might look stupid to you and you would have never fall for it but remember, first, it's only an idea, the real attacker might be more creative, second, some Internet users are far from savvy and might fall for crazier stuff then this.

In this example, the naive user will reach a web site with this text: "I've installed a virus on your windows machine and now have full control of it and your FireFox browser. You have exactly 1:00 minute to donate 10$ to my account, click here to donate. If you fail to donate in the appropriate time I will disable your browser for a few minutes. This will be your first and last warning. Afterwards you have exactly 10 minutes to return to this page and complete your donation or your system and personal data will be compromised and damaged permanently. The only way you can remove the virus from your machine is to donate from this page".

The details like OS and browser will be interchangeable with the real user spec. The user will see the 1:00 minute timer counting, when it'll reach 0:00, boom! the browser crashes using the Flash bug, if the user try to close the browser or the tab, Javascript's onbeforeunload can be used to crash the browser and also add some scary alert.

JavaScript:
  1. window.onbeforeunload = function()
  2. {
  3. //flash.kill();
  4. return "If you leave this page without donating your system will be lost!!!";
  5. }

Some of the users will have enough fear in them to return and donate to the attackers PayPal account. Sound crazy?! Some have been known to fall for crazier phishing tricks. I personally know a few. Take care of the dummies near you.

Resolving some issues with swfobject

Sunday, November 11th, 2007

There are some known issues with swfobject and ASP.NET, infact it's not just with swfobject but also with the Flash object in general, one issue of using ExternaInterafce from an ASP.NET Form can be solved with these technics

I had a strange issue with swfobject lately and obviously I've blamed ASP.NET for inserting unwanted code into my pages and causing problems. Generally it's reasonable to blame it as it does make a mess sometimes, but, this time it was my fault for not noticing other Javascript code is conflicting with swfobject.

The issue I had, was with the swfobject's addVariable and addParam functions. The Flash SWF HTML seemed to be written to the page's flashContent div but all of the variables and parameters I've added were ignored. After examining the swfobject getSWFHTML function, this function gives you the HTML code that is gonna embed the Flash inside the page, when I saw how strange the HTML is, I realized what happened:
Without naming names ;) some Javascript developers, extensions and frameworks like to write to the prototype of generic Javascript objects (This is also how Object Oriented Actionscript 1 was done in the past). And with doing so, extending these built-in objects (object, array, string, etc') with various functionalities. A good example is the javascript JSON implementation which extends the Javascript object with object.toJSONString(). Swfobject stores the variables and parameters inside a regular Javascript object and when it prepares the Flash HTML it uses a for..in loop to go through all the elements and add them to the markup
<param value="flashMovie.swf" name="movie" />
<param value="transparent" name="wmode" /> etc'

in case you're using the json.js, your HTML will have also
<param name="toJSONString" value="function (w) {....and whole lotta mess" />.

This might cause the embedding of the Flash movie to fail or function improperly.

The solution for this is to add a check to all of the for..in loops inside swfobject with the hasOwnProperty, for example:

JavaScript:
  1. for(key in variables){
  2. if( variables.hasOwnProperty( key ) )
  3. {
  4. variablePairs[variablePairs.length] = key +"="+ variables[key];
  5. }
  6. }

The hasOwnProperty function returns true only if the property is not built-in and not in the prototype chain. Therefor the toJSONString in our example will return false and wont be considered as a flash variable or parameter.

When encountering issues with the swfobject a good place to check is the swfobject.getSWFHTML() function.

JavaScript:
  1. var o=new SWFObject("flashFile.swf","falshMovie",200,300,"9","#FFFFFF");
  2. o.addVariable("firstName","Jon");
  3. o.addVariable("lastName","Smith");
  4. o.addParam("wmode","transparent");
  5.  
  6. //exmine the html before it's being writen to the div
  7. alert(o.getSWFHTML());
  8.  
  9. o.write("flashContent");

More related info about hasOwnProperty.

172 Flash Player versions

Tuesday, October 2nd, 2007

Would you believe me if I told you there are 172 different Flash Player versions out there, maybe not, but you would believe google-analytics, right?

Since the new impressive Flash Player 9 states were published (93%-94%). I went to check it on a high traffic website, one that measures in millions of visits each month. After summarizing all the versions above 9.0, it reach to a compatibility of 90%, which is still impressive for such a short time. What was also impressive is that according to google-analytics.com, users with a total of 172 different Flash Player versions visit the website since the beginning of 2007. When I check only the last month it sums up to a total of 88. Some of the versions are so bizar I don't get who uses these, like the 2.0++, 9.0.21-d55-r47 and even 10.0, someone from adobe maybe ;)

Check out the last 11 versions from last month, it's really weird:

Bizar Flash Player versions

Call me now! Jajah new Flash widget

Monday, September 24th, 2007

We've just released the Jajah Buttons which enables you to receive calls from your website, blog, online community, email, etc' directly to your phone and all that without revealing your phone number. Check it out, call me now.

The Jajah button let's you determine when, where and to whom you are available for calls. It also give you a permanent short link that leads people straight to your phone. You can always reach me with this url - jajah.com/guy

The Flash widget is completely customizable in size, colors, supports multiple languages and have a unique look and feel. The widget was developed in Actionscript 2.0 mainly for compatibility reasons, it was intended to be released some time ago, before the Flash 9 Player reached 90%. Over that time it was overdeveloped with many features and a complete set of controls that were developed from scratch. Many of these features did not make it to the final (first) release, but, are ready to be put back in when the time is right, so stay tuned if you're interested in this kind of stuff.

The Jajah Button graphics were designed by the uber talented crew at Ichiban.

Jajah widget colors

Call animation:

Jajah widget call animation

Developing Actionscript 2.0 controls is a tiring and unappreciated task. Show it to a non-flash developer and they'll tell you - "thats nice but I have that in HTML also, I simply write an input tag...", they simply can't see the difference. This strengthen my feeling that some people, mainly developers, are color blind and can't differentiate between a circle and a box ;). If Microsoft is expecting these guys to do something appropriate with Silverlight, then they shouldn't, cause it ain't gonna happen.

Using the macromedia's V2 components, as always, didn't seem right. The Flash CS3 Actionscript 3.0 component set, although modest, looks like something that is more reasonable to inherit from. To complete your set, take a look at yahoo's Flash components.

This is the code I used to embed the Jajah flash widget inside this post using the Kimily Flash Embed wordpress plugin. There are more parameters you can add to make its colors look more like your style, check the editor for that. The Jajah Buttons Editor also gives you the code snippet suitable for your needs.

CODE:
  1. [kml_flashembed movie="http://www.jajah.com/buttons/jjb.swf?v=1" width="220" height="200" fvars="sn=guy" /]

Screenshots from the editor:

Customize colors and size

Editor - Customize colors

Set your availability

Editor - Availability 1

Countries you wanna get calls from

Editor - Availability countries

Callers blacklist

Editor - Availability blacklist

For more info go here...

Pay Per View with Flash Media Server

Wednesday, August 15th, 2007

At JAJAH we are always looking for ways to leverage our payment system in new and exciting ways. One of the ideas that came up was to sell calls to videos. You call to a certain number and while the call is active, you can watch a certain video. Not a new concept at all, it's been used in some industries for ages now ;). But, we only needed a demo for now and we needed a super quick way to create it. The obvious choice was to use Flash Media Server with some kind of ticketing system. For this demo we used a third party shared server from influxis which is more then enough in this case.

Creating a ticketing system with FMS couldn't be easier, you can find some tutorials about it here, here and here. But let me summarize it for you. Create some kind of a temporary ticket (random number or GUID will do) and send it to the client (the Flash player), when the player request the video stream from the server, send this ticket to the FMS along with the request. The FMS in it's turn validate this ticket against your server. Continue checking this ticket in a certain interval and as long as this ticket is valid, play the stream, if it become invalid kill the connection. Thats it. Most of the articles on the web about FMS tells you that Flash-Remoting is needed for any kind of communication from the FMS. It isn't completely true. While using remoting may be beneficial in some cases, since FMS 2.0 it is easy to make asynchronous calls like webservices and loadvars. So you have more choise when developing your ticketing system. If you want to use Flash Remoting in dot.net consider using Midnightcoders WebOrb, as an alternative to Macromedia's Flash Remoting MX (both didn't install on Vista at the time, btw).
Since Jajah's pay per view is only a demo, we didn't exert ourselves to make it supper secure. you can learn more about securing your videos in this Adobe Flash Media Server article.

Jajah Pay Per View

To watch the pay per view demo, go to jajah.com, login or register and make a (free) call to this number +43-123456789. Your phone will ring, answer the call and behold. You will see a cool animation, an homage to IceAge. When you'll hang up your phone, the animation will stop. If you'll try to watch the movie after hanging-up, the stream won't be served from the FMS since the ticket isn't valid anymore.

Hostlynx 2.0 - Serious Flex app

Friday, July 13th, 2007

There is a claim that there isn't enough serious Flex applications out there. I've recently had the honor to preview an impressive one, and also to conduct a short interview with Dima Gutzeit the Project Manager of this app, named Mailvision Hostlynx 2.0.
This is another one for you to showoff when arguing for the right technology for your next application, currently there are only some information and screenshots, but, I'll let you know when a full demo is publicly available.

Hostlynx 2.0 - Screenshot2 small

Hostlynx 2.0 - Screenshot1 small

Q: What is Hostlynx 2.0?

A: Hostlynx 2 is the next generation of MailVision Class 5 SoftSwitch for VOIP telephony (SIP protocol). The product allows a system provider to setup a telephony network and offer advanced telephony services to its subscribers (IPCentrex). System management of the solution is based on Flex+Webservices.

Q: Who is the audience of this application?

A: Service providers and corporates who wishes to enter the fast evolving VOIP market.

Q: Why do you think Flash is the right technology for this project?

A: During the research for the project we have considered several technologies, including various AJAX toolkits, JSF and etc. The following convinced us to go with Flash/Flex: Flash player is installed on 98% of desktop computers so in majority of cases it will not require any client side installations. We wanted to deliver the best user experience we could and flash allowed us to do that.

Q: Generally, how is this app structured, client, backend, architecture etc'?

A: Our application uses webservices to communicate between client and server, where Flex application is used as a webservices client and JAXWS on the server side. When we started working with Flex (2.0) its webservices implementation was very weak and basic, so we had to create many workarounds on the server side to compensate. Flex 2.0.1 Hotfix 2 changed that, since we were part of the beta program for Hotfix2 and Adobe staff were kind enough to listen to our requests and enhance the webservices implementation.

Q: Have you used Cairngorm?

A: Yes, we do. Our application uses MVC, and this is done by using Cairngorm (2.0). ServiceLocator is responsible for all the webservices related stuff - sending requests and etc.

Q: How many people worked on the project?

A: Project development involved 2-3 developers and one designer. Project duration was around one year.

Q: Did any of the developers had previous experience with Flash or Flex?

A: That was one the "negative" factors when we decided on technology, since none of our developers had any previous experience not with Flash nor ActionScript. The learning curve was not a short one, since all the developers were from Java/JSP world.

Q: Will there be an online demo of the app?

A: We are on Beta 2 release, and a full featured demo will be available as soon as the application is stable enough.

Q: Do you have plans for creating similar apps?

A: I believe that the majority of future web/desktop projects of Mailvision will use Flex/AIR.

Q: What do you think is the future of the Flash platform and RIA in general?

A: Flex rocks :-).

Too much focus will kill you

Sunday, July 8th, 2007

I've just came across of a way to kill the Flash player with a few lines of AS 2.0. I know of at least one other way of killing the Flash player along with it's host, may it be the browser or the Flash IDE, but this was with the old 7th player, this time we're talking about the latest 9th version. It's a little awkward, and don't ask me how I got it, but, it involves a MovieClip, a TextField, Selection, Macromedia's Delegate, a filter, and a trace, yeah, it won't work without a call to trace. I think the main trouble maker is the Selection.onSetFocus, but, I couldn't recreate it without any of the above ingredients, and I have a feeling that AS2's trace is also problematic in Flash Player 9. (You should anyway "Omit trace actions", from the settings, when publishing swfs)

Focus Kills

I haven't tried it, but, I doubt that it can be recreated with AS3 on the VM2, it's the VM1 that we have to carry along for backward compatibility that causes all this trouble. I tested it on some different machines with different Flash players and so far it crushed them all, here is the list:

Ver: WIN 8,0,22,0 | Debug: true | OS: Windows XP
Ver: WIN 9,0,16,0 | Debug: true | OS: Windows XP
Ver: WIN 9,0,28,0 | Debug: false | OS: Windows XP
Ver: WIN 9,0,45,0 | Debug: false | OS: Windows XP
Ver: WIN 9,0,45,0 | Debug: false | OS: Windows (Server 2003)
Ver: WIN 9,0,45,0 | Debug: true | OS: Windows Vista
Ver: WIN 9,0,45,0 | Debug: false | OS: Windows Vista
Ver: WIN 9,0,47,0 | Debug: false | OS: Windows Vista
Ver: MAC 9,0,28,0 | Debug: false | OS: Mac OS 10.4.9

Copy this code into an empty FLA first frame, or download the source below to see how it goes.

Actionscript:
  1. var mc:MovieClip = this.createEmptyMovieClip("mc", 0);
  2.  
  3. var tf:TextField = this.createTextField("tf", 1, 20, 20, 300, 100);
  4. tf.type = "input";
  5. tf.border = true;
  6. tf.text = "Flash Player Varsion: " + System.capabilities.version + "\nDebug Player: " + System.capabilities.isDebugger + "\nOperating System: " + System.capabilities.os + "\n\nClick here or press the TAB key to kill Flash";
  7.  
  8. tf.onSetFocus = mx.utils.Delegate.create(this, glow);
  9.  
  10. Selection.addListener(this);
  11.  
  12. function onSetFocus(oldf:Object, newf:Object):Void{
  13. Selection.setFocus(oldf);
  14. }
  15.  
  16. function glow(){
  17. mc.filters = [new flash.filters.BevelFilter()]; // any filter except BitmapFilter()
  18. trace(mc.filters);
  19. }

Download source files.

Try it (Warnning!!!, it may crash your browser)

So Microsoft is interested in Flash ?!

Wednesday, May 9th, 2007

No, not another conspiracy theory about Microsoft, and not another rant about Silverlight, just my latest, somewhat delirious, job search. Few months back I've sent my resume to only one HR company. In my resume I've clearly stated Flash as my top skill, and oddly enough my first call was from Microsoft. It's not exactly Redmond but Microsoft Israel also has it's standards, I guess. I surprisedly asked the person on the other side. - Microsoft is interested in Flash ?! - You'll be surprised... he replayed. Microsoft, as expected looks like a very nice place to work in, with extremely nice people, there were also some open XBox and joystick boxes that were probably being plugged somewhere. Though there were many motivations, I had to move on, since this was my first offer I had to check some others.

I was overwhelmed by the amount of offers I got, but really got surprised when I've asked for a salary which wasn't that modest at all and got offered more then I've asked for. After that I've continued to raise the numbers with every job interview and was still getting the flattering OK. It reached to the point when I was uncomfortable to name a figure and felt the need to deeply apologize before doing so.

Another interesting aspect is that even if the company currently isn't using Flash at all, they seem interested in this "new" cool technology that no "serious" developer seem to know much about. It goes something like "we're also interested in doing some stuff in flash" or "do you know, what is it called, Flex... ?" and then I start babbling about Flex 2 and Flash 9. Just give me a chance and I wont stop :D.

Obviously it seems like the most interesting places to work in are these risky startups. You can sometimes get to these by using something like jobs@companyname.com. At the young companies there is probably no HR department and this email address is routed to the CTO or even the founders. See an interesting startup on techcrunch in your area? just send 'em your resume to the jobs address.

At the end it become too stressful to handle, with too many good options and my ex-employer pushing all of my sentimental buttons in order for me to stay. I'm glad I've made the right decision and signed up with JAJAH, an exciting Austrian-Israeli-American VOIP 2.0 / Web 2.0 startup. While my original role is an AJAX developer, we're already looking at ways we can leverage the Flash technology to our needs.

You may call this Bubble 2.0 and you'll be somewhat right, but theres a big difference this time it is much more realistic. For once, we now have a deadpool.

Shape Hints - Have you forgotten how good they taste ?

Saturday, April 14th, 2007

These days it's easy to forget that Flash is an amazing classic animation tool. Ever since the arrival of the fine Macromedia Tween Class and the amazing Fuse Kit (a new version was just released) and great books like Foundation Actionscript Animation, by: keith peters, new version for Actionscript 3.0 is on the way (not affiliat), it seems that we want to script our animation no matter what! Now, don't get me wrong, I also think that scripted animation is very powerful and I use it all the time. But, I sometimes find myself over using it in places where I should have used a simple tweening instead.With the 8th version of Flash we received a nice improvement to the tweening capabilities, it is now possible to achieve a relatively complex tweening animation with only two key frames. Check out this tutorial: Achieving Amazing Easing Effects in Flash, by: Rafiq R. Elmansy.

And what about the new kid animation abilities?! With what I've seen so far in the main WPF interactive editor CTP (beta) vesions, it fall short of Flash, it has an interesting concept of having the animation of an object as just another property of that object. But, it lake of satisfactorily key-frames controll and things like shape tween are not existent. These things might be improved in the final version, but it seems to me that Microsoft is still donesn't pay atantion to creativity as it should have, and is mainly thinking about GUI creation.

I just hope that Adobe wont forget the origins of Flash and one of the main reasons it is such a terrific tool, and is planing a tons more of animation and creativity features in the next Flash IDE release.

Note: I've written this post some time back, before the announcement of the new Flash CS 3 (Flash 9) feature list. It seems that we'll get some animation improvements, the two most interesting improvements looks like, Custom easing control and Copy and paste animations. The first will "provides independent control of position, rotation, scale, color, and filters", it will give us much finer control over every keyframe in our animation similar to high-end animation software. The second will let us copy timeline animations as fully editable Actionscript 3.0 XML objects for easy duplication and modification. It looks like even complex tweening that uses a motion guide can be copied and edited, no clarity about the coping of a shape tweens though. I guess no one at adobe have the nerve to dive into the Flash core and update something as the Shape Hints or even the Timeline itself, but overall, it seems like a nice update in terms of the animation abilities of Flash.

Flash CS3 will be released in April 20th.

Behind The Curtains - Shape Hints Animation Tutorial

Hover above this box:

I was amazed when I first saw shape animation in flash, create two different shapes on two different frames and easily get a morphing animation between them...

Few years back I was asked to make a flash banner for Habima Theater. I came with the, somewhat cheesy, idea of a animating a red curtain, and inside it, to fade images from few of the theater best shows.

Creating a curtain animation in Flash shouldn't be a problem, I thought, I'll create the start and finish frames and my beloved Flash will do the rest. The start frame of a simple curtain animation is simply a box and the end frame is an open curtain...

1. Create a new Flash Document, resize it to 320 x 240 and set the Frame rate to 30.

Document Properties

2. Create a red rectangle (R) anywhere on the stage no matter what size, select the rectangle and set it's properties (Show/Hide Properties Ctrl+F3): width and height to 160 and 240 respectively, x and y both to 0.

3. With the rectangle still selected press F8 to turn it into a Movie clip, and name it curtain.

Convert to Movie clip

4. Inside the properties panel name the instance of the curtain on stage to leftCurtain.

properties

5. Double click on leftCurtain to step inside it. On the Timeline (Show/Hide the Timeline Ctrl+Alt+T) name Layer 1 to curtain. Right click on the 30th frame and select Insert Keyframe (F6).

Insert Keyframe

6. The first frame of our animation, the closed state of our curtain is already done on frame 1, we'll now create the opened frame on frame 30. Deselect the red rectangle by clicking anywhere outside it on the stage. Point your mouse to the bottom right corner of the rectangle until the mouse cursor turns into a right angle shape, this indicates that you can grab the corner. With the Shift Key pressed click and drag the rect corner to the left and to about 45px from the left edge.

Drag Corner

7. In order to achieve an open curtain look we'll split it near the bottom. Point the cursor near the edge of the now diagonal line to about 50px from the bottom. When the cursor changes its shape to a small round line, press Ctrl and click to drag the new point to left to about 30px from the edge. Pressing on the Ctrl key while dragging a line breaks it and creates a new point where the break is.

Drag Middle

8. Similar to the previous step, hover with the mouse near the right edge of the rectangle, when the cursor change it's shape click and drag (without pressing Ctrl) the edge until it gets a nice belly, do the same for the small right edge.

Drag Belly

9. We done the entire 2 frames of our animation, now it's time to animate it. In the Timeline Select frame 1 and in the properties panel set Tween to Shape, also set Ease to 70, it will make the animation nicer by easing it near the end.

Tween

10. It looks like we got ourselves an opening curtain animation, but testing the movie (Ctrl+Enter) reveals that though we got an animation it's nothing like a believable curtain. This is because Flash can't know what exactly we're animating and how we like the morphing to be done. Flash simply guess, and this time its guess is very wrong. This is where Shape Hints come to our aid.

11. Select frame 1 and click on Modify -> Shape -> Add Shape Hint (Ctrl+Shift+H) 5 times. This will create 5 Shape Hints identified by characters from a to e. Arrange the Hints in the 4 corners and 1 where the break is, look at the image. Go to frame 30 and arrange the Hints respectively to the 1th frame. Every Hint character in frame 1 must correspond to the Hint character in frame 30.

Shape Hints

Tip: you can lock the layer and still be able to edit the Shape Hints.

Tip: Show/Hide all the Shape Hints Ctrl+Alt+H

12. Now lets test our movie (Ctrl+Enter) to see our curtain animate to its open state as it should.

13. To create the closing animation the simplest way is to duplicate the frames and then reverse it. Select all the frames in the curtain layer by clicking on its name and Right click -> Copy frame then Right click on frame 31 and select Paste frames. This will copy the opening animation, Shape Hints included. Click on frame 31 and while the Shift key is pressed click on frame 60 to select all of this frames range. Right click on the selected frames and click Reverse frames, it'll reverse the animation but sadly it'll also break the Shape Hints of this section, you'll have to create it again for frame 31 and 60, similar to the previous step.

14. Select frame 31 and in the properties panel set the Ease to -50, this will create an ease-in effect so the closing animation will start a bit slower and then accelerate as it goes.

15. Test the movie to see the (half) curtain open and close. Thats it, we're done our curtain animation it's time to duplicate the half into a full curtain and put some interactivity into it.

16. Before you go back to the main stage add another Layer inside the curtain Movie clip and name it actions. Click on Window -> Actions (F9), while the first frame selected enter the code stop(); inside the Action panel. Create a new key frame on frame 30 of the actions layer and put a stop(); in there as well. This will prevent the curtain from animating on its own and we'll control it with Actionscript.

Stop Action

17. Go back up to Scene 1 by double clicking on an empty area of the stage. Copy the leftCurtain Movie clip, paste it any where, set its x to 160, its y to 0 and its name to rightCurtain.

18. With the rightCurtain selected click on Modify -> Transform -> Flip Horizontal.

19. On the main Timeline in Scene 1 create another layer and name it actions open the actions panel (F9) and enter the following script:

function openCurtain():Void{
leftCurtain.gotoAndPlay(1);
rightCurtain.gotoAndPlay(1);
}

function closeCurtain():Void{
leftCurtain.gotoAndPlay(31);
rightCurtain.gotoAndPlay(31);
}

20. We can call these functions to open and close the curtain as we like, in this example we'll open the curtain when the mouse roll over it and close it when it roll out.

21. Create another layer beneath the actions layer but above the curtain layer and name it hitArea. Draw a green rectangle and set it's alpha to 0%, the color doesn't really matter since this rect will be invisible, also set it's width to 320, height to 240 and x, y to 0. Click F8 to turn this rectangle to a Movie clip and name it hitArea. in the properties panel name the hitArea instance on the stage to hit.

22. Add this code to the actions layer:

hit.onRollOver = openCurtain;
hit.onRollOut = closeCurtain;

Now every time we roll over the invisible hit Movie clip that is above the curtain the function openCurtain will be called and when we'll roll out from it the closeCurtain will be called.

23. Test the movie to see that we now got our interactive animated curtain, roll over it and it opens, roll out and it closes. But, if you'll play with it a little you'll see that it's not always act as it should. For example, when you roll out while the curtain is opening it jumps to beginning of the closing sequence instead of closing from the current position. To fix that we'll add a simple calculation to find the right frame we need to jump to in order for the animation to look seamless.

24. Replace the code in the action frame with this:

hit.onRollOver = openCurtain;
hit.onRollOut = closeCurtain;

var nTotalFrames:Number = leftCurtain._totalframes;

function openCurtain():Void{
var nFrame:Number;
if(leftCurtain._currentframe > nTotalFrames / 2){
nFrame = leftCurtain._totalframes - leftCurtain._currentframe + 2;
}else{
nFrame = leftCurtain._currentframe;
}
leftCurtain.gotoAndPlay(nFrame);
rightCurtain.gotoAndPlay(nFrame);
}

function closeCurtain():Void{
var nFrame:Number = leftCurtain._totalframes - leftCurtain._currentframe;
leftCurtain.gotoAndPlay(nFrame);
rightCurtain.gotoAndPlay(nFrame);
}

We just changed the open and close functions to be a bit more smart ones, function that knows to which frame to gotoAndPlay, it does it according to the current frame and not just jump blindly to the beginning of each sequence.

Test the movie and behold, our interactive curtain is ready.

Tip: you can add this code, hit.useHandCursor = false; so the cusror won't change into a hand when you hover the curtain.

Download Curtain Animation source files

Script# - C# compiled into Javascript

Thursday, December 14th, 2006

This might sound familiar to you, the idea of writing an Object Oriented code, that allow compile-time checking, and good code design, that is then compiled into a script code was introduced by Macromedia at 2003 with Flash 7 and it's shiny new Actionscript 2.0, but, AS2, with all the respect is not as complete as C#.

Script# does the same for Javascript, it lets you leverage the power of C# with it's Object Oriented abilities and compile it into a clean and readable Javascript.
The new Script# version 0.2.0.0 now have added support for WPF/E.

Learn more about it...

There is a similar OS tool named Google Web Toolkit that appearntly does similar things for Java and Javascript.

Uglying your photos with style

Monday, December 11th, 2006

You might call it Pimp if you want it to sound cooler, but all in all pikipimp.com will help you make fun of people by uglying their images. Check out how I've uglified this beautiful model. You won't see too many masterpieces coming from there, maybe also because it isn't meant for creating works of art. The "Pimping" is easily done and is accessible for everyone. You simply upload your photo and immediately you can start to drag elements like beards and glasses on it.

I think, that not so long ago, maybe a year ago, it was unlikely that such a website will emerge. Before the Javascript-goldenage no one would have dare to use such a complex Javascript which now looks very natural to use. Also the hype around such a site wouldn't be as massive, these days it is mentioned in many of the leading Web 2.0 / technical blogs like Techcrunch and Go2Web2.

While it was neatly done with javascript, and I've read the author mentioned Ruby, some apps are just ment to be flashed. For example, rotating the elements is done by the server and suffer from a long unintuitive delay, Flash could easily handle these rotations on the client. Also, the stacking of the elements is done by setting the HTML div's position to absolute, that's the only way z-index can be applied in HTML, on the other hand, your image is embeded along with the relative site structure, so, if you resize your page your creation get scrambled. There are many more improvements that Flash could have handled, I won't have to tell you everything, when every stupid innovation is worth millions of dollars and can be called a Start-Up these days ;) lol.

Get piki-pimping...

PikiPimp Interface

pikipimp_glasses

Every element has it's own controls

pikipimp_controls

Original photo

pikipimp_model_small

Pimped (uglified) photo

pikipimp_pimped