﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="book" content="ActionScript&nbsp;3.0&nbsp;Language&nbsp;and&nbsp;Components&nbsp;Reference"><link rel="stylesheet" href="../../style.css" type="text/css" media="screen"><link rel="stylesheet" href="../../print.css" type="text/css" media="print"><link rel="stylesheet" href="../../override.css" type="text/css"><meta name="keywords" content="Shader,flash.display.Shader,ACTIONSCRIPT2,ACTIONSCRIPT3,ADD,ALPHA,ALPHA,ALWAYS,AUTO,BEST,BEVEL,BLUE,BOOL2,BOOL3,BOOL4,BOOL,BOTTOM,BOTTOM,BOTTOM,BOTTOM_LEFT,BOTTOM_LEFT,BOTTOM_RIGHT,BOTTOM_RIGHT,CURVE_TO,DARKEN,DEFAULT,DEFAULT_OFF,DEFAULT_ON,DIFFERENCE,ERASE,EVEN_ODD,EXACT_FIT,FAST,FLASH10,FLASH1,FLASH2,FLASH3,FLASH4,FLASH5,FLASH6,FLASH7,FLASH8,FLASH9,FLOAT2,FLOAT3,FLOAT4,FLOAT,FULL,FULL_SCREEN,FULL_SCREEN_INTERACTIVE,GREEN,HARDLIGHT,HIGH,HORIZONTAL,INT2,INT3,INT4,INT,INVERT,LAYER,LEFT,LEFT,LIGHTEN,LIGHTWEIGHT,LINEAR,LINEAR_RGB,LINE_TO,LOW,MATRIX2X2,MATRIX3X3,MATRIX4X4,MAXIMIZED,MEDIUM,MINIMIZED,MITER,MOVE_TO,MULTIPLY,NEGATIVE,NEVER,NONE,NONE,NONE,NONE,NONE,NONE,NON_ZERO,NORMAL,NORMAL,NORMAL,NORMAL,NORMAL,NO_BORDER,NO_OP,NO_SCALE,OFF,ON,OVERLAY,PAD,POSITIVE,RADIAL,RED,REFLECT,REPEAT,RGB,RIGHT,RIGHT,ROUND,ROUND,SCREEN,SHADER,SHOW_ALL,SQUARE,STANDARD,SUBTRACT,TOP,TOP,TOP,TOP_LEFT,TOP_LEFT,TOP_RIGHT,TOP_RIGHT,UNSUPPORTED,UTILITY,VERTICAL,WIDE_LINE_TO,WIDE_MOVE_TO,accessibilityProperties,actionScriptVersion,active,align,alpha,alpha,alphas,alwaysInFront,applicationDomain,bitmapData,bitmapData,blendMode,blendShader,bounds,bounds,buttonMode,byteCode,bytesLoaded,bytes,bytesTotal,cacheAsBitmap,caps,channels,checked,childAllowsParent,childSandboxBridge,closed,colorCorrection,colorCorrectionSupport,colorDepth,color,colors,commands,content,contentLoaderInfo,content,contentType,contextMenu,culling,currentFrameLabel,currentFrame,currentLabel,currentLabels,currentScene,data,data,data,displayState,displayState,doubleClickEnabled,downState,dropTarget,enabled,enabled,enabled,fill,filters,focalPointRatio,focusRect,focus,frameRate,frameRate,frame,framesLoaded,fullScreenHeight,fullScreenSourceRect,fullScreenWidth,graphics,graphics,height,height,height,height,height,height,height,hitArea,hitTestState,index,index,indices,input,interpolationMethod,isSeparator,items,joints,keyEquivalentModifiers,keyEquivalent,label,labels,loaderInfo,loader,loaderURL,mainScreen,mask,matrix,matrix,matrix,maxSize,maximizable,maximizable,menu,menu,minSize,minimizable,minimizable,miterLimit,mnemonicIndex,mouseChildren,mouseChildren,mouseEnabled,mouseX,mouseY,name,name,name,name,nativeWindow,numChildren,numChildren,numFrames,numItems,opaqueBackground,overState,parameters,parentAllowsChild,parent,parentSandboxBridge,parent,pixelHinting,pixelSnapping,precisionHint,progress,quality,ratios,rect,repeat,resizable,resizable,root,rotation,rotationX,rotationY,rotationZ,sameDomain,scale9Grid,scaleMode,scaleMode,scaleX,scaleY,scaleZ,scenes,screens,scrollRect,shader,shader,sharedEvents,showDefaultContextMenu,smooth,smoothing,soundTransform,soundTransform,spreadMethod,stageFocusRect,stageHeight,stage,stage,stageWidth,submenu,supportsMenu,supportsNotification,supportsTransparency,swfVersion,systemChrome,systemChrome,systemMaxSize,systemMinSize,tabChildren,tabChildren,tabEnabled,tabIndex,target,textSnapshot,textSnapshot,thickness,title,totalFrames,trackAsMenu,trackAsMenu,transform,transparent,transparent,transparent,type,type,type,type,upState,url,useHandCursor,useHandCursor,uvtData,value,vertices,visibleBounds,visible,visible,width,width,width,width,width,width,width,winding,x,x,y,y,z"><title>flash.display.Shader (ActionScript 3.0)</title><script src="../../AC_OETags.js" type="text/javascript"></script></head><body><script language="javascript" type="text/javascript" src="../../asdoc.js"></script><script language="javascript" type="text/javascript" src="../../help.js"></script><script language="javascript" type="text/javascript" src="../../cookies.js"></script><script language="javascript" type="text/javascript">  
            <!--  
			    
				asdocTitle = 'Shader - ActionScript 3.0 Language and Components Reference';

				var baseRef = '../../';

				window.onload = configPage;
			      
			    -->  
            </script>
<script language="javascript" type="text/javascript"><!--
function submitValue(){
var searchStr=document.getElementById('search-livedocs').value;
window.location="../../search.html"+"###"+searchStr;
}
--></script><script type="text/javascript">
		scrollToNameAnchor();
	</script><table class="titleTable" cellpadding="0" cellspacing="0" id="titleTable" style="display:none"><tr><td class="titleTableTitle" align="left">ActionScript 3.0 Language and Components Reference</td><td class="titleTableSearch" align="center"><form class="searchForm" method="get" action="../../search.html" onsubmit="submitValue();"><input class="hidden" name="loc" value="" type="hidden"><input class="hidden" name="termPrefix" value="" type="hidden"><input class="hidden" name="term" value="" type="hidden"><input class="hidden" name="area" value="" type="hidden"><input id="search-livedocs" name="search_text" value="" title="" type="text"> <input type="button" name="action" value="Search" onclick="submitValue()"></form></td><td class="titleTableTopNav" align="right"><a href="../../../../Flash/10.0_Welcome/index.html">Home</a>&nbsp;|&nbsp;<a href="../../package-summary.html" onclick="loadClassListFrame('../../all-classes.html')">All Packages</a>&nbsp;|&nbsp;<a href="../../class-summary.html" onclick="loadClassListFrame('../../all-classes.html')">All Classes</a>&nbsp;|&nbsp;<a href="../../language-elements.html">Language Elements</a>&nbsp;| <a href="../../all-index-Symbols.html" onclick="loadClassListFrame('../../index-list.html')">Index</a>&nbsp;|&nbsp;<a href="../../appendixes.html">Appendixes</a>&nbsp;|&nbsp;<a href="../../conventions.html">Conventions</a>&nbsp;|&nbsp;<a id="framesLink1" href="../../index.html?flash/display/Shader.html&amp;flash/display/class-list.html">Frames</a><a id="noFramesLink1" style="display:none" href="" onclick="parent.location=document.location"> No Frames </a></td><td class="titleTableLogo" align="right" rowspan="3"><img src="../../images/logo.jpg" class="logoImage" alt=" Adobe Logo " title=" Adobe Logo "></td></tr><tr class="titleTableRow2"><td class="titleTableSubTitle" id="subTitle" align="left">Shader</td><td class="titleTableSubNav" id="subNav" align="right" colspan="2"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#eventSummary">Events</a>&nbsp;| <a href="#styleSummary">Styles</a>&nbsp;| <a href="#effectSummary">Effects</a>&nbsp;| <a href="#constantSummary">Constants</a>&nbsp;| <a href="#includeExamplesSummary">Examples</a></td></tr><tr class="titleTableRow3"><td colspan="3">&nbsp;</td></tr></table><script language="javascript" type="text/javascript" xml:space="preserve">
                
                    
                

				<!--

				
				    
				

					if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Shader"); titleBar_setSubNav(false,true,false	,false,false,false,true,true,false	,false,false,false,false,false);}

				    
				        
				    
				-->
                
                    
                
			</script><div class="MainContent"><table class="classHeaderTable" cellpadding="0" cellspacing="0"><tr><td class="classHeaderTableLabel">Package</td><td><a href="package-detail.html" onclick="javascript:loadClassListFrame('class-list.html')">flash.display</a></td></tr><tr><td class="classHeaderTableLabel">Class</td><td class="classSignature">public  class  Shader</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">Shader  <img src="../../images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> <a href="../../Object.html">Object</a></td></tr></table><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p></p>
        A Shader instance represents a Pixel Bender shader kernel in ActionScript. To use 
  a shader in your application, you create a Shader instance for it. You 
  then use that Shader instance in the appropriate way according to the effect 
  you want to create. For example, to use the shader as a filter, you 
  assign the Shader instance to the
        <code>shader</code>
        property of a 
  ShaderFilter object.
        <p>A shader defines a function that executes on all the pixels in an image, 
  one pixel at a time. The result of each call to the function is the output 
  color at that pixel coordinate in the image. A shader can specify one or more 
  input images, which are images whose content can be used in determining the 
  output of the function. A shader can also specify one or more parameters, 
  which are input values that can be used in calculating the function output. In 
  a single shader execution, the input and parameter values are constant. The only 
  thing that varies is the coordinate of the pixel whose color is the function result. 
  Shader function calls for multiple output 
  pixel coordinates execute in parallel to improve shader execution performance.</p>
        
               <p>The shader bytecode can be loaded at run time using a URLLoader instance. 
  The following example demonstrates loading a shader bytecode file at run time 
  and linking it to a Shader instance.</p>
        
               <div class="listing"><pre>var loader:URLLoader = new URLLoader();
  loader.dataFormat = URLLoaderDataFormat.BINARY;
  loader.addEventListener(Event.COMPLETE, onLoadComplete);
  loader.load(new URLRequest("myShader.pbj"));
   
  var shader:Shader;
   
  function onLoadComplete(event:Event):void {
      // Create a new shader and set the loaded data as its bytecode
      shader = new Shader();
      shader.byteCode = loader.data;
      
      // You can also pass the bytecode to the Shader() constructor like this:
      // shader = new Shader(loader.data);
      
      // do something with the shader
  }</pre></div>
        
               <p>
          You can also embed the shader into the SWF at compile time using the
          <code>[Embed]</code>
          metadata tag. The
          <code>[Embed]</code>
          metadata tag 
  is only available if you use the Flex SDK to compile the SWF. The
          <code>[Embed]</code>
          tag's
          <code>source</code>
          parameter points to  
  the shader file, and its
          <code>mimeType</code>
          parameter is
          <code>"application/octet-stream"</code>
          , as in this example:
        </p>
        
               <div class="listing"><pre>[Embed(source="myShader.pbj", mimeType="application/octet-stream)]
  var MyShaderClass:Class;
   
  // ...
  
  // create a new shader and set the embedded shader as its bytecode
  var shaderShader = new Shader();
  shader.byteCode = new MyShaderClass();
   
  // You can also pass the bytecode to the Shader() constructor like this:
  // var shader:Shader = new Shader(new MyShaderClass());
   
  // do something with the shader</pre></div>
        
               <p>
          In either case, you link the raw shader (the
          <code>URLLoader.data</code>
          property 
  or an instance of the
          <code>[Embed]</code>
          data class) to the Shader instance. As 
  the previous examples demonstrate, you can do this in two ways. You can  
  pass the shader bytecode as an argument 
  to the
          <code>Shader()</code>
          constructor. Alternatively, you can set it as the Shader 
  instance's
          <code>byteCode</code>
          property.
        </p>
        
               <p>Once a Shader instance is created, it can be used in one of several 
  ways:</p>
        
               <ul>
                  <li>
            A shader fill: The output of the shader is used as a fill for 
        content drawn with the drawing API. Pass the Shader instance as 
        an argument to the
            <code>Graphics.beginShaderFill()</code>
            method.
          </li>
                  <li>
            A shader filter: The output of the shader is used as a graphic filter
        applied to a display object. Assign the Shader instance to the
            <code>shader</code>
            property of a ShaderFilter instance.
          </li>
                  <li>
            A blend mode: The output of the shader is rendered as the blending 
        between two overlapping display objects. Assign the Shader instance 
        to the
            <code>blendShader</code>
            property of the upper of the 
        two display objects.
          </li>
                  <li>
            Background shader processing: The shader executes in the background, 
        avoiding the possibility of freezing the display, and dispatches an 
        event when processing is complete. Assign the Shader instance to 
        the
            <code>shader</code>
            property of a ShaderJob instance.
          </li>
               </ul>
        
            <p></p><p><a href="#includeExamplesSummary">View the examples</a></p><p><span class="classHeaderTableLabel">See also</span></p><div class="seeAlso"><a href="DisplayObject.html#blendShader" target="">flash.display.DisplayObject.blendShader</a><br/><a href="Graphics.html#beginShaderFill()" target="">flash.display.Graphics.beginShaderFill()</a><br/><a href="ShaderJob.html" target="">flash.display.ShaderJob</a><br/><a href="../../flash/filters/ShaderFilter.html" target="">flash.filters.ShaderFilter</a><br/><a href="../../flash/net/URLLoader.html" target="">flash.net.URLLoader</a></div><br/><hr></div><a name="propertySummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Properties</div><div class="showHideLinks"><div id="hideInheritedProperty" class="hideInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(false,'Property');"><img class="showHideLinkImage" src="../../images/expanded.gif"> Hide Inherited Public Properties</a></div><div id="showInheritedProperty" class="showInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(true,'Property');"><img class="showHideLinkImage" src="../../images/collapsed.gif"> Show Inherited Public Properties</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableProperty"><tr><th>&nbsp;</th><th colspan="2">Property</th><th>Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#byteCode" class="signatureLink">byteCode</a> : <a href="../../flash/utils/ByteArray.html">ByteArray</a><div class="summaryTableDescription">[write-only] The raw shader bytecode for this Shader instance.</div></td><td class="summaryTableOwnerCol">Shader</td></tr><tr class="hideInheritedProperty"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><a href="../../Object.html#constructor" class="signatureLink">constructor</a> : <a href="../../Object.html">Object</a><div class="summaryTableDescription">A reference to the class object or constructor function for a given object instance.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#data" class="signatureLink">data</a> : <a href="../../flash/display/ShaderData.html">ShaderData</a><div class="summaryTableDescription">Provides access to parameters, input images, and metadata for the Shader instance.</div></td><td class="summaryTableOwnerCol">Shader</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#precisionHint" class="signatureLink">precisionHint</a> : <a href="../../String.html">String</a><div class="summaryTableDescription">The precision of math operations performed by the shader.</div></td><td class="summaryTableOwnerCol">Shader</td></tr><tr class="hideInheritedProperty"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><a href="../../Object.html#prototype" class="signatureLink">prototype</a> : <a href="../../Object.html">Object</a><div class="summaryTableDescription">[static] A reference to the prototype object of a class or function object.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr></table></div><a name="methodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Methods </div><div class="showHideLinks"><div id="hideInheritedMethod" class="hideInheritedMethod"><a class="showHideLink" href="#methodSummary" onclick="javascript:setInheritedVisible(false,'Method');"><img class="showHideLinkImage" src="../../images/expanded.gif"> Hide Inherited Public Methods</a></div><div id="showInheritedMethod" class="showInheritedMethod"><a class="showHideLink" href="#methodSummary" onclick="javascript:setInheritedVisible(true,'Method');"><img class="showHideLinkImage" src="../../images/collapsed.gif"> Show Inherited Public Methods</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableMethod"><tr><th>&nbsp;</th><th colspan="2">Method</th><th>Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#Shader()" class="signatureLink">Shader</a>(code:<a href="../../flash/utils/ByteArray.html">ByteArray</a> = null)</div><div class="summaryTableDescription">Creates a new Shader instance.</div></td><td class="summaryTableOwnerCol">Shader</td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#hasOwnProperty()" class="signatureLink">hasOwnProperty</a>(name:<a href="../../String.html">String</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Indicates whether an object has a specified property defined.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#isPrototypeOf()" class="signatureLink">isPrototypeOf</a>(theClass:<a href="../../Object.html">Object</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Indicates whether an instance of the Object class is in the prototype chain of the object specified 
  as the parameter.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#propertyIsEnumerable()" class="signatureLink">propertyIsEnumerable</a>(name:<a href="../../String.html">String</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Indicates whether the specified property exists and is enumerable.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#setPropertyIsEnumerable()" class="signatureLink">setPropertyIsEnumerable</a>(name:<a href="../../String.html">String</a>, isEnum:<a href="../../Boolean.html">Boolean</a> = true):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Sets the availability of a dynamic property for loop operations.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#toString()" class="signatureLink">toString</a>():<a href="../../String.html">String</a></div><div class="summaryTableDescription">Returns the string representation of the specified object.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#valueOf()" class="signatureLink">valueOf</a>():<a href="../../Object.html">Object</a></div><div class="summaryTableDescription">Returns the primitive value of the specified object.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr></table></div><script language="javascript" type="text/javascript"><!--
                      showHideInherited();
                      --></script><div class="MainContent"><div class="detailSectionHeader">Property Detail</div><a name="propertyDetail"></a><a name="byteCode"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">byteCode</td><td class="detailHeaderType">property</td></tr></table><div class="detailBody"><code>byteCode:<a href="../../flash/utils/ByteArray.html">ByteArray</a></code>&nbsp;&nbsp;[write-only] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p>The raw shader bytecode for this Shader instance.</p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set byteCode(value:<a href="../../flash/utils/ByteArray.html">ByteArray</a>):<a href="../../specialTypes.html#void">void</a></code><br/></div><a name="propertyDetail"></a><a name="data"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">data</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>data:<a href="../../flash/display/ShaderData.html">ShaderData</a></code>&nbsp;&nbsp;[read-write] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p>
          Provides access to parameters, input images, and metadata for the Shader instance.
   ShaderParameter objects representing parameters for the shader, ShaderInput objects 
   representing the input images for the shader, and other values representing the 
   shader's metadata are dynamically added as properties of the
          <code>data</code>
          property object when the Shader instance is created. Those properties can be 
   used to introspect the shader and to set parameter and input values.
          <p>
            For information about accessing and manipulating the dynamic properties of 
   the
            <code>data</code>
            object, see the ShaderData class description.
          </p>
          
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function get data():<a href="../../flash/display/ShaderData.html">ShaderData</a></code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set data(value:<a href="../../flash/display/ShaderData.html">ShaderData</a>):<a href="../../specialTypes.html#void">void</a></code><br/><p><span class="label">See also</span></p><div class="seeAlso"><a href="ShaderData.html" target="">flash.display.ShaderData</a><br/><a href="ShaderInput.html" target="">flash.display.ShaderInput</a><br/><a href="ShaderParameter.html" target="">flash.display.ShaderParameter</a></div></div><a name="propertyDetail"></a><a name="precisionHint"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">precisionHint</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>precisionHint:<a href="../../String.html">String</a></code>&nbsp;&nbsp;[read-write] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p>
          The precision of math operations performed by the shader.
          <p>
            The set of possible values for the
            <code>precisionHint</code>
            property is defined 
   by the constants in the ShaderPrecision class.
          </p>
          
          <p>
            The default value is
            <code>ShaderPrecision.FULL</code>
            . Setting the precision
   to
            <code>ShaderPrecision.FAST</code>
            can speed up math operations at the expense 
   of precision.
          </p>
          
          <p>
            Full precision mode (
            <code>ShaderPrecision.FULL</code>
            ) computes all math 
   operations to the full width of the IEEE 32-bit floating standard and provides 
   consistent behavior on all platforms. In this mode, some math operations such 
   as trigonometric and exponential functions can be slow.
          </p>
          
          <p>
            Fast precision mode (
            <code>ShaderPrecision.FAST</code>
            ) is designed for 
   maximum performance but does not work consistently on different platforms 
   and individual CPU configurations. In many cases, this level of precision
   is sufficient to create graphic effects without visible artifacts.
          </p>
          
          <p>The precision mode selection affects the following shader operations. 
   These operations are faster on an Intel processor 
   with the SSE instruction set:</p>
          
          <ul><li>
              <code>sin(x)</code>
            </li><li>
              <code>cos(x)</code>
            </li><li>
              <code>tan(x)</code>
            </li><li>
              <code>asin(x)</code>
            </li><li>
              <code>acos(x)</code>
            </li><li>
              <code>atan(x)</code>
            </li><li>
              <code>atan(x, y)</code>
            </li><li>
              <code>exp(x)</code>
            </li><li>
              <code>exp2(x)</code>
            </li><li>
              <code>log(x)</code>
            </li><li>
              <code>log2(x)</code>
            </li><li>
              <code>pow(x, y)</code>
            </li><li>
              <code>reciprocal(x)</code>
            </li><li>
              <code>sqrt(x)</code>
            </li></ul>
          
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function get precisionHint():<a href="../../String.html">String</a></code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set precisionHint(value:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></code><br/><p><span class="label">See also</span></p><div class="seeAlso"><a href="ShaderPrecision.html" target="">flash.display.ShaderPrecision</a></div></div><a name="constructorDetail"></a><div class="detailSectionHeader">Constructor Detail</div><a name="Shader()"></a><a name="Shader(flash.utils.ByteArray)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">Shader</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">Constructor</td></tr></table><div class="detailBody"><code>public function Shader(code:<a href="../../flash/utils/ByteArray.html">ByteArray</a> = null)</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p>Creates a new Shader instance.</p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">code</span>:<a href="../../flash/utils/ByteArray.html">ByteArray</a></code> (default = <code>null</code>)<code></code> &mdash; The raw shader bytecode to link to the Shader.</td></tr></table></div><a name="includeExamplesSummary"></a><div class="detailSectionHeader">Examples<span class="usage"><a href="../../ExampleInstruct.html"> How to use examples </a></span></div><div class="exampleHeader">ShaderExample.1.as</div><br/><div class="detailBody">
        The following example loads a shader bytecode file at run time and creates 
 a Shader instance linked to it.
        <p>
          Note that this example assumes there's a shader bytecode file named "donothing.pbj" in the same 
 directory as the output directory for the application. The Pixel Bender source code for the DoNothing shader
 is available in the
          <a href="ShaderData.html#includeExamplesSummary" target="">ShaderData class example</a>
          .
        </p>
        
        <div class="listing"><pre>package {
    import flash.display.Shader;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.net.URLLoader;
    import flash.net.URLLoaderDataFormat;
    import flash.net.URLRequest;

    public class LoadedShaderExample extends Sprite {
        
        private var loader:URLLoader;
        
        public function LoadedShaderExample() {
            loader = new URLLoader();
            loader.dataFormat = URLLoaderDataFormat.BINARY;
            loader.addEventListener(Event.COMPLETE, loadCompleteHandler);
            loader.load(new URLRequest("donothing.pbj"));
        }
        
        private function loadCompleteHandler(event:Event):void {
            var shader:Shader = new Shader();
            shader.byteCode = loader.data;
            
            // do something with the Shader instance
        }
    }
}</pre></div>
      </div><div class="exampleHeader">ShaderExample.2.as</div><br/><div class="detailBody">
        The following example embeds a shader bytecode file by compiling it 
 into the SWF, and creates a Shader instance linked to it.
        <p>
          Note that this example assumes there's a shader bytecode file named "donothing.pbj" in the same 
 directory as the source code for the application, and that the Flex SDK is used to compile the SWF.
 The Pixel Bender source code for the DoNothing shader
 is available in the
          <a href="ShaderData.html#includeExamplesSummary" target="">ShaderData class example</a>
          .
        </p>
        
        <div class="listing"><pre>package {
    import flash.display.Shader;
    import flash.display.Sprite;

    public class EmbeddedShaderExample extends Sprite {
        
        [Embed(source="donothing.pbj", mimeType="application/octet-stream")]
        private static var DoNothingShader:Class;
        
        public function EmbeddedShaderExample() {
            var shader:Shader = new Shader();
            shader.byteCode = new DoNothingShader();
            
            // do something with the Shader instance
        }
    }
}</pre></div>
      </div><br/><br/><hr><br/><p></p><center class="copyright"> &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:08 PM -07:00  </center><div style="display:none">Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader Shader </div><div style="display:none">flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader flash.display.Shader </div></div></body></html><!-- &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:08 PM -07:00  -->
