<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>FoxLing - 前端开发 &#187; ClassReference</title>
	<atom:link href="http://foxling.org/tag/classreference/feed/" rel="self" type="application/rss+xml" />
	<link>http://foxling.org</link>
	<description>不积跬步 无以至千里</description>
	<lastBuildDate>Sat, 19 Nov 2011 16:29:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>在Flex中继承ProgrammaticSkin类自定义皮肤</title>
		<link>http://foxling.org/as-flex-air/flex-custom-skins/</link>
		<comments>http://foxling.org/as-flex-air/flex-custom-skins/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 15:06:57 +0000</pubDate>
		<dc:creator>FoxLing</dc:creator>
				<category><![CDATA[AS/Flex/AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[ClassReference]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[ProgrammaticSkin]]></category>

		<guid isPermaLink="false">http://foxling.cn/?p=403</guid>
		<description><![CDATA[通过自定义类的方式创建皮肤，控制性更强，占用的内存更少。 ProgrammaticSkin类是外观元素的基类，它们通过编程方式来绘制自身。 关于ProgrammaticSkin类的更多信息，猛击这里： http://www.airia.cn/ActionScript3API/livedocs/mx/skins/ProgrammaticSkin.html 自定义类 package skins { import flash.display.GradientType; import flash.display.Graphics; import mx.skins.ProgrammaticSkin; public class CustomBG extends ProgrammaticSkin { public function CustomBG() { super(); } override protected function updateDisplayList(w:Number, h:Number):void { super.updateDisplayList(w, h); var g:Graphics = graphics; var fillColors:Array = [0x191919,0x262626,0x191919]; var fillAlphas:Array = [1.0,1.0,1.0]; var fillRatios:Array = [0,127,255] g.clear(); drawRoundRect(0, 0, w, h, [...]]]></description>
			<content:encoded><![CDATA[<p>通过自定义类的方式创建皮肤，控制性更强，占用的内存更少。<br />
ProgrammaticSkin类是外观元素的基类，它们通过编程方式来绘制自身。<br />
关于ProgrammaticSkin类的更多信息，猛击这里：<br />
<a href="http://www.airia.cn/ActionScript3API/livedocs/mx/skins/ProgrammaticSkin.html">http://www.airia.cn/ActionScript3API/livedocs/mx/skins/ProgrammaticSkin.html</a></p>
<h3>自定义类</h3>
<pre>
package skins
{
    import flash.display.GradientType;
    import flash.display.Graphics;

    import mx.skins.ProgrammaticSkin;

    public class CustomBG extends ProgrammaticSkin
    {

        public function CustomBG()
        {
            super();
        }

        override protected function updateDisplayList(w:Number, h:Number):void
        {
            super.updateDisplayList(w, h);

            var g:Graphics = graphics;
            var fillColors:Array = [0x191919,0x262626,0x191919];
            var fillAlphas:Array = [1.0,1.0,1.0];
            var fillRatios:Array = [0,127,255]

            g.clear();

            drawRoundRect(0, 0, w, h, 0, fillColors, fillAlphas,
                          horizontalGradientMatrix(0, 0, w, h), GradientType.LINEAR,fillRatios );
        }

        override public function get measuredWidth():Number
        {
            return 8;
        }

        override public function get measuredHeight():Number
        {
            return 8;
        }
    }

}
</pre>
<h3>在CSS中使用ClassReference调用自定义类</h3>
<p>.customBg<br />
{<br />
	backgroundSize: “100%”;<br />
	backgroundImage: ClassReference(“skins.CustomBG”);<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://foxling.org/as-flex-air/flex-custom-skins/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

