| 패키지 | mx.graphics | 
| 클래스 | public class LinearGradient | 
| 상속 | LinearGradient    GradientBase   EventDispatcher   Object | 
| 구현 | IFill | 
| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 3 | 
| 런타임 버전: | Flash Player 9, AIR 1.1 | 
entries Array
  to define the colors that make up the gradient fill.
  
  In MXML, you define a LinearGradient by adding a series of GradientEntry objects, as the following example shows:
<mx:fill> <mx:LinearGradient> <mx:entries> <mx:GradientEntry color="0xC5C551" ratio="0.00" alpha="0.5"/> <mx:GradientEntry color="0xFEFE24" ratio="0.33" alpha="0.5"/> <mx:GradientEntry color="0xECEC21" ratio="0.66" alpha="0.5"/> </mx:entries> </mx:LinearGradient> </mx:fill>
You can also define a LinearGradient as a fill for any graphic element in ActionScript, as the following example shows:
  
  <?xml version="1.0"?>
  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()">
  	<mx:Script>
  	import flash.display.Graphics;
  	import flash.geom.Rectangle;
  	import mx.graphics.GradientEntry;
  	import mx.graphics.LinearGradient;
  
  	private function init():void
      {
  		var w:Number = 200;
  		var h:Number = 200;
  
  		var s:Sprite = new Sprite();
  		// Add the new Sprite to the display list.
  		rawChildren.addChild(s);	
  
  		var g:Graphics = s.graphics;
  		g.lineStyle(1, 0x33CCFF, 1.0);
  
  		var fill:LinearGradient = new LinearGradient();
  		
  		var g1:GradientEntry = new GradientEntry(0xFFCC66, 0.00, 0.5);
  		var g2:GradientEntry = new GradientEntry(0x000000, 0.33, 0.5);
  		var g3:GradientEntry = new GradientEntry(0x99FF33, 0.66, 0.5);
    		
   		fill.entries = [ g1, g2, g3 ];
  		fill.angle = 240;
  
   		// Draw a box and fill it with the LinearGradient.
  		g.moveTo(0, 0);
  		fill.begin(g, new Rectangle(0, 0, w, h));
  		g.lineTo(w, 0);
  		g.lineTo(w, h);
  		g.lineTo(0, h);
  		g.lineTo(0, 0);		
  		fill.end(g);
  	}
  	</mx:Script>
  </mx:Application>
    
                 
  
            MXML 구문
MXML 구문 숨기기The <mx:LinearGradient> tag
  inherits all the tag attributes of its superclass,
  and adds the following tag attributes:
  <mx:LinearGradient
    Properties
    angle="0"
  />
  
  
  기본 MXML 속성entries
기타 예제
관련 API 요소
공용 속성
| 속성 | 정의 주체 | ||
|---|---|---|---|
![]()  | angle : Number 사용되지 않음: 사용 rotation 
      By default, the LinearGradientStroke defines a transition
      from left to right across the control. | GradientBase | |
![]()  | constructor : Object 
	 지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다.  | Object | |
![]()  | entries : Array 
      An Array of GradientEntry objects
      defining the fill patterns for the gradient fill.  | GradientBase | |
![]()  | interpolationMethod : String 
      A value from the InterpolationMethod class
      that specifies which interpolation method to use.  | GradientBase | |
![]()  | matrix : Matrix 
      An array of values used for matrix transformation.  | GradientBase | |
![]()  | rotation : Number 
      By default, the LinearGradientStroke defines a transition
      from left to right across the control.  | GradientBase | |
| scaleX : Number 
      The horizontal scale of the gradient transform, which defines the width of the (unrotated) gradient
      
        | LinearGradient | ||
![]()  | spreadMethod : String 
      A value from the SpreadMethod class
      that specifies which spread method to use.  | GradientBase | |
![]()  | x : Number 
      The distance by which to translate each point along the x axis.  | GradientBase | |
![]()  | y : Number 
      The distance by which to translate each point along the y axis.  | GradientBase | |
보호 속성
공용 메서드 
| 메서드 | 정의 주체 | ||
|---|---|---|---|
	  Constructor.  | LinearGradient | ||
![]()  | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void 
	리스너에서 이벤트 알림을 받을 수 있도록 EventDispatcher 객체에 이벤트 리스너 객체를 등록합니다.  | EventDispatcher | |
	  
	  Starts the fill.  | LinearGradient | ||
![]()  | 
	이벤트를 이벤트 흐름으로 전달합니다.  | EventDispatcher | |
	  
	  Ends the fill.  | LinearGradient | ||
![]()  | 
	EventDispatcher 객체에 특정 유형의 이벤트에 대한 리스너가 등록되어 있는지 여부를 확인합니다.  | EventDispatcher | |
![]()  | 
	 지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다.  | Object | |
![]()  | 
	 Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다.  | Object | |
![]()  | 
	 지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다.  | Object | |
![]()  | 
	EventDispatcher 객체에서 리스너를 제거합니다.  | EventDispatcher | |
![]()  | 
     루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다.  | Object | |
![]()  | 
	 로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다.  | Object | |
![]()  | 
	 지정된 객체의 문자열 표현을 반환합니다.  | Object | |
![]()  | 
	 지정된 객체의 프리미티브 값을 반환합니다.  | Object | |
![]()  | 
	이 EventDispatcher 객체 또는 조상 객체에 지정한 이벤트 유형에 대한 이벤트 리스너가 등록되어 있는지 여부를 확인합니다.  | EventDispatcher | |
공용 상수
속성 세부 정보
scaleX | 속성 | 
scaleX:Number| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 3 | 
| 런타임 버전: | Flash Player 9, AIR 1.1 | 
The horizontal scale of the gradient transform, which defines the width of the (unrotated) gradient
이 속성은 데이터 바인딩에 대한 소스로 사용할 수 있습니다. 이 속성을 수정하면  propertyChange  이벤트를 전달합니다.
구현
    public function get scaleX():Number    public function set scaleX(value:Number):void생성자 세부 정보
LinearGradient | () | 생성자 | 
public function LinearGradient()| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 3 | 
| 런타임 버전: | Flash Player 9, AIR 1.1 | 
Constructor.
메서드 세부 정보
begin | () | 메서드 | 
 public function begin(target:Graphics, targetBounds:Rectangle, targetOrigin:Point):void| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 3 | 
| 런타임 버전: | Flash Player 9, AIR 1.1 | 
Starts the fill.
매개 변수
target:Graphics — The target Graphics object that is being filled.
	 
	   | |
targetBounds:Rectangle — The Rectangle object that defines the size of the fill
	  inside the target.
	  If the dimensions of the Rectangle are larger than the dimensions
	  of the target, the fill is clipped.
	  If the dimensions of the Rectangle are smaller than the dimensions
	  of the target, the fill expands to fill the entire
	  target.
     
       | |
targetOrigin:Point — The Point that defines the origin (0,0) of the shape in the 
      coordinate system of target. 
	  
	   | 
end | () | 메서드 | 
Tue Jun 12 2018, 03:17 PM Z
 
MXML 구문 표시