• Flex学习第一天(两个数相加)


    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    <fx:Style source="test.css"
    />
    <fx:Declarations>

    <!-- 将非可视元素(例如服务、值对象)放在此处 -->
    </fx:Declarations>
    <fx:Script>
    <![CDATA[

    protected function buttion_clickHandler(event:MouseEvent):void
    {
    var mm=parseInt(txtName.text);
    var dd=parseInt(txtPswd.text);
    var sumInts:int=addInts(dd,mm);
    lblResult.text="结果等于"+sumInts;
    }
    private function addInts( value1:int,value2:int):int
    {
    var sum:int=value1+value2;
    return sum;
    }
    ]]>
    </fx:Script>
    <s:Panel x="698" y="241" width="522" height="278" id="pLgion" title="地图管理系统" color="#020202" fontStyle="italic" textAlign="center" fontFamily="中易宋体" enabled="true">
    <s:Label x="158" y="58" text="用户名:" id="lbluserName" textAlign="center"/>
    <s:Label x="160" y="110" text="密 码:" id="lblPsd" textAlign="center"/>
    <s:TextInput x="214" y="51" textAlign="left" width="140" id="txtName"/>
    <s:TextInput x="216" y="104" textAlign="left" width="138" id="txtPswd"/>
    <s:Button x="186" y="157" label="登陆" click="buttion_clickHandler(event)"/>
    <s:Button x="281" y="157" label="注册"/>
    <s:Label x="214" y="203" id="lblResult"/>
    </s:Panel>
    </s:Application>

    注释:这里面要用到的一个知识点就是类型转换(文本类型转换成整型)parseInt(txtName.text);和触发事件click="buttion_clickHandler(event)"

  • 相关阅读:
    由“Jasperrpeorts 4.1.2升级到5.1.2对flex项目的解析”到AS3 带命名空间的XML的操作
    c++里的类型转化
    A股市场暴跌背后的三大元凶?
    jQuery简单过滤选择器
    Handling of asynchronous events---reference
    NMAP
    JVM Run-Time Data Areas--reference
    Getting over the dangers of rm command in Linux---reference
    45 Useful Oracle Queries--ref
    手动修改user-agent
  • 原文地址:https://www.cnblogs.com/BoYu045535/p/4905122.html
Copyright © 2020-2023  润新知