The Reality of Plastic Surgery

Often we read about how vast majority of people have benefitted from plastic surgery. Every now and then there is news of some celebrity undergoing through body shaping and organ modifying surgeries to beautify themselves and to enhance their look. It is not a simple financial procedure for common people to aspire for. Having understood their popularity, they often come with a lot of bucks.  If we leave the financial setbacks aside, beauty is something any person would aspire for. While some are naturally gifted of the same, others who have not been so, tend to feel guilty and insecure. This creates negative thinking and sometimes depression which is not a welcoming sign. Especially people in the glamour industry like movies, fashion and beauty are expected to maintain their shrine and beautiful looks. Companies like PlasticSpot have left a mark in the modern surgical procedures.

Since modern world has solution to almost any problem, so is it with beauty also. It is no more just a god’s gift. With advanced medical and cosmetic treatments many of your beauty problems can be set erect. Thanks to the revolution called Plastic surgery that has emerged as the body sculpting business. Its phenomenal success in the recent times has transformed the lives of many handicapped and not so great looking people bringing new hopes. The outcome of these treatments has even showed positive effects on many people.  They claim to have gotten positive approach towards life. However it is equally important to note that like every coin has two sides, these surgeries also have their own ups and downs.


angel wings pros of plastic surgery

Boosts confidence:  These surgeries result in boosting up your confidence levels. If there is a body part that you wish could have been better for example a flat nose or broad chin, you can change it with the help of small surgery that will make you look better. Your self-image is bettered and there will be an overall change in the way you look yourself. You will start feeling good and positive.

Boosts up health: The main advantage of these surgeries it improves the health condition of a person. A man with large breasts may have a risk of cancer in that area. Similarly a person with nose joints may experience sinus which can be corrected with a surgery. Some health complications can be rectified with the help of minor treatments.

Repair of bodily parts: Often we hear only about surgeries done on famous celebrities and the complications faced by them.  But the ultimate goal of cosmetic surgeries is to improve the quality of life. Any bodily organ with birth deformities can be easily corrected with the help of these surgeries. Many life changing and positive rendering stories have not seen light. There are instances where children with cleft palates were treated with reconstructive operations thereby bringing a new light in their lives.

Life changing experience:  A person is left with a life changing experience with the kind of new positive experiences that one experiences. The thought that the slightest physical pitfalls that made a person a gloomy are now welcomed with a total new appearance is something that only that person can experience. It becomes a life changing phenomenon and this experience stays on.

Social relationships: The new look will make you a socially healthy person. The people with whom you have interacted with delicacy will far more await to see you in contact. The shy and back stepping guy in you will take a back seat and you will be proactive in your social relations. This creates a healthy and new born YOU.


Health complications: Any surgery comes with its own downsides.   Just like any other surgery, these also take several months to heal and to see the desired result. Some people may be allergic to anaesthesia and might develop quick reactions.  While recovery time takes time, some people may develop side effects in the meantime.

Unreal expectations:  Very often we see film stars and pop singers undergoing these surgeries and bringing a new look to themselves. Common people fall to these kind of false advertisements and expect a lot from these surgeries. If the result is not up the expectations, they tend to get depressed. So it is important to understand the real life scenarios and come out of unreal expectations.

Plastic Surgery is Costly

Many of these surgeries loot out whole lot of money from you. It is seriously not pocket friendly for common man. The minimum cost of any surgery is $2500. Moreover there are rarely insurance coverages for these surgeries. Except for few birth defects operations and some accident injuries there are hardly coverages.

Time taking: Unlike the promises given by companies, these surgeries are not quick in action. They take time in showing the results and test patient’s patience. There will be instances where you will be required to pay frequent visits to physicians which is mentally and financially frustrating.

Recovery time:  Sometimes the recovery takes lot of time and you will be expected to take lot of care post-surgery. You are not allowed to go out in the sun, use certain products etc depending on the surgery you have undergone. It is not always possible to follow the care procedures that too, for longer periods of time.

Mixed reactions: We live in a society of back stabbing. Though there are chances of feeling better in public after the modified look, there will be people who keep degrading you criticising it is not a natural look. They may assume you to be low in esteem and modesty. Your confidence, instead of boosting up, may fall low in those situations making you feel depressed.

Every surgery has its own merits and demerits. It is incumbent on the patient to have a detailed study of the positive and negative impacts of the same. Also it is important to identify a reliable source which can act as real life changer and bring out a feel good person from you.

Exponential Technology Curve over time – Explaining the expansion

The best way to judge your present is to look back and analyze your past. The world, however, has started to govern itself through numbers rather than their social stature. The introduction of science and the subsequent influx of technology has made sure that every progression, digression, detour, and the trend has been mapped out through the help of statistical data. The data gives out the information where further development could be planned and areas of concern are taken care of. The technology has, however, mostly seen concave curves coming its way since its inception and now, is a non-detachable part of the world.

Moore’s Law

The law was particularly designed to address the number of transistor in the electronically integrated circuits and states that the transistor doubles up every two years, give or take. This has transposed into a universal law for the world of electronics as can be seen in a lot of the aspects.

The growth in the law was restricted to the usage of the transistors but with time, it has been identified that the law holds for a lot of other aspects of an electronic device. They range from the pricing of the product to its sales to its processing speed to the memory capacity to any other intricate attribute of the electronic machines.

The exponential curve

The Exponential Technology curve over time has maintained its acceleration and slope which is an unprecedented event in any business. The curve that looks like an upward facing bowl grows at a rate that is faster than linearity with a slope of at least 2.7 greater than normal.

The curve does not possess a constant slope but is marked by a continuous upward bend. The degree of the bend is subjected to the regular growth of the system (any attribute) and the length of intervals, it achieves that growth. Astonishingly, there is no irregularity in the curve in the form of a downward slope which is an accolade itself owing to the dwindling trends of the market.

This gives the idea that the technology is growing and rest assured, it actually is. Through the exponential technology curve over time, one can predict the future or analyze the past trends but to understand why it is defying the most solid of economic trends, one needs to dig deeper.

Reason for the acceleration

The reason a technological product has an exponential curve attached to it is that the whole process of technological advancement works on the process of evolution. The need to better the current product, identify potential glitches and rectify them as soon as possible is the major reason why the market remains so accepting to this product.

The second reason is that the evolutionary process in itself works with high acceleration. With a massive turnout of Science graduates and a whole lot of investment from the government and industries, the procedure of uplifting the standards of the product gets swifter.

The market for Science is so wide and the potential of it so vast that the exponential part of the curve will continue to persist. Therefore, the surprise factor should not take precedence as much as the accepting factor should, owing to a wonderful trend that the human brain has introduced.

Make The World A Secured Place to Live In With The New Age Technology

Information is the most important tool that is available in the modern world. Battles in the modern times are not being fought with weapons and warfare but with mind and information. There have been significant changes in the way we perceive information these days. From the manner in which the information is conveyed to the manner in which it is used, humans have discovered better ways to utilize and exploit information at the same time.

However, the advancement in the tech world has proved to be a boon and a bane at the same time. While on one hand, it helps a person to store relevant information and share it with interested users while on the other hand, it allows a person to exploit the information in the way he or she wants. This has led to the breach of privacy which is one of the trending topics in the global news. With each passing day, more and number of business houses and powerful companies are disclosing the news of privacy breach that has affected millions of people. More and number of innocent users are becoming the victims of the data breach that occurs every day. It is for this reason that modern technology is continuously trying to look for newer ways to protect information that are safe and secure as well. 2018 certainly brings a new ray of hope for the people who are looking for safer and more secured mediums for the transfer and sharing of information.

The vicious circle

The privacy breach is something that has become a raging issue among the people and organizations around the world.  The basic reason behind the data theft can be quite different depending on the needs of people. However, it is totally illegal and it is for this reason why the breach of privacy is so common in the organizations. Whether it is national security or international relations or the organizational data, nothing is safe from the clutches of the hackers who are always on the lookout of some or the other way to steal the information.

Light at the end of the tunnel

Although, it seems like an impossible task to ensure the safety of the data that lies on the internet and on systems, yet the current scenario in the technological world is continually changing. With the help of these newly found measures, several firms are on the lookout of developing measures that allow a person to encrypt the information in a way that it becomes absolutely difficult for any breach of privacy and information. One such technology that is still in its nascent phase is the ZKP or the zero-knowledge proof which is basically a technology that uses the advanced stages of cryptography to modify the information in a way so as to protect it from theft or breach.

Thus, with the help of the right technology by your side, you can be quite hopeful of the future of data.

How To Be In The List Of “Cool New Tech Websites Of 2018”?

The human needs were characterized by their food requirement, a sheltered place and clothes to wear. Nowadays, with the world running on the wheels of technology, it is very important to be tech-savvy and know in and out about what the new technology is in the market. The writing has changed significantly too with more films about science fiction and where it is leading us to more surrealistic novels about the technology adversely affecting the human life. The debate seems to be never-ending despite the trend staying persistent. Since the hierarchy is an ingrained attribute to humans, technology has been ranked too and particularly the websites that talk about them. Thus, in the year that is running, it is important to feature in the “Cool New Tech Websites of 2018”.

Things to include on the website

To feature in the “Cool New Tech Websites of 2018”, one needs to have certain features in their website that can outshine others. They have to be incorporated smartly that would cater to the audience visiting the website.

Informative and on-point material:

The website should be aware of what their core information is all about. The content on the article should be extremely informative about the concerned topic and should not deviate away to some other aspects of technology. Also, what is important is to understand the psyche of the target audience and what would they seek when they become a part of the traffic on the website.

Mentioning important links:

To make sure the article looks well-researched and to display the effort being put in, it is important that the material is referenced properly and to useful links. This will not only ensure more crawling and traffic but create stronger and better backlinks that can elevate the position of the website on the search engines.

Displaying personality:

To look cool, you have to be inherently cool. Thus, it is important that the personality of the creator is shown on the website through its content or architecture. A novel and different content are always appreciated by the users.


The most significant attribute to success is passion alongside attitude. If a person is passionate about their possession or their work, it shows in the final outcome. The work done with full passion and dedication is a great indicator to the user about how useful the website is to them and thus, repeat visits.

Simplifying complex technology-based problems:

Ensuring that the transmission of data is simplified to a level where a new entrant can understand it easily will help the website getting more traffic because nobody enjoys complex jargons that they cannot fathom and have to continuously visit other websites or consult a dictionary to make sense out of them.

Thus, with the trend to be the coolest and the best website in the world of technology, it is important to have a simplified strong content for the search engines to crawl and further, websites to backlink resulting in making it to the list when compiled.

Remove trace using Flex SDK

Trace removal.

I get asked this question quite often so I thought I would post the answer out there just because not too many developers are either sharing this or savvy on this. It’s less than perfect but is very good for a final release where you don’t want to have traces being fired from your project to improve performance for the playback of your Flash movie. I use the ant feature quite often in Eclipse in order to automate various development tasks and I am certainly not an expert at using ant yet but I am always finding it very useful and hungry to learn more. The code is rather basic all you need to do is run a regular expression over all your .as files to remove all instances of the trace function by adding this into an ant xml. It goes a little something like this :

<target name="removeTrace">
<replaceregexp match="trace(.*?);" replace="" flags="gs">
<fileset dir="${classesdir}" includes="**/*.as"/>

How not to hate SWF libraries

I have been playing with JSFL quite a bit recently and this little known technique may save you a a lot of time while working with SWF libraries. One thing I hate about Flash is linking library assets to classes. Actually I think linking library assets to already existing Classes is not a very good programming technique. Instead I always make sure they are anonymous classes generated at compile time.

Anyway I am getting side tracked. The process in either case to do this is really, really, really tedious and on a few occasions now I have been whinging to the guys at Adobe about this and how hopeless it is. But after many years it’s still just the same and lame.

You might ask why not use SWCs to manage library assets? Problem I have with SWCs is if you use them for all the assets in your project then your compile times will eventually go through the roof! This is something which your team could waste days or even weeks of time especially in longer production phases.

This said I still want a process where I can load assets from a SWF library with some kind of strict type safety and have not just rely on resolving library assets at runtime. This could allow for you to be aware that a library asset is missing before compiling.

Creating a bulletproof utility to map existing classes to your library assets would be quite difficult to setup. So instead I have written something simple (initially) which allows for you to automatically set library assets to be exported with linkage ids. This works by basically using the library name as the linkage id for an asset and iterating through selected library assets.

var packageName=prompt("Library package name","com.library.display");

var selItems = fl.getDocumentDOM().library.getSelectedItems(); 

for(var i =0; i<selItems.length; i++){
item = selItems[i];


var sliceIndex=className.lastIndexOf("/");

className = className.split(" ").join("");

var dotIndex=className.lastIndexOf(".");
if(dotIndex!=-1) className=className.slice(0,dotIndex);

item.linkageExportForAS = true;
item.linkageExportInFirstFrame = true;
item.linkageClassName = packageName+"."+className;


alert("Exported complete!");

Although this saves quite a bit of time it’s still kinda annoying, I would have to copy and paste linkage ids from the woeful Flash IDE library and I would not get any intellisense from FlashBuilder or FDT.

Although we can take this same idea a bit further to accommodate better support for intellisense with library assets from a SWF library with FlashBuilder or FDT. Although it’s important and maybe obvious this technique will require loading the SWF library assets into the parent applicationDomain by just using a Loader instance. Next by using JSFL you can create classes automatically based on the library items type. Here I am probably achieving this by an unintended use of the save function from the outputPanel but it allows for you to write classes and then save them into a particular folder.


I only set this JSFL up for Buttons, MovieClips and Bitmaps but this could be extended to work with other types. The JSFL to do this looks like :

var saveLocation=fl.browseForFolderURL("Save classes location");
var packageName=prompt("Package name","com.library.display");
var folderPath = packageName.split(".").join("/")+"/";


var selItems=fl.getDocumentDOM().library.getSelectedItems();

for (var i =0; i< selItems.length; i++) {
item= selItems[i];


var sliceIndex=className.lastIndexOf("/");

className = className.split(" ").join("");

var dotIndex=className.lastIndexOf(".");
if(dotIndex!=-1) className=className.slice(0,dotIndex);

item.linkageExportForAS = true;
item.linkageExportInFirstFrame = true;
item.linkageClassName = packageName+"."+className;

var templateClass='package '+packageName+' {
public class className extends baseClassName {
public function className() {

var linkageName=item.linkageClassName;


var sliceIndex=className.lastIndexOf("/");

className = className.split(" ").join("");

var dotIndex=className.lastIndexOf(".");
if(dotIndex!=-1) className=className.slice(0,dotIndex);

className = className.substr(0, 1).toUpperCase()+className.substr(1, className.length-1);

var baseClassName=item.linkageBaseClass;
var classConstructor='addChild(new (getDefinitionByName("linkageName"))());';
var classImports = ' import flash.utils.getDefinitionByName;\n';

switch (item.itemType) {
case "bitmap" :
classConstructor='super(new (getDefinitionByName("linkageName"))(0, 0));';
case "movieclip" :
case "button" :

classImports+=' import '+baseClassName+';';



Though if you don’t like using this approach of creating stub classes for retrieving library assets from a SWF library then there is one last technique using JSFL which you can use whilst still having some ability to use intellisense. Like I mentioned before the most annoying part of working with SWF library assets is not having intellisense. We could then instead of creating classes as a reference to the library SWF class, automatically create a single LibraryLinkageReferences class which contains static constants which are references to the library linkage ids.

var saveLocation=fl.browseForFolderURL("Save class location");
var libraryPackageName=prompt("Library package name","library");
var classPackageName=prompt("Class package name","com.library.display");

var folderPath = classPackageName.split(".").join("/")+"/"; 
var templateClass = 'package '+classPackageName+' {\n public class LibraryLinkageReference{\n';


var selItems =fl.getDocumentDOM().library.getSelectedItems();

for (var i =0; i< selItems.length; i++) {
item= selItems[i];


var sliceIndex=className.lastIndexOf("/");

className = className.split(" ").join("");

var dotIndex=className.lastIndexOf(".");
if(dotIndex!=-1) className=className.slice(0,dotIndex);

className = className.substr(0, 1).toUpperCase()+className.substr(1, className.length-1);

item.linkageExportForAS = true;
item.linkageExportInFirstFrame = true;
item.linkageClassName = libraryPackageName+"."+className;

templateClass+="public static const "+className.toUpperCase()+":String = \""+item.linkageClassName+"\";\n";

templateClass+=' }\n}';


alert("Exported complete saved to : "+saveLocation+folderPath+"");

Setup Library Classes

AES Cryptography for Actionscript PHP

Over the last couple of years I have used encryption on many Flash projects and until the other day, this was always a straight forward task. Cryptography has been particularly useful when to protect a server side script from fraudulent attacks. This has included things like a high score board or the progress of players through out a game.

In the past I had always used Hurlant’s crypto library which has quite a few cryptography options and includes my favorite algorithm AES. Advanced Encryption Standard is a quite secure cryptography solution and is supposedly the exact same level of encryption used by American Government’s NSA. I am not a server side guy typically but I can code C#. The nice thing about C# and AES when transacting to and from Flash is it works perfectly. PHP unfortunately does not have an official cryptography package, but thankfully there are many efforts to support this cryptography algorithm from within the community. This might sound OK, but the problem we had with this is Hurlant’s AS3 cryptography library doesn’t seem to be able to interface with the PHP AES options we tried (though it seems to work fine with other languages like C#). We did put in a good hour or so trying several mode, pad and encoding options – no dice. After a quick Google on this issue because usually if you are facing a weird issue there’s a damn good chance others have faced it already. So Google revealed to us this is a common problem and I was told maybe it’s better to find an alternative cryptographic solution. Me being, well me 🙂 I don’t like being beaten on any technical challenge. During my Google link travels I came across this great Javascript implementation of AES which also has a PHP option. Knowing that Javascript and Actionscript fall under the same standards. I figured rather than find using a different encryption option which is less secure. I quickly ported the Javascript code to Actionscript which took about 15 mins and funnily this post took much longer than this to write 🙂

Actionscript AES Encryption

So here is a simple example demo with just pure Actionscript AES encryption and decryption with a block cipher of 256 bits.

PHP AES Encryption from Flash

And here is another example demonstrating Actionscript to PHP AES encryption and decryption with the same block cipher of 256 bits. Both demonstrations use the same key so if you change the keys so they do not match then they will not be able to decrypt between each other. Also in this demonstration I post the key with the text to either encrypt or decrypt, you would of course never do this when using AES normally.

I hope this is sunshine on a rainny day for someone out there, you can download the source code from the Lost In Actionscript repository or download an archived version.

FITC 2010

It’s been a while between posts, I have plenty of excuses but shortly it’s been a really busy year and I have a lot of draft posts I must finish. After my first major conference talk at FITC last year I decided on my own regards that it might be the first and last time that I might do conferences of this calibre again. My reason for making this decision is complicated, but one major reason is because of the sheer amount of time and effort that go’s into pre-planning a conference talk and those who know me professionally I am just *slightly* the control freak and unfortunately time short! So after turning down many offers both local and abroad, I have decided to talk at FITC 2010 and resume conferencing mostly because the organizers are just so damn nice there and who can say no to a trip to Amsterdam – not me.

This year my talk will be much more exciting than last years, despite this the venue was p-a-c-k-e-d. If you missed it, Grant Skinner is pretty much covering a majority of this content in his FITC session Quick as a Flash. Though this year I am excited to say my talk is on Physics and Behavioral Character Motion. This talk will cover how to animate characters in a life like and improvisational using Actionscript and Flash. Though my talk will be best experienced with having a small amount of Actionscript knowledge. I will try to demonstrate tips and tricks to show how you can get these nice motion effects with very little maths ability and some experience in Flash alone.

My talk will begin by explaining how to look clever by making things move with super easy physics equations and how you can combine this knowledge with the new CS5 physics features and the existing IK stuff. Once we have a few things moving and colliding around properly I will then go on to show how to go about making things move under strategic behavioral motion constraints. This will then start to give some indication of AI with things like formation patterns. Lastly we will take the AI a step further by adding needs, desires and personality to our characters with creative and very simple application of complicated sounding things like finite state machines and decision trees so the behavioral motion makes sense.

I think the talk should be really exciting and hopefully inspiring for anyone attending, says me ‘I would go’. Also for free I will be giving attendees the source code from the conference so you can play around at home. I hope to see you there and maybe even have a drink together to talk geek. Mind you had better get in quick because if you are any where in Europe and slightly keen to attend, snatch a bargain with an early bird ticket for FITC Amsterdam because these tickets usually sell like hot cakes.

Custom blend modes for Flash 10

In the last few months I have been working on a collection of blendmodes for Flash 10 which extend the limited set of blendmodes currently and inconsistently supplied by Adobe applications. This can help to achieve all kinds of motion effects which I won’t go into detail here but if you know a little about After Effects you will know that some of these are rather exciting.

If you are familiar with the Adobe product line there is inconsistency between Photoshop/Illustrator/Flash/Fireworks/InDesign and support for various subsets of blendmodes which is rather annoying especially for us Flash guys. This project overzealously named the ‘Ultimate Blend Mode Collection’ is an attempt to standardize this unofficially on Adobes behalf. So marrying up Photoshop designs and Flash layouts with unsupported blendmodes won’t be nearly as annoying as has been previously. Further to this, these custom blendmodes allow for control to and undo the blendmode effects. What this means is you do not have to double up the blendmode effect by duplicating the DisplayObject instance with the same blendmode you can just multiply the single blendmode effect – simple and quite effecient.

So far I have completed the following custom blend modes :

  • Add
  • Hard Mix
  • Hardlight
  • Glow
  • Subtract
  • Stencil Luma
  • Extrapolate
  • Difference
  • Average
  • Lighter Color
  • Lighten
  • Color Dodge
  • Stencil Alpha
  • Stamp
  • Softlight
  • Silhouette Luma
  • Silhouette Alpha
  • Screen
  • PinLight
  • Phoenix
  • Overlay
  • Negation
  • Multiply
  • Linear Light
  • Linear Dodge
  • Linear Burn
  • Darken
  • Desaturate
  • Exclusion
  • Color Burn
  • Alpha
  • Darker Color

These are working though have issues of dirty-ness on alpha channels (explained below) for blending layers :

  • Reflect
  • Freeze
  • Heat
  • Vivid Light

These custom blend modes are currently in development :

  • Color
  • Hue
  • Luminosity
  • Saturation
  • Dissolve

How to use custom blend modes

I have only provided a method to use these custom blend modes included with the ‘Ultimate Blendmode Collection’ for Flex and CS4 users. This is because the PBJ files are compiled into a SWC so you will need to be able to reference SWCs from your FLA or SWF compiler to use the custom blend modes I have mentioned. The syntax to apply a custom blend mode can be achieved via any of the following approaches :

  1. import flash.display.BlendModeShader;
  2. myDisplayObject.blendShader = BlendModeShader.SOFTLIGHT;


  1. import flash.display.BlendModeShader;
  2. import flash.display.shaders.*;
  3. myDisplayObject.blendShader = new BlendModeSoftlight;

or you can manipulate the shader

  1. import flash.display.BlendModeShader;
  2. import flash.display.shaders.*;
  3. var customBlendMode: BlendModeSoftlight = new BlendModeSoftlight;
  4. customBlendMode.multiply = 2;
  5. customBlendMode.alpha = 0.5;
  6. myDisplayObject.blendShader = customBlendMode;

Tips for writing your own custom blend modes

Here are some potentially huge gotchas and lovely time savers for those wanna be pixel shader writers (like myself) :

  1. Un-multiply alpha before carrying out your shader algorithm. You might already know that Flash pre-multiplies the alpha channel onto the rgb channels this means that if you want to know what the actual rgb components are you will need to do the following :
    1. void
    2. evaluatePixel
    3. float2 uv = outCoord;
    4. float4 src1Rgba = sampleLinearsrc1, uv;
    5. float src1Alpha = src1Rgba.a;
    6. ifsrc1Alpha>0.0 src1Rgba.rgb *= 1.0/src1Alpha; //This line un-multiplies the alpha from the rgb channels
  2. When your done manipulating your blending layer against the base layer it’s more than likely you will need to composite your new blending layer and base layers together while preserving the alpha components. The following should be useful for this :
    1. void
    2. evaluatePixel
    3. ……
    4. interpolateAlpha = src2Rgba.a;
    5. inverseAlpha = 1.0-interpolateAlpha;
    6. dst.rgb = src2Rgba.rgb+src1Rgba.rgb*inverseAlpha;
    7. dst.a = min1.0, src1Alpha+src2Alpha;
  3. Make sure you clamp the components you are altering between 0.0 and 1.0 outside these will give you unusual results between tests made with the Pixel Bender Toolkit and from a published Flash movie. This bit of code ought to fix this :
    1. void
    2. evaluatePixel
    3. float3 minRgb = float30.0, 0.0, 0.0;
    4. float3 maxRgb = float31.0, 1.0, 1.0;
    5. ……
    6. dst.rgb = clampdst.rgb, minRgb, maxRgb;
  4. Because Flash premultiplies alpha and I explained earlier about why you may need to un-multiply alpha from the rgb components. It’s important to know from this there is a certain degree of losiness and this article by Mario is a great Actionscript explanation (completely unrelated to shaders) of this and is one among many others crying out for help (like me). You may notice in the example below which demonstrates these custom blend modes (or in your own tests) a certain degree of image dirty-ness and this dirty-ness is due to this. I am still working on a way to reduce or get around this – any ideas are certainly welcome – and I’ve highlighted the shaders above most affected by this.
  5. When applying a shader the input sources for the blending and base layer are automatically set. This is great but doesn’t allow for setting any further image4 inputs. From my tests if I do try to do this then the Flash Player crashes every time. This is bug and generally bugging me because I can’t complete other custom blendmodes based on random math like the Dissolve blendmode

How to get the custom blend modes

I have placed my PBJ, PBK and SWC files on a project. I have also put together a brief getting started page. If you want to get an idea of what’s possible using these custom blend modes the simple example below should help to demonstrate this. Also make sure you try out a few of the various base and blending layers I have set up to see what does what.


If you are interested in writing your own blend modes I used quite a few sources in order to collect the algorithms used in the examples seen above – here are the main sources :

Export Layers to SWF with JSFL

It’s embarrassing but until the other week I hadn’t a reason to do anything (beyond tinkering) with JSFL. JSFL can be especially useful for simplifying or automating tasks in the Flash IDE and that isn’t breaking news. I think I understand why I haven’t been using JSFL too much until recently. The major problem I discovered is the documentation is very poor, if you search JSFL you get exactly diddly squat on how to use JSFL. And alas Googling JSFL aint much better with the term “JSFL Reference” the only adobe link is this one. Considering this help reference is 5 years old doesn’t inflate confidence in learning the latest and greatest JSFL has to offer – this is really pathetic Adobe. If someone can find an official decent resource on JSFL it would be appreciated, SURELY that isn’t it 🙂 So despite not being able to find a great JSFL reference Eventually I was referred to this great JSFL reference. The JSFL script I needed to write was really quite basic and for Actionscript developers writing JSFL it is very familiar territory so I was somehow blindly confident.

So I will describe the usefulness of this JSFL script by first explaining the task or problem at hand it solved for me and hopefully you find it useful also.

The Problem
I had a rather complex vector map (12 MB) in a SWF. Embedding the whole map would be obviously be a BAD idea for loading times but fortunately only very small portions of this map had to be used at any time. Though the sucker punch to this idea is that the map isn’t grouped to these portions – sigh.

The Solution
So I started with some unavoidable and rather laborious instance naming grinding which I did within Flash. Once I had completed this I had literally 100’s of Movieclips associated to Classes that needed to be published and when I hit this I realized – JSFL I love you! So I distributed these MovieClips to layers then ran this script and viola all the layers are published as SWFs using the layer name as the published SWF name – ba da boom ching 🙂

The way this script works is that publishes any layer that isn’t a folder or a guide on the main timeline. Then sets all the layers to guides, then loops through the layers desired to be outputted to SWF then changes them to a normal layer so that only this layer is the only one in the published SWF. Once the publish loop is completed all layers are then set back to their original states.

Rather simple I thought and a huge time saver for mindless SWF publishing. To run this JSFL simply double click it or drag it onto Flash then you will be prompted to select the output directory. Then sit back, relax or even take the evening off and tell your project manager you’re hard at work!

You can view the source or download this script here – get it while it’s hot!