Pyksel Locker fou ! | Code :
- onLoad(){
- // set up for gsbTrace window -------------------------------
- _global.gsbTrace=function(str) {
- if(outgoing==undefined) var outgoing=new LocalConnection();
- outgoing.send( "_4gsbTraceWin", "gsbTrace", str );
- };
- // javascript trace function (see js code)
- _root.feedback="";
- _global.traceFeedback=function(p,o,n,u) { gsbTrace(n); return ""; };
- _root.watch("feedback",traceFeedback);
- //-----------------------------------------------------------
- //************************************************
- // Stage management
-
- Stage.scaleMode="noScale";
- Stage.align="";
- Stage.showMenu=false;
-
- Stage.movieH=575; // movie panel height
- Stage.movieW=960; // movie panel width
-
- Stage.gsb = new Object();
- Stage.gsb.setFrame=function() {
- if(this.resizeTimer){clearInterval(this.resizeTimer);this.resizeTimer=null;}
- Stage.Top=(Stage.height-Stage.movieH)/2;
- Stage.Left=(Stage.width-Stage.moview)/2;
- // Upon browser resize event, do these things...
- if(iframes instanceof Array)
- for(var i=0;i<iframes.length;i++)
- (iframes[i]).iframeResize();
- };
-
- Stage.gsb.onResize=function() {
- if(Stage.Top) {
- if(this.resizeTimer)clearInterval(this.resizeTimer);
- this.resizeTimer=setInterval(this,"setFrame",10);
- } else if(Stage.width) this.setFrame();
- };
-
- Stage.gsb.resizeTimer=setInterval(Stage.gsb, "onResize", 500); // 4 Netscape
- Stage.addListener(Stage.gsb);
-
- //************************************************
- // iFrame setup/control functions
-
- _global.iframeLevel = 1; // above main movie
- loadMovieNum("levelSeed.swf",iframeLevel); // init
- _global.iframes = new Array(); // init
-
- // User exposed iFrame control functions
- _global.iframeInitialize=function(obj) { // global 4 user
- if((i=iframeFind(obj._name))!=-1) iframeRemove(i);
-
- var iframe=iframeLevel.createEmptyMovieClip(obj._name,++iframeLevel.nextDepth);
- iframe.iframeBounds=obj.getBounds(_root);
- iframe._x=iframe.iframeBounds.xMin;
- iframe._y=iframe.iframeBounds.yMin;
- iframe.iframeVisible=true;
- iframes.push(iframe);
-
- iframe.beginFill(0xFFFFFF,0);
- iframe.lineTo(0,obj._height);
- iframe.lineTo(obj._width,obj._height);
- iframe.lineTo(obj._width,0);
- iframe.lineTo(0,0);
- iframe.endFill();
-
- iframe.iframeActive = false;
- iframe.iframeWidth = obj.iframeWidth;
- iframe.iframeHeight = obj.iframeHeight;
- iframe.iframeX = obj.iframeX;
- iframe.iframeY = obj.iframeY;
-
- iframe.iframeResize = function() {
- if(this.iframeActive&&this.iframeVisible) {
- this.iframeBounds = this.getBounds(_root);
- processIframeCommand.apply(this,["setHW,"+this._name+","+
- this.iframeHeight()+","+this.iframeWidth()]);
- processIframeCommand.apply(this,["setTL,"+this._name+","+
- this.iframeY()+","+this.iframeX()]);
- }
- };
-
- if(typeOf(obj.iframeURL)!="string" ) iframe.iframeURL="blank.html";
- else {
- iframe.iframeURL=obj.iframeURL;
- iframeLoad(iframe._name,iframe.iframeURL);
- }
- };
-
- _global.iframeHide = function(name) { // global 4 user
- if((i=iframeFind(name))!=-1) {
- if(iframes[i].iframeActive&&iframes[i].iframeVisible) {
- processIframeCommand("setTL,"+iframes[i]._name+","+
- iframes[i].iframeY()+","+(-100-iframes[i].iframeWidth()));
- iframes[i].iframeVisible=false;
- }
- }
- };
-
- _global.iframeShow = function(name) { // global 4 user
- if((i=iframeFind(name))!=-1) {
- if(iframes[i].iframeActive&&!iframes[i].iframeVisible) {
- iframes[i].iframeVisible=true;
- iframes[i].iframeResize();
- }
- }
- };
-
- _global.iframeDelete = function(name) { // global 4 user
- if((i=iframeFind(name))!=-1) {
- if(iframes[i].iframeActive) {
- processIframeCommand("delete,"+iframes[i]._name);
- iframes[i].iframeActive=false;
- }
- }
- };
-
- _global.iframeLoad = function(name,url,visible) { // global 4 user
- if((i=iframeFind(name))!=-1) {
- iframes[i].iframeBounds = iframes[i].getBounds(_root);
- if(url!=undefined) iframes[i].iframeURL=url;
- iframes[i].iframeActive=true;
- processIframeCommand("setContent,"+iframes[i]._name+","+iframes[i].iframeURL);
- processIframeCommand("setHW,"+iframes[i]._name+","+
- iframes[i].iframeHeight()+","+iframes[i].iframeWidth());
- if(visible==undefined||visible==true) {
- iframes[i].iframeVisible=true;
- processIframeCommand("setTL,"+iframes[i]._name+","+
- iframes[i].iframeY()+","+iframes[i].iframeX());
- } else {
- iframes[i].iframeVisible=false;
- processIframeCommand("setTL,"+iframes[i]._name+","+
- iframes[i].iframeY()+","+(-100-iframes[i].iframeWidth()));
- }
- }
- };
-
- _global.iframeFind=function(name) { // internal
- for(var i=0; i< iframes.length; i++)
- if(iframes[i]._name==name)
- return i;
- return -1;
- };
- _global.iframeRemove=function(n) { // internal
- iframes[n].iframeDelete();
- iframes[n].removeMovieClip();
- iframes.slpice(n,1);
- };
- _global.processIframeCommand=function(s) { // internal
- if(useFS) fsCommand("overlayCommand",s);
- else setJSQ('overlayCommands("'+s+'" );');
- };
-
- }
- //************************************************
- // Pre-loader of sorts
- onFrame(3) {
- if(Stage.Top&&eval("_level"+iframeLevel+".isLoaded" ) &&
- (fsInitialized=="true"||(jsInitialized=="true"&&timeOut>10))) {
- _global.iframeLevel=eval("_level"+iframeLevel);
- iframeLevel.nextDepth=1;
- if(fsInitialized=="true" ) { // preferred method
- useFS=true;
- } else if(jsInitialized=="true" ) { // ...setup alternative method
- JSQ=""; // JavaScript Queue
- _global.setJSQ=function(s) { _level0.JSQ+=s; }; // append
- iframeLevel.onEnterFrame=function() { // monitor function
- if(_level0.JSQ!="" ) {
- javascript(_level0.JSQ);
- _level0.JSQ="";
- }
- };
- }
- nextSceneAndPlay();
- } else {
- if(fsInitialized!="true" ) {
- fsCommand("validatefs","true" );
- if(jsInitialized!="true" ) javascript('validatejs("true" );');
- else ++timeOut;
- }
- prevFrameAndPlay();
- }
- }
|
Code :
- onLoad() {
- iframeWidth = function() { return this._width-3; };
- iframeHeight = function() { return this._height-4; };
- iframeX = function() { return Stage.Left+this.iframeBounds.xMin+2; };
- iframeY = function() { return Stage.Top+this.iframeBounds.yMin+2; };
- iframeURL="introduction.html"; // autoload feature, otherwise omit
- iframeInitialize(this);
- }
|
Code :
- onSelfEvent (release) {
- iframeLoad("mainIframe","http://www.google.com" );
- }
- onSelfEvent (release) {
- iframeLoad("mainIframe","introduction.html" );
- }
- onSelfEvent (release) {
- iframeHide("mainIframe" );
- }
- onSelfEvent (release) {
- iframeShow("mainIframe" );
- }
- onSelfEvent (release) {
- iframeDelete("mainIframe" );
- }
|
---------------
Rien est impossible, il suffit d'y croire !
|