Loading:


    Reklama Flash - dynamiczny baner na stronie [AS + JS]

    Skrypt wyświetla film flash jako baner reklamowy, źródło pliku SWF umieszczamy dla zmiennej swfURL dodając co nazwie pliku Flash ?loader=javascript:loader()&adclose=javascript:window.close()&clickTag="+escape('http://www.adnet.pl'). Parametr clickTag oznacza przekierowanie po naciśnięciu baneru.

     

    wwidth oraz wheight to szerokość oraz wysokość filmu, kolejne parametry w zmiennej properties to zaczynając od lewej (1 - włączona opcja, 0 - wyłączona opcja): pełny ekran, pasek narzędzi, pasek menu, scrolle, zmiana wielkości, status, wykaz, skróty klawiszowe, szerokość, wysokość.

     

    Pierwszą klatkę animacji flash zostawiamy pustą - umieszczamy w niej wyłącznie wywołanie funkcji:

    stop();
    getURL(_root.loader,"_self");

    Kreacja posiada krzyżyk zamykający z dowiązaniem aby zamknąć baner:

    on (release)
    {
        getURL(_root.adclose,"_self");
    }


    W ostatniej klatce animacji flash umieszczamy:

    stop();
    getURL(_root.adclose,"_self");



    Napisz Artyku³

    Listing

    <script language=javascript>
    <!--
    var wwidth = window.screen.width;
    var wheight = window.screen.height;
    bgcolor="#ffffff";
    swfURL = "http://dc1.sabela.pl/files/kod/examples/interstitial.swf?loader=javascript:loader()&adclose=javascript:window.close()&clickTag="+escape('http://www.adnet.pl');
    properties = "fullscreen=1, toolbar=0, menubar=0, scrollbars=0, resizable=0, status=0, location=0, directories=0, hotkeys=0, width="+wwidth+", height="+wheight;
    if (navigator.userAgent.indexOf('Netscape6')>0) properties = properties + ", screenX=0, screenY=0";
    var psallbr = (document.all || (window.navigator.userAgent.indexOf ("Netspace") > 0)) ? true : false;

    var psclktst = 1;


    function ps3clk() {
    if(psclktst) {
      new_win=window.open("","",properties);
      if (new_win !=null)
       {
         createpolter();
         psclktst = 0;
       }
      else
       {
         psclktst = 1;
       }
    }
    }


    function createpolter()
    {
    new_win.window.resizeTo(100,100); new_win.moveTo(-100,-100);
    new_win.document.write('<'+'html><'+'head><'+'title>Poltergeist<\/title>\n');
    new_win.document.write('<'+'script language="javascript">\n');
    new_win.document.write(' function gomax() { \n');
    new_win.document.write(' var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;');
    new_win.document.write(' var mc = InternetExplorer ? window.mmovie : window.document.mmovie;\n');
    new_win.document.write(' self.resizeTo('+wwidth+','+wheight+');');
    new_win.document.write(' self.moveTo(0, 0); self.focus(); mc.GotoFrame(2); mc.Play(); }\n');
    new_win.document.write(' function loader() {\n');
    new_win.document.write(' if (navigator.userAgent.indexOf("Netscape6")>0) gomax(); else { var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;');
    new_win.document.write(' var mc = InternetExplorer ? window.mmovie : window.document.mmovie;\n');
    new_win.document.write(' mc.StopPlay(); if (mc.PercentLoaded() >= 100)  setTimeout("gomax()",2000);');
    new_win.document.write(' else setTimeout("loader()", 1000); } } \n');
    new_win.document.write(' <\/script>\n');
    new_win.document.write('<\/HEAD><BODY style="margin: 0" scroll="no" marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 bgcolor="'+bgcolor+'">');
    new_win.document.write(' <OBJECT ID="mmovie" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
    new_win.document.write(' CODEBASE="http://active.macromedia.com/flash2/cabs/swflash.cab#version=2,0,0,11"');
    new_win.document.write(' WIDTH='+wwidth+' HEIGHT='+wheight+'><PARAM NAME=movie VALUE="'+swfURL+'"> <PARAM NAME=quality VALUE=high>');
    new_win.document.write(' <PARAM NAME="autostart" VALUE="false"> <PARAM NAME=bgcolor VALUE="'+bgcolor+'">');
    new_win.document.write(' <EMBED MAYSCRIPT SWLIVECONNECT=true NAME="mmovie" src="'+swfURL+'" quality=high wmode=transparent bgcolor="'+bgcolor+'" ');
    new_win.document.write(' WIDTH='+wwidth+' HEIGHT='+wheight+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
    new_win.document.write(' <\/OBJECT><\/BODY><\/HTML>');
    self.focus();
    }

    if (psallbr) {
    new_win = window.open("", "", properties);
    if (new_win !=null) {
    createpolter();
    }
    else {
    document.onclick=ps3clk;
    }
    }


    //-->
    </script>




    Dodano przez: divix
    Ranga: Administrator serwisu Punktów: 0
    Komentarze użytkowników
      • Tre¶æ komentarza
        Kod do komentarza (opcjonalnie)
        PHP JavaScript MySQL Smarty SQL HTML CSS ActionScript
        Autor
        Token
        token

         

         








    funkcje.net
    Wszelkie prawa zastrzeżone©. | Funkcje.net 2008-2025 v.1.5 | design: diviXdesign & rainbowcolors