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
相关文档:
原文地址:http://www.javaeye.com/topic/392836
关于Flex
Adobe Flex是一套创建富客户端应用(RIAs)的框架.Flex生成的swf文件可以直接运行在Flash Player之中。相比较基于时间轴的Flash开发,Flex框架更适合那些用传统方式开发应用程序的开发人员。Flex应用可以使用Flex builder来开发。这套IDE是基于Eclipse平台开发的。 ......
对arcgis server for flex学习了一段时间了,需要对自己的学习过程总结一下:
准备工作:1一般对arcgis server软件的安装需要确保自己的电脑上安装了IIS服务器;
2,确保一些arcgis server本身会占用80端口,如果你的电脑上已经装了迅雷软件的话,需要修改迅雷所占用的80端口。3最后你的电脑上装有arcgis desktop,一遍数 ......
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="InitApp()">
<mx:Script>
<![CDATA[
......
Flex是Macromedia发布的presentation server(展现服务),它是java web
container或者.net
server的一个应用,根据.mxml文件(纯粹的xml描述文件和actionscript)产生相应得.swf文件,传送到客户端,由客户端的
flash player或者shockwave player解释执行,给用户以丰富的客户体验。
大名鼎鼎的Macromedia Flash是强大 ......