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
相关文档:
对flex datagrid scrollbar位置设置需要一些特殊处理,见如下截图:
关键点在于DataGrid拥有protected的 horizontalScrollBar 和 verticalScrollBar 属性,对其设置即可实现如上截图的效果。代码如下: package com.util.component
{
import mx.controls.DataGrid;
import mx.events.DataGridEvent;
import mx ......
原文地址:
http://www.gridlinked.info/how-to-encrypt-flex-rsls/
这里截取并尝试翻译了一段FLEX程序初始化及此解密过程.
应用启动过程:
1. 首先, 为第1帧加载足够的数据.
2. Flash Player通过创建SystemManager实例执行加载数据.
3. SystemManager命令Flash Player停止在第一帧.
4. SystemManager创建Preloader,
......
对arcgis server for flex学习了一段时间了,需要对自己的学习过程总结一下:
准备工作:1一般对arcgis server软件的安装需要确保自己的电脑上安装了IIS服务器;
2,确保一些arcgis server本身会占用80端口,如果你的电脑上已经装了迅雷软件的话,需要修改迅雷所占用的80端口。3最后你的电脑上装有arcgis desktop,一遍数 ......
Flex的事件其实很容易明白,象JAVA语言一样,给某个控件注册一个listener,然后事件发生的时候触发相应的函数,这点我相信大多数人都能够明白。今天我想要说的不是这个,而是更加细节的一些东西。
1.事件的传播过程。
Flex事件有下面三个阶段,当事件发生时依次为:
1.capturing(捕捉)
2.targeting(目标)
3.bubbli ......
在flex中也经常会用到截图功能,并且将截图的图片保存至本地。一想到图片那么我们就自然想到他的存在形式 bitmap byteArray.所以自然就会联系到bitmap类上去。
下面让我们一起来看看都有哪些方法吧。
方法一:按我们自然的思路实现:
在application中有两个容器:
<mx:Canvas id="virtour_cav" top="0" bottom="0" l ......