| ###################### 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(); |