Flex的TabNavigator中tab触发的事件
Getting Around Bug in Adobe Flex: TabControl Inline Event Handling for TabIndexChange Doesn't Work
I ran into this because I wanted to do something funky. I wanted my Flex app window to change PageStates (and size) whenever the TabIndex changed. Whether doing this kind of thing is wise in a user interface is yet to be seen -- I did it and it even strikes ME as a bit off the wall -- but it did solve the immediate issue. The immediate issue was that some of my tabs required a lot of space and some did not. This left a lot of ugly whitespace.
So, I figured, Flex (Actually Flash under the covers) must have an event handler for changing tabs. And I was rewarded very quickly: There is a "TabIndexChange" inline event handler. For the uninitiated, such a thing looks something like this:
<mx:TabNavigator id="tabnavigator1" tabIndexChange="myHandlerFunction()">
With most other events, this works just fine: When the event fires, the handler is called. But it simply doesn't work in this case. The handler function is never called.
There's a couple of ways to handle this. One way is to use a TabBar control rather than a TabControl. The TabBar basically gives you the look and feel of a tabset but more control over what is tabbed. And the tabIndexChange even calls the handler as one might expect.
I didn't want to do it that way, however. For one thing, I'm stubborn. For another, I already had all my controls arranged on the TabNavigator and I didn't want to rip it half to pieces to get functionality that I should already be getting.
Fortunately, there's a solution: Explicitly declare an event listener. That looks something like this:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="InitApp()">
<mx:Script>
<![CDATA[
import mx.events.IndexChangedE
相关文档:
前言
Undo,Redo是编辑环境里常见的并且非常重要的功能,下面介绍【命令模式】在Flex/AS3下的实现。
ICommand接口
定义ICommand接口,其中Execute和UnExecute是相反的2个操作,Title属性用于命令显示,例如显示在操作历史列表里。
package cwn.wb.ui.core.command
{
import cwn.core.IDi ......
原文地址:http://www.javaeye.com/topic/392836
关于Flex
Adobe Flex是一套创建富客户端应用(RIAs)的框架.Flex生成的swf文件可以直接运行在Flash Player之中。相比较基于时间轴的Flash开发,Flex框架更适合那些用传统方式开发应用程序的开发人员。Flex应用可以使用Flex builder来开发。这套IDE是基于Eclipse平台开发的。 ......
1.拷贝内容到剪贴板:
System
.
setClipboard
(
strContent)
;
2.克隆一个 ArrayCollection :
var
bar:
ArrayCollection = new
ArrayCollection(
)
;
for
each
(
var
i:
Object
in
ac )
{
bar.
addItem(
i )
;
}
var
bar:
ListCollectionVie ......
在flex中也经常会用到截图功能,并且将截图的图片保存至本地。一想到图片那么我们就自然想到他的存在形式 bitmap byteArray.所以自然就会联系到bitmap类上去。
下面让我们一起来看看都有哪些方法吧。
方法一:按我们自然的思路实现:
在application中有两个容器:
<mx:Canvas id="virtour_cav" top="0" bottom="0" l ......
1月17日
Flex开源框架汇总
Cairngorm (download)
Cairngorm是一个最早最为成熟的FLEX框架,现在已归为ADOBE门下.
PureMVC (download)
它其实是一个ActionScript 3框架,不像Cairngorm,它并不是针对FLASH,FLEX或者其它ADOBE AS3.0类。它是一个用于开发基于FLASH的AS 3.0的任何程序.
Model-Glue: Flex (download)
Model- ......