Flex中image控件如何添加边框
页面代码:
<?xml version="1.0"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:marsImage="mars.display.*"
backgroundColor="#000000"
layout="absolute">
<marsImage:BorderImage
borderAlpha="{aBar.value}"
borderWidth="{wBar.value}"
borderColor="{colorTool.selectedColor}"
source="@Embed('../img/panda.jpg')"
width="258" height="229" x="180" y="62"/>
<mx:Label x="180" y="327" text="请选择边框颜色" color="#FDFDFD" fontSize="16"/>
<mx:Label x="180" y="391" text="请选择边框宽度" color="#FDFDFD" fontSize="16"/>
<mx:Label x="377" y="391" text="请选择边框透明度" color="#FDFDFD" fontSize="16"/>
<mx:ColorPicker x="305" y="327" color="#FDFDFD" id="colorTool"/>
<mx:VSlider x="525" y="255" minimum="0" maximum="1" id="aBar" />
<mx:HSlider x="180" y="423" minimum="0" maximum="6" id="wBar"/>
</mx:Application>
控件代码如下:
package mars.display
{
import mx.controls.Image;
//边框颜色
[Style(name="borderColor", type="uint", format="Color", inherit="no")]
//边框宽度
[Style(name="borderWidth", type="Number", format="Length", inherit="no")]
//边框透明度
[Style(name="borderAlpha", type="Number", format="Length", inherit="no")]
public class BorderImage extends Image
{
public function BorderImage()
{
super();
}
override protected function updateDisplayList(w:Number, h:Number):void{
super.updateDisplayList(w,h);
graphics.clear();
graphics.lineStyle(getStyle('borderWidth'),getStyle('borderColor'),getStyle('borderAlpha'),false);
var x:Number=-(getStyle('borderWidth
相关文档:
MXML:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" fontSize="20" initialize="doinit()" mouseOver="getMouseTarget(event)">
<mx:ArrayCollection id="dgArray">
<mx:Object pid="1" name="秦始皇" time="秦" />
&nbs ......
今天在做项目的时候遇到了一个问题,访问xml文件就是成功不了。看了看以前写过的代码都可以,而这个项目中为什么就不行了呢?仔细查看了目录,是百思不得其解啊。
错误信息:*** Security Sandbox Violation ***
Connection to file:///C|/loading.swf halted - not permitted from xxxx/data.xml。这个xml是在工程里面sr ......
tofino http://www.ensemble.com/products/tofino.html
Ensemble Tofino for Visual Studio is a plugin that enables .NET
developers to create Flex front ends for their applications in the same
IDE that they normally use. Instead of using a separate text or XML
editor and manually invoking the c ......
常用的Flex代码总结
1.刷新浏览器
navigateToURL(new URLRequest("javascript:location.reload();"),"_self")
2.关闭浏览器
navigateToURL(new URLRequest("javascript:window.close()"),"_self");
3.打开一个新浏览器窗口
navigateToURL(new URLRequest('ht ......