- //1. 使用绝对地址
<mx:Style source=‘http://www.somesite.com/mystyles.css‘>
//2. 使用◎ContextRoot
<mx:HTTPService url=‘@ContextRoot()/directory/myfile.xml‘/>
//3. 使用根目录引用方式
<mx:Script source=‘/myscript.as‘/>
//4. 使用相当路径引用
<mx:Script source=‘../myscript.as‘/>
- <?xml version=‘1.0‘?>
<mx:Application xmlns:mx=‘http://www.macromedia.com/2003/mxml‘ >
- <mx:Panel title=‘My Application‘ marginTop=‘10‘ marginBottom=‘10‘
- marginLeft=‘10‘ marginRight=‘10‘ >
- <mx:Label text=‘Hello World!‘ color=‘#6601D7‘ fontSize=‘24‘ />
- </mx:Panel>
- </mx:Application>
- <mx:Application xmlns:mx=‘http://www.macromedia.com/2003/mxml‘>
- <
mx:Panel title=‘My Application‘ marginTop=‘10‘ marginBottom=‘10‘
marginLeft=‘10‘ marginRight=‘10‘ >
- <
mx:HBox>
- <!-- List
with three items -->
- <
mx:List>
- <
mx:dataProvider>
- <
mx:Array>
- <
mx:String>Item 1</mx:String>
- <
mx:String>Item 2</mx:String>
- <
mx:String>Item 3</mx:String>
- </
mx:Array>
- </
mx:dataProvider>
- </
mx:List>
- <!--
First pane of TabNavigator -->
- <
mx:TabNavigator borderStyle=‘solid‘>
- <
mx:VBox label=‘Pane1‘ width=‘300‘ height=‘150‘ >
- <
mx:TextArea text=‘Hello World‘ />
- <
mx:Button label=‘Submit‘ />
- </
mx:VBox>
- <!--
Second pane of TabNavigator -->
- <
mx:VBox label=‘Pane2‘ width=‘300‘ height=‘150‘ >
- <!--
Stock view goes here -->
- </
mx:VBox>
- </
mx:TabNavigator>
- </
mx:HBox>
- </
mx:Panel>
- </
mx:Application>
- <mx:Application xmlns:mx=‘http://www.macromedia.com/2003/mxml‘>
- <
mx:Panel title=‘My Application‘ marginTop=‘10‘ marginBottom=‘10‘
marginLeft=‘10‘ marginRight=‘10‘ >
- <
mx:TextArea id=‘textarea1‘/>
- <
mx:Button label=‘Submit‘ click=‘textarea1.text=‘Hello World‘;‘/>
- </
mx:Panel>
- </
mx:Application>
- <mx:Application xmlns:mx=‘http://www.macromedia.com/2003/mxml‘>
- <
mx:Script>
- <![
CDATA[
- function
hello(){
textarea1.text=‘Hello World‘;
- }
- ]]>
- </
mx:Script>
- <
mx:Panel title=‘My Application‘ marginTop=‘10‘ marginBottom=‘10‘
marginLeft=‘10‘ marginRight=‘10‘ >
- <
mx:TextArea id=‘textarea1‘/>
- <
mx:Button label=‘Submit‘ click=‘hello();‘/>
- </
mx:Panel>
- </
mx:Application>
- <mx:Application xmlns:mx=‘http://www.macromedia.com/2003/mxml‘>
- <
mx:Panel title=‘My Application‘ marginTop=‘10‘ marginBottom=‘10‘
marginLeft=‘10‘ marginRight=‘10‘ >
- <
mx:TextInput id=‘textinput1‘ text=‘Hello‘/>
- <
mx:TextArea id=‘textarea1‘ text=‘‘/>
- <
mx:Button label=‘Submit‘ click=‘textinput1.text=‘Goodbye‘;‘/>
- </
mx:Panel>
- </
mx:Application>
联系客服