Flex 计算String的宽度
应为设计要求, 我需要计算String的宽度,
搜索了下网上的文章, 看到有用measureText(string)的,
可是用了下发现, 这个function得到的string大小, 不会根据字体的大小, 粗黑的变化,
始终返回同一个值, 也许是我的用法不对, 最后我没有这个方法,
改用了另外一个方法:
private function getTextWidth():int
{
var lb:Label = new Label();
lb.regenerateStyleCache( false );
var textMetrics:TextLineMetrics = lb.measureText( label );
var textWidth:int = textMetrics.width;
return textWidth;
}
如果不行, 确定 maxDisplayedLines="1"
相关文档:
http://blog.csdn.net/xuyesheng/archive/2009/08/20/4467515.aspx
Flex
Builder3
注册码:
1377-4167-5844-4698-0048-5821—
最
好用的一个
1377-4168-2018-0771-2432-1495
1377-4760-3354-0772-2773-8996
1377-4165-2080-7265-7813-8901
1377-4964-5021-8182-2399-8235
LiveCycle Data Services
注册码 ......
flex 页面跳转
方法一:使用navigateToURL
var url:String = "http://localhost/flex/test.jsp";
var request:URLRequest = new URLRequest(url);
navigateToURL(request,"_self");
方法二:引用flash中的 import flash.external.ExternalInterface 这个接口
他能提供像js中window.location.href方法一样方便
Extern ......
flex 控件属性
2009-11-12 16:06
使用<mx:Style>标签在MXML文件中创建本地的样式定义。这个标签包含了符合CSS2.0语法的样式表定
义。这些定义会应用到当前文档以及当前文档的子文档。
<mx:style>
.solidBorder{//类选择样式
borderStyle:solid;
}
button{//组件定义样式
borderStyle:solid;
}
.. ......
/*Copyright (c) 2006 Adobe Systems Incorporated
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, m ......
首先,申明本文是转载
http://blog.csdn.net/ivanmarkliu/archive/2009/07/08/4327570.aspx
,大家可以访问该链接,也可以直接阅读本文后续部分以了解
flex
事件。接下来简单谈下为何要转载此文及本人对此文的一些补充。
可以这样说 ......