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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
###################### JS PART
 
function NOCTURNE() {
    this.testarray = [];
    this.stageWidth = "100%";
    this.stageHeight = "100%";
 
    this.settings = {
            arraySet: this.testarray,
            aTestVar: 640,
            anotherTestVar: "Asymmetric",
            anotherBool: true,
            aColor: 0x99CCFF,
            initValue: 1
    };
 
    this.ContPageFlash  = "PageContainer";
    this.ContPageHeader = "PageHeader";
}
 
 
NOCTURNE.prototype.getObjectReference = function( id ) {
    return document.getElementById( id );
}
 
NOCTURNE.prototype.getNocturneReference = function() {
    return this.getObjectReference( this.ContPageFlash );
}
 
 
 
NOCTURNE.prototype.rewritePageHeader = function() {
    nocturne.getNocturneReference().rewritePageHeader();
}
 
 
NOCTURNE.prototype.onWindowLoad = function(){
    var pageheader = nocturne.getObjectReference( nocturne.ContPageHeader );
    if( pageheader ){
        pageheader.style.cursor = "pointer";
        pageheader.onclick = nocturne.rewritePageHeader;
    }
}
 
 
 
 
NOCTURNE.prototype.addLoadEvent = function ( fn ) {
    if (typeof window.addEventListener != "undefined") {
        window.addEventListener("load", fn, false);
    }
    else if (typeof document.addEventListener != "undefined") {
        document.addEventListener("load", fn, false);
    }
    else if (typeof window.attachEvent != "undefined") {
        window.attachEvent("onload", fn);
    }
    else if (typeof window.onload == "function") {
        var fnOld = window.onload;
        window.onload = function() {
            fnOld();
            fn();
        };
    }
    else {
        window.onload = fn;
    }
}
 
 
NOCTURNE.prototype.create = function(){
    this.settings.arraySet = this.testarray;
 
    if( location.hash.substr(1) != "" )
        this.settings.initValue = location.hash.substr(1);
 
    this.addLoadEvent( this.onWindowLoad );
 
 
    swfobject.embedSWF("test.swf",
                       this.ContPageFlash,
                       this.stageWidth,
                       this.stageHeight,
                       "8.0.0",
                       "js/expressInstall.swf",
                       this.settings,
 
                       {
                         allowScriptAccess: "always",
                         bgcolor:  "#" + this.settings.aColor.toString( 16 )
                       }
 
    );
 
 
}
 
 
nocturne = new NOCTURNE();
 
 
 
 
 
 
 
/*
  customize part */
 
nocturne.settings.testArray = [
        "teil 1",
        "teil 2"
];
nocturne.settings.anotherBool = false;
 
/*
  init
  */
 
nocturne.create();
 
function test(){
  nocturne.rewritePageHeader();
}
 
 
 
###################### AS PART
 
Stage.scaleMode = "noScale";
Stage.align = "TL";
Stage.addListener(this);
function initJS() {
       out.text = "blubB";
       if (anotherTestVar != undefined) {
              out.text = anotherTestVar;
       }
}
function rewritePageHeader()
{
    _root.out.text = "lalalaal";
} 
 
function registerExternalFunctions()
{
    flash.external.ExternalInterface.addCallback("rewritePageHeader", null, rewritePageHeader);
}
btn.onRelease = function(){
    _root.out.text = anotherTestVar;
}
 
initJS();
 
registerExternalFunctions();