      */
     override protected function initInstance(instance:IEffectInstance):void
     {
+        switch (direction)
+        {
+            case WipeDirection.RIGHT:
+                shaderByteCode = wipeRightShaderCode;
+                break;
+            case WipeDirection.LEFT:
+                shaderByteCode = wipeLeftShaderCode;
+                break;
+            case WipeDirection.UP:
+                shaderByteCode = wipeUpShaderCode;
+                break;
+            case WipeDirection.DOWN:
+                shaderByteCode = wipeDownShaderCode;
+                break;
+        }
         super.initInstance(instance);
-        
-        var wipeInstance:WipeInstance = WipeInstance(instance);
-        wipeInstance.direction = direction;
     }
     
 }

import flash.display.Shader;
import flash.utils.ByteArray;
import mx.effects.IEffectInstance;
import spark.effects.supportClasses.WipeInstance;

/**
 *  The Wipe effect performs a bitmap transition effect by running a

    public function Wipe(target:Object=null)
    {
        super(target);
        // Note that we do not need a separate WipeInstance; the only
        // addition that Wipe adds is specifying the Crossfade
        // Pixel Bender shader, which is done at instance creation time,
        // according to the value of the direction property. 
        // Everything else needed is in the superclass already.
    }

    /**
