public
Description: Toby's random stuff
Homepage: http://tobyho.com
Clone URL: git://github.com/airportyh/misc.git
airportyh (author)
Sun May 03 12:50:05 -0700 2009
commit  366479f05b6ef862bd48a83654b511fcd18b3b20
tree    95163cf39016193646b10c7e722e9eafe100a06c
parent  e1a682eda66032443dc628bb80cbd6c2aac4c14b
misc / prototype_in_as / ex1.mxml
100644 32 lines (31 sloc) 1.236 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<Application name="Example 1" xmlns="http://www.adobe.com/2006/mxml">
    <Script>
        include 'includes/Array.as';
        include 'includes/String.as';
        include 'includes/Date.as';
        include 'includes/Number.as';
        function dateTest(){
            log.text += 'new Date().format() = ' + new Date().format() + '\n';
        }
        function arrayTest(){
            log.text += '[1, 2, 3].collect(function(i){ return i * i; }) = ' +
                [1, 2, 3].collect(function(i){ return i * i; }) + '\n';
        }
        function numberTest(){
            log.text += "2.minutes().ago() = " + Object(2).minutes().ago() + '\n';
        }
        function stringTest(){
            log.text += "'one, two, three'.csv2Array().length = " +
                Object('one, two, three').csv2Array().length + '\n';
        }
    </Script>
    <creationComplete>
 
    </creationComplete>
    <Text id="log" fontSize="12" width="100%" height="100%"/>
    <HBox>
        <Button label="String test" click="stringTest()"/>
        <Button label="Date test" click="dateTest()"/>
        <Button label="Array test" click="arrayTest()"/>
        <Button label="Number test" click="numberTest()"/>
    </HBox>
</Application>