Subversion Repositories linkit

[/] [trunk/] [fileUploadApp/] [src/] [main/] [flex/] [FileUploadApp.mxml] - Blame information for rev 1

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1 sbahloul
2
3
    creationComplete="initApp()" viewSourceURL="srcview/index.html"
4
    backgroundColor="white">
5
 
6
        
7
                
8
 
9
                        import mx.controls.Alert;
10
            import flash.external.*;
11
            import com.flashdev.utils.Localizator;
12
 
13
            [Bindable]
14
            public var domain:String;
15
            [Bindable]
16
            public var target:String;
17
            [Bindable]
18
            public var leftSpace:Number;
19
            [Bindable]
20
            public var maxFileSize:Number;
21
            [Bindable]
22
            public var locale:String;
23
            [Bindable]
24
            public var showSendButton:String;
25
 
26
            [Bindable]
27
            private var uploadDoneMsg:String;
28
            [Bindable]
29
            private var uploadSucceedMsg:String;
30
            [Bindable]
31
            private var ioErrorMsg:String;
32
            [Bindable]
33
            private var errorMsg:String;
34
            [Bindable]
35
            private var securityErrorMsg:String;
36
 
37
                        // Initalize
38
                        private function initApp():void {
39
                domain = Application.application.parameters.domain;
40
                target = Application.application.parameters.target;
41
                leftSpace = Application.application.parameters.leftSpace;
42
                maxFileSize = Application.application.parameters.maxFileSize;
43
                locale = Application.application.parameters.locale;
44
                showSendButton = Application.application.parameters.showSendButton;
45
 
46
                                Security.allowDomain(domain);
47
 
48
                Localizator.getInstance().lang = getLocalizator();
49
 
50
                initMessages();
51
                        }
52
 
53
            private function getLocalizator():int {
54
                if ("fr_FR" == locale) {
55
                    return Localizator.FRENCH;
56
                } else {
57
                    return Localizator.ENGLISH;
58
                }
59
            }
60
 
61
            private function initMessages():void {
62
                uploadDoneMsg = Localizator.getInstance().getText('msg.upload.done');
63
                uploadSucceedMsg = Localizator.getInstance().getText('msg.upload.success');
64
                ioErrorMsg = Localizator.getInstance().getText('msg.upload.ioError');
65
                errorMsg = Localizator.getInstance().getText('msg.error');
66
                securityErrorMsg = Localizator.getInstance().getText('msg.upload.securityError');
67
            }
68
 
69
                ]]>
70
        
71
 
72
        
73
        
74
                
75
                        width="100%" height="100%"
76
            uploadUrl="{target}"
77
            leftSpace="{leftSpace}"
78
            maxFileSize="{maxFileSize}"
79
            showSendButton="{showSendButton}"
80
            uploadComplete="Alert.show(uploadDoneMsg, uploadSucceedMsg)"
81
            uploadIOError="Alert.show(ioErrorMsg, errorMsg)"
82
            uploadSecurityError="Alert.show(securityErrorMsg, errorMsg)"/>
83
        
84