用于 Adobe® Flash® Platform 的 ActionScript® 3.0 参考
主页  |  隐藏包列表和类列表 |   |   |  新增内容  |  索引  |  附录  |  为什么显示为英语?
过滤条件: AIR 30.0 和更早版本, Flash Player 30.0 和更早版本, Flash Lite 4
Flex 4.6 和更早版本, Flash Pro CS6 和更早版本
隐藏过滤条件
mx.graphics 

Stroke  - AS3 Flex

mx.graphics
public class Stroke
继承Stroke Inheritance SolidColorStroke Inheritance EventDispatcher Inheritance Object
自以下版本起不推荐使用: 4.0: 请使用 SolidColorStroke

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: Flash Player 9, AIR 1.1

Stroke 类定义线条的属性。您可以使用 MXML 定义 Stroke 对象,但是必须将该 Stroke 附加到其它对象上,才能在应用程序中显示出来。以下示例首先定义了两个 Stroke 对象,然后将其应用于 LineChart 控件的 horizontalAxisRenderer 中:
  ...
  <mx:Stroke id="ticks" color="0xFF0000" weight="1"/>
  <mx:Stroke id="mticks" color="0x0000FF" weight="1"/>
  
  <mx:LineChart id="mychart" dataProvider="{ndxa}">
      <mx:horizontalAxisRenderer>
          <mx:AxisRenderer placement="bottom" canDropLabels="true">
              <mx:tickStroke>{ticks}</mx:tickStroke>
              <mx:minorTickStroke>{mticks}</mx:minorTickStroke>
          </mx:AxisRenderer>
      </mx:horizontalAxisRenderer>
  </LineChart>
  ...
  

MXML 语法expanded隐藏 MXML 语法

The <mx:Stroke> tag inherits all the tag attributes of its superclass, and adds the following tag attributes:

  <mx:Stroke
    Properties
    alpha="1.0"
    caps="null|none|round|square"
    color="0x000000"
    joints="null|bevel|miter|round"
    miterLimit="1"
    pixelHinting="false|true"
    scaleMode="normal|none|horizontal|vertical"
    weight="1 (in most cases)"
  />
  

相关 API 元素



公共属性
 属性由以下参数定义
 Inheritedalpha : Number
线条的透明度。
SolidColorStroke
 Inheritedcaps : String
指定线条结尾处的端点的类型。
SolidColorStroke
 Inheritedcolor : uint
线条颜色。
SolidColorStroke
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
 Inheritedjoints : String
指定拐角处使用的连接外观的类型。
SolidColorStroke
 InheritedmiterLimit : Number
表示将在哪个限制位置切断尖角。
SolidColorStroke
 InheritedpixelHinting : Boolean
指定是否提示笔触采用完整像素。
SolidColorStroke
 InheritedscaleMode : String
LineScaleMode 类中的一个值,指定要使用的缩放模式。
SolidColorStroke
 Inheritedweight : Number
线条粗细(以像素为单位)。
SolidColorStroke
公共方法
 方法由以下参数定义
  
Stroke(color:uint = 0x000000, weight:Number = 0, alpha:Number = 1.0, pixelHinting:Boolean = false, scaleMode:String = "normal", caps:String = null, joints:String = null, miterLimit:Number = 1)
构造函数。
Stroke
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
使用 EventDispatcher 对象注册事件侦听器对象,以使侦听器能够接收事件通知。
EventDispatcher
 Inherited
apply(graphics:Graphics, targetBounds:Rectangle, targetOrigin:Point):void
对指定的 Graphics 对象应用属性。
SolidColorStroke
 Inherited
生成表示此笔触的 GraphicsStroke 对象。
SolidColorStroke
 Inherited
将事件调度到事件流中。
EventDispatcher
 Inherited
检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。
EventDispatcher
 Inherited
表示对象是否已经定义了指定的属性。
Object
 Inherited
表示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
表示指定的属性是否存在、是否可枚举。
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
从 EventDispatcher 对象中删除侦听器。
EventDispatcher
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。
Object
 Inherited
返回指定对象的字符串表示形式。
Object
 Inherited
返回指定对象的原始值。
Object
 Inherited
检查是否用此 EventDispatcher 对象或其任何祖代为指定事件类型注册了事件侦听器。
EventDispatcher
事件
 事件 摘要 由以下参数定义
 Inherited[广播事件] Flash Player 或 AIR 应用程序获得操作系统焦点并变为活动状态时将调度此事件。EventDispatcher
 Inherited[广播事件] Flash Player 或 AIR 应用程序失去操作系统焦点并变为非活动状态时将调度此事件。EventDispatcher
构造函数详细信息

Stroke

()构造函数
public function Stroke(color:uint = 0x000000, weight:Number = 0, alpha:Number = 1.0, pixelHinting:Boolean = false, scaleMode:String = "normal", caps:String = null, joints:String = null, miterLimit:Number = 1)

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: Flash Player 9, AIR 1.1

构造函数。

参数
color:uint (default = 0x000000) — 指定线条颜色。默认值为 0x000000(黑色)。
 
weight:Number (default = 0) — 指定线条的粗细(以像素为单位)。默认值为 0。
 
alpha:Number (default = 1.0) — 指定 alpha 值,介于 0.0 到 1.0 之间。默认值为 1.0(不透明)。
 
pixelHinting:Boolean (default = false) — 指定是否提示笔触采用完整像素。此值同时影响曲线锚点的位置以及线条笔触大小本身。默认值为 false。
 
scaleMode:String (default = "normal") — LineScaleMode 类中的一个值,指定要使用的缩放模式。有效值为 LineScaleMode.HORIZONTALLineScaleMode.NONELineScaleMode.NORMALLineScaleMode.VERTICAL。此参数是可选的,默认值为 LineScaleMode.NORMAL
 
caps:String (default = null) — 指定线条结尾处的端点的类型。有效值为 "round""square""none"。默认值为 null
 
joints:String (default = null) — 指定拐角处使用的连接外观的类型。有效值为 "round""miter""bevel"。默认值为 null
 
miterLimit:Number (default = 1) — 表示将在哪个限制位置切断尖角。有效值范围是 1 到 255。默认值为 1。




[ X ]为什么显示为英语?
《ActionScript 3.0 参考》中的内容以英语显示

《ActionScript 3.0 参考》中的部分内容未翻译成所有语言。当某个语言元素未翻译时,将显示为英语。例如,ga.controls.HelpBox 类未翻译成任何语言。因此在简体中文版的参考中,ga.controls.HelpBox 类显示为英语。