Flex XML configuration file to read summary

2010-09-08  来源:本站原创  分类:Flash  人气:165 

1. Using the Model tag form

Outset Model tags

<mx:Model source="config.xml"/>

xml of the form:

Xml Code

1. <config>
2.
3. <username> Flex </ username>
4.
5. <password> 123456 </ password>
6.
7. </ Config>

<config>

<username> Flex </ username>

<password> 123456 </ password>

</ Config>

Flex code

1. <mx:Label Text="{model.username}"/>

<mx:Label text="{model.username}"/>

So, only in the initialization event can be called directly, for example: model.username, model.password can get to the desired value.

2. Using URLLoader
Flex code

1. <Mx: Application xmlns: mx = "http://www.adobe.com/2006/mxml"
2. Layout = "absolute"
3. Initialize = "init ()">
4. <mx:Script>
5. <! [CDATA [
6. Import mx.controls.Alert;
7.
8. Private function init (): void
9. (
10. Var urlrequest: URLRequest = new URLRequest ("test.xml");
11. Var loader: URLLoader = new URLLoader ();
12. Loader.load (urlrequest);
13. Loader.addEventListener (Event.COMPLETE, completehandler);
14.)
15.
16. Private function completehandler (event: Event): void
17. (
18. Var xml: XML = new XML (event.target.data);
19. Alert.show (xml.toString ());
20.)
21.]]>
22. </ Mx: Script>
23. </ Mx: Application>

相关文章
  • Flex XML configuration file to read summary 2010-09-08

    1. Using the Model tag form Outset Model tags <mx:Model source="config.xml"/> xml of the form: Xml Code 1. <config> 2. 3. <username> Flex </ username> 4. 5. <password> 123456 </ password> 6. 7. </ Config>

  • Hibernate.cfg.xml configuration file (including the primary key generation strategy Introduction) 2009-02-27

    Hibernate.cfg.xml configuration file: <? xml version = "1.0" encoding = "utf-8"?> <! DOCTYPE hibernate-configuration PUBLIC "- / / Hibernate / Hibernate Configuration DTD / / EN" "hibernate-configuration-2.0.dtd

  • ActiveMQ under the amended Elcipse the XML configuration file cvc-complex-type.2.4 error. 2010-04-28

    The release of ActiveMQ to use Spring's Spring.Handlers bag and Spring.schemas, the XML configuration file to the jar of Schema transposition of activemq.xsd paper bag, but it also led to the Eclipse does not properly check the configuration file, an

  • struts.xml configuration file Xiangjie 2009-01-30

    <! DOCTYPE struts PUBLIC "- / / Apache Software Foundation / / DTD Struts Configuration 2.0 / / EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <! - Include node is struts2 in component-based approach can be

  • spring xml configuration file to load the way 2010-07-03

    spring xml configuration file to load the way, if there were three kinds, xml is the most common spring applications configure the source. Spring in support of several container assembly using the xml bean, including: XmlBeanFactory, ClassPathXmlAppl

  • XML configuration file through simple authentication 2010-08-16

    Achieved through the framework verified, ease the burden of Action Validate the data entered by only a simple example of between 0-100 to achieve validation framework The order followed a request from outer to inner documents required A simple JSP pa

  • the use of multiple spring xml configuration file and parsing 2010-11-20

    1 contextConfigLocation parameters defined in web.xml. Spring will use this parameter to load. All comma separated xml. If this parameter is, spring loaded by default web-inf/applicationContext.xml file. <context-param> <param-name> contextCon

  • android in the Xml configuration file to customize View to note 2010-12-01

    Do not know if you are in the XML configuration file to customize the experience of View, such as this. <Xiaohang.zhimeng.TestView android: layout_width = "wrap_content" android: layout_height = "wrap_content" /> </ LinearLayo

  • [Transfer] Spring xml configuration file loaded in several ways 2010-12-29

    A: Spring in support of several containers are assembled using xml bean, including: XmlBeanFactory, ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, XmlWebApplicationContext Loading of these containers xml configuration files are abou

  • sruts2.0 web.xml configuration file 2011-05-04

    Any MVC framework and Web application integration needs, which had to resort to web.xml file, only the configuration in the web.xml file in the Servlet will be applied load. Usually, all the MVC framework for Web application needs to load a core cont

  • DWR.xml configuration file specification 2009-05-24

    1, set up configuration files dwr.xml Dwr.xml any of the required documents are included in the statement DWR DOCTYPE line in the following format: <! DOCTYPE dwr PUBLIC "- / / GetAhead Limited / / DTD Direct Web Remoting 1.0 / / EN" "ht

  • spring xml configuration file to read. Get the bean in several ways 2011-01-06

    Spring Framework for managing the instance of the class of means, as follows: Method One: ApplicationContext object stored in the initialization code: ApplicationContext ac = new FileSystemXmlApplicationContext ("applicationContext.xml"); ac.get

  • The role of maven settings.xml configuration file 2011-04-20

    settings.xml for maven is equivalent to the configuration of global for all projects. There are two in the maven2 settings.xml. One is the global configuration <br /> It is located in maven2 installation directory conf below. For the team to set and

  • Spring declarative transaction management configuration xml configuration file 2010-06-18

    Spring declarative transaction management, configuration files using xml configuration is as follows: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="

  • Tomcat web.xml configuration file Xiangjie 2010-06-03

    Each station has a WEB-INF web.xml settings under the file, it provides our site's configuration settings. web.xml definition: . The site name and description . For the environmental parameters (Context) to do the initial work . Servlet name and mapp

  • web.xml configuration file Xiangjie 2010-04-19

    Deployment descriptor is actually an XML file that contains a lot of description of servlet / JSP applications in all aspects of the elements, such as the servlet registration , Servlet mapping as well as the listener registration. The deployment des

  • Application.xml configuration file contains comments 2010-07-09

    <? Xml version = "1.0" encoding = "UTF-8"?> <Beans xmlns = "http://www.springframework.org/schema/beans" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: jee = "http://www.springframewor

  • dom4j parsing XML configuration file (example) 2010-08-30

    sys-config.xml <?xml version="1.0" encoding="UTF-8"?> <config> <db-info> <driver-name>oracle.jdbc.driver.OracleDriver</driver-name> <url>jdbc:oracle:thin:@localhost:1521:HUGUI</url> <user-na

  • Spring2.5.6 the bean.xml configuration file that contains the Ioc and AOP configuration such comments 2010-05-14

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/sch

  • servlet in the web.xml configuration file parameters in context-param and the init-param District 2010-06-17

    web.xml which can be defined two parameters: (1) application within the parameters stored in servletcontext, in web.xml, configured as follows: <context-param> <param-name> context / param </ param-name> <param-value> avalible duri