home *** CD-ROM | disk | FTP | other *** search
Wrap
function brain() { create_assets(myself,_global.obj_iads.type); switch(_global.obj_iads.type) { case "FULL": mcLoader.loadClip(_global.obj_iads.url,trgt_main); break; case "EMBED": mcLoader.loadClip(_global.obj_iads.url,trgt_main.trgt_ads); if(_global.obj_iads.link ne undefined) { trgt_main.onRelease = function() { getURL(_global.obj_iads.link,"_blank"); }; } break; case "NOOP": clearInterval(int1); _root.play(); } } function get_iads() { lv_iads = new XML(); lv_result = new XML(); lv_result.ignoreWhite = true; lv_result.onLoad = function(success) { if(success) { parse_iads(lv_result); } else { _root.play(); } }; lv_iads.sendAndLoad(adurl,lv_result,"POST"); } function parse_iads(lv_result) { _global.obj_iads = new Array(); var _loc2_ = 0; while(_loc2_ < lv_result.firstChild.childNodes.length) { if(lv_result.firstChild.childNodes[_loc2_].firstChild.nodeValue != null) { obj_iads[lv_result.firstChild.childNodes[_loc2_].nodeName] = lv_result.firstChild.childNodes[_loc2_].firstChild.nodeValue; } else if(lv_result.firstChild.childNodes[_loc2_].firstChild.firstChild.nodeValue != null) { var _loc5_ = new Object(); var _loc4_ = 0; while(_loc4_ < lv_result.firstChild.childNodes[_loc2_].childNodes.length) { _loc5_[lv_result.firstChild.childNodes[_loc2_].childNodes[_loc4_].nodeName] = lv_result.firstChild.childNodes[_loc2_].childNodes[_loc4_].firstChild.nodeValue; _loc4_ = _loc4_ + 1; } obj_iads[lv_result.firstChild.childNodes[_loc2_].nodeName] = _loc5_; } _loc2_ = _loc2_ + 1; } show_time = int(_global.obj_iads.t); check_type(); } function time_delay() { tim = 0; int1 = setInterval(timespam,1000); } function timespam() { tim++; trace(tim); if(tim == show_time) { clearInterval(int1); _root.play(); } } function create_assets(mc, _type) { mc.createEmptyMovieClip("whitebg",0); whitebg.beginFill(16777215); whitebg.moveTo(0,0); whitebg.lineTo(0,0); whitebg.lineTo(Stage.width,0); whitebg.lineTo(Stage.width,Stage.height + 20); whitebg.lineTo(0,Stage.height + 20); whitebg.endFill(); mc.createEmptyMovieClip("trgt_main",4); mcLoader = new MovieClipLoader(); mcLoader.addListener(mc); if(_type != "FULL") { mc.createEmptyMovieClip("square_mc",5); var _loc4_ = trgt_main.createEmptyMovieClip("trgt_ads",getNextHighestDepth()); var _loc3_ = new TextFormat(); _loc3_.align = "center"; _loc3_.font = "Verdana"; _loc3_.size = 10; var _loc2_ = new TextFormat(); _loc2_.align = "right"; _loc2_.font = "Verdana"; _loc2_.size = 10; _loc2_.underline = true; mc.createTextField("h_txt",mc.getNextHighestDepth(),0,0,100,22); mc.createTextField("b_txt",mc.getNextHighestDepth(),0,0,100,22); mc.createTextField("m_txt",mc.getNextHighestDepth(),0,0,120,22); b_txt.autoSize = true; m_txt.autoSize = true; b_txt.selectable = false; h_txt.selectable = false; m_txt.selectable = false; m_txt.html = true; b_txt.multiline = true; b_txt.setNewTextFormat(_loc3_); h_txt.autoSize = true; h_txt.setNewTextFormat(_loc3_); m_txt.setNewTextFormat(_loc2_); h_txt.text = ""; mc.createEmptyMovieClip("progressBar",500); } } function onLoadInit(mc) { ad_width = int(_global.obj_iads.x); ad_height = int(_global.obj_iads.y); h_txt.text = "Advertisement"; loadMessages(); progressBar.tim = show_time; progressBar.width = _global.obj_iads.x; progressBar.height = 15; progressBar.start = function() { game_fps = getFps(); maxw = this.width - 2; this.ad = maxw / (this.tim + 1); this.ad /= game_fps; }; progressBar.onEnterFrame = function() { if(this.bar._width < this.width - 2) { this.bar._width += this.ad; } else { this.bar._width = this.width; } }; progressBar._x = 100; progressBar._y = 100; bar_mc = progressBar.createEmptyMovieClip("bar",1); box_mc = progressBar.createEmptyMovieClip("box",2); bar_mc.beginFill(26112); bar_mc.moveTo(0,0); bar_mc.lineTo(1,0); bar_mc.lineTo(1,progressBar.height - 2); bar_mc.lineTo(0,progressBar.height - 2); bar_mc.lineTo(0,0); bar_mc.endFill(); bar_mc._x = 1.5; bar_mc._y = 1.5; box_mc.lineStyle(1,3355443,100,true,"none","round","miter",1); box_mc.lineTo(progressBar.width,0); box_mc.lineTo(progressBar.width,progressBar.height); box_mc.lineTo(0,progressBar.height); box_mc.lineTo(0,0); box_mc._x = 0; box_mc._y = 0; progressBar.start(); b_txt.text = "Note\rClicking on the above Ad won\'t interrupt your game.\rAd link opens in a new window."; myself._y = b_txt._y - 10; x = Stage.width / 2 - ad_width / 2; y = Stage.height / 2 - ad_height / 2; mc._x = x; mc._y = y; h_txt._x = x + ad_width / 2 - h_txt._width / 2; h_txt._y = y - 20; progressBar._x = x + ad_width / 2 - progressBar._width / 2; progressBar._y = y + 5 + ad_height; myself.invizi_logo.swapDepths(myself.getNextHighestDepth()); myself.invizi_logo._alpha = 100; myself.invizi_logo._x = int(progressBar._x); myself.invizi_logo._y = int(progressBar._y + progressBar._height) + 5; m_txt._x = int(progressBar._x + progressBar._width) - m_txt._width; m_txt._y = int(progressBar._y + progressBar._height) + 3; myself.invizi_logo.onRelease = function() { getUrl("http://www.inviziads.com/index.html?utm_source=4_1&utm_medium=logo&utm_content=default&utm_campaign=invizi", "_blank"); }; b_txt._x = x + ad_width / 2 - b_txt._width / 2; b_txt._y = progressBar._y + 38; square_mc.beginFill(16711680); square_mc.moveTo(0,0); square_mc.lineTo(ad_width,0); square_mc.lineTo(ad_width,ad_height); square_mc.lineTo(0,ad_height); square_mc.lineTo(0,0); square_mc.endFill(); square_mc._x = x; square_mc._y = y; trgt_main.setMask(square_mc); } function loadMessages() { lv_messages = new XML(); lv_messages.ignoreWhite = true; lv_messages.onLoad = function(success) { if(success) { totalNodes = lv_messages.firstChild.childNodes.length; ran = Math.floor(Math.random() * totalNodes); if(lv_messages.firstChild.childNodes[ran].firstChild == undefined) { m_txt.htmlText = "<font color=\'#0066CC\'><a href=\'http://www.inviziads.com/adv-starter-pack.html\' target=\'_blank\'>Advertisers, try us out for US$250</a></font>"; } else { m_txt.htmlText = "<font color=\'#0066CC\'><a href=\'" + lv_messages.firstChild.childNodes[ran].attributes.link + "\' target=\'_blank\'>" + lv_messages.firstChild.childNodes[ran].firstChild + "</a></font>"; } m_txt._x = int(progressBar._x + progressBar._width) - m_txt._width; m_txt._y = int(progressBar._y + progressBar._height) + 2; } else { m_txt.htmlText = "<font color=\'#0066CC\'><a href=\'http://inviziads.com\' target=\'_blank\'>Advertisers, try us out for US$250</a></font>"; m_txt._x = int(progressBar._x + progressBar._width) - m_txt._width; m_txt._y = int(progressBar._y + progressBar._height) + 2; } }; lv_messages.load(messageURL); } function pushdata() { holder.obj_iads = _global.obj_iads; } function startdatapush(mc) { var _loc2_ = undefined; _loc2_ = setInterval(this,"pushdata",10); } function check_type() { if(_global.obj_iads.type eq "UPDATE") { myself.createEmptyMovieClip("holder",100); var _loc3_ = _global.obj_iads.url; obj_iads = _global.obj_iads; var _loc2_ = new MovieClipLoader(); _loc2_.loadClip(_global.obj_iads.url,holder); } else { brain(); time_delay(); } } function parse_xml(mydata) { var _loc4_ = new Array(); var _loc1_ = 0; while(_loc1_ < mydata.firstChild.childNodes.length) { if(mydata.firstChild.childNodes[_loc1_].firstChild.nodeValue != null) { _loc4_[mydata.firstChild.childNodes[_loc1_].nodeName] = mydata.firstChild.childNodes[_loc1_].firstChild.nodeValue; } else if(mydata.firstChild.childNodes[_loc1_].firstChild.firstChild.nodeValue != null) { var _loc5_ = new Object(); var _loc2_ = 0; while(_loc2_ < lv_result.firstChild.childNodes[_loc1_].childNodes.length) { _loc4_[lv_result.firstChild.childNodes[_loc1_].childNodes[_loc2_].nodeName] = mydata.firstChild.childNodes[_loc1_].childNodes[_loc2_].firstChild.nodeValue; _loc2_ = _loc2_ + 1; } _loc4_[lv_result.firstChild.childNodes[_loc1_].nodeName] = _loc5_; } _loc1_ = _loc1_ + 1; } return _loc4_; } System.security.allowDomain("*"); System.security.allowInsecureDomain("*"); var time = 0; var tim = 0; var show_time = 0; var tempo = 0; var int1; getFps = function() { if(signal == true) { time = getTimer(); } else { tempo = int(1000 / (getTimer() - time)); } signal = !signal; return tempo; }; this.onEnterFrame = function() { game_fps = getFps(); if(game_fps != 0 && game_fps != undefined) { this.onEnterFrame = null; } }; myself = this; signal = true; var purl = flash.external.ExternalInterface.call("document.URL.toString"); var hurl = escape(_root._url); var adurl = "http://s1.inviziads.com/lookup.html?"; adurl += "g=1127"; adurl += "&h=g2w"; adurl += "&type=pre"; adurl += "&v=4_3"; adurl += "&purl=" + escape(purl); adurl += "&hurl=" + hurl; var my_date = new Date(); adurl += "&ts=" + my_date.getSeconds(); var messageURL = "http://s1.inviziads.com/template/invizi_messages.xml"; get_iads(); _root.stop();