惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
博客园_首页
W
WeLiveSecurity
S
Secure Thoughts
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Forbes - Security
Forbes - Security
T
Tor Project blog
I
Intezer
B
Blog
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
AI
AI
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
Cloudbric
Cloudbric
L
Lohrmann on Cybersecurity
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
PCI Perspectives
PCI Perspectives
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
Vercel News
Vercel News
A
Arctic Wolf
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
H
Heimdal Security Blog
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed

博客园 - Stym--闫生

最简单的silverlight的DataGrid行双击事件添加 == 在cmd命令下imp oracle dmp文件 vb.net连接oracle和php连接oracle - Stym--闫生 - 博客园 数据库名,全局数据库名,SID 创建同义词和赋权限 linux下创建硬连接 flex 的as文件引用,包引用 - Stym--闫生 - 博客园 flex分页控件 - Stym--闫生 - 博客园 数据处理:等待条 把数组转化成一个xml字符串--php - Stym--闫生 - 博客园 php使用ajax技术 javascript拖住布局demo flex + Amfphp + mysql +IIS 5.1t 用sql查看表结构 c#生成验证图片 C#使用sql语句读取excel文件数据 svn切换用户,报“501 Method Not Implemented”错误 div滤镜结合ajax,实现登录
flex TabNavigator 切换之前给出提示 - Stym--闫生
Stym--闫生 · 2009-06-10 · via 博客园 - Stym--闫生

下面代码是我做的例子:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
  creationComplete="init()">
<mx:Script>
 <![CDATA[
  import mx.controls.TabBar;
  import mx.controls.Button;
  import mx.controls.Alert;
  import mx.events.CloseEvent;
  import mx.managers.PopUpManager;
  
  private var iTabIndex:int;
  private var iToTabIndex:int;
  private var _updateAlert:Alert;
  
  public function init():void
  {
   iTabIndex = 0;
   iToTabIndex = 0;
   var btn:Button;
   for(var i:int=0;i<tab.getChildren().length;i++)
   {
    btn = tab.getTabAt(i);
    btn.addEventListener(MouseEvent.MOUSE_DOWN,tabClickHandler,false,999999999);
   }
  }
  private function tabClickHandler(event:MouseEvent):void
     {
         iToTabIndex = event.currentTarget.parent.getChildIndex(event.currentTarget);
         //终止事件
         event.stopImmediatePropagation();
         //给出提示message
         if(iToTabIndex !=iTabIndex)
         {
          showGoBack();
         }
     }
     // alert
  public function showGoBack():void
  {
   Alert.buttonWidth = 100;
   Alert.yesLabel    = "yes";
   Alert.noLabel     = "no";
   var updateLabel:String =  "要切换tab吗?";

   this._updateAlert = Alert.show(updateLabel, "", Alert.YES | Alert.NO);
   this._updateAlert.addEventListener(CloseEvent.CLOSE,closeShowGoBack); 
  }
  private function closeShowGoBack(e:CloseEvent):void
  {
   switch (e.detail)
   {
    case Alert.YES:            
     iTabIndex    = iToTabIndex;
     tab.selectedIndex   = iTabIndex;
     break;
    case Alert.NO:
     PopUpManager.removePopUp(this._updateAlert);
     break;
   }   
  }
  
  public function change(e:Event):void
  {
   Alert.show("CHANGE " + tab.selectedIndex.toString() + "!!!");
   
  }
  //注释;creationPolicy="all",把tab的所有child全部初始化
  
  
 ]]>
</mx:Script>
 <mx:TabNavigator creationPolicy="all" id="tab" x="21" y="28" change="change(event)" width="200" height="200" >
  <mx:Canvas id="a" label="aa" width="100%" height="100%">
   <mx:TextInput x="10" y="10" width="178"/>
  </mx:Canvas>
  <mx:Canvas id="b" label="bb" width="100%" height="100%">
   <mx:Button id="abtn" x="10" y="50" label="Button"/>
  </mx:Canvas>
 </mx:TabNavigator>
</mx:Application>

注意:本代码是本人发了多半天的时间,查文档,解决的。如果有人引用,请注明地址,谢谢!