Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-27-2008, 10:17 PM   PM User | #1
spiper
New to the CF scene

 
Join Date: Apr 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
spiper is an unknown quantity at this point
Ads Code Delay

I run a few game sites and am trying to get ads to show for a few seconds before the game loads. Is there a way to do this in the same area the .swf will load? If I put <div> tags will that work? I believe mosts people use javascript to do this. Here is the code for the swf file if someone could help me I would appreciate it.

PHP Code:
<script>
  myprintln('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" WIDTH="<? echo $gamewidth;?>" HEIGHT="<? echo $gameheight;?>" id="FlashContent">');
    myprintln('<PARAM NAME=movie VALUE="<?=$gamefile;?>"');
    myprintln('<PARAM NAME=quality VALUE=high>');
    myprintln('<PARAM NAME="AllowScriptAccess" VALUE="never">');
    myprintln('<embed width="<?=$gamewidth;?>" height="<?=$gameheight;?>" src="<?=$gamefile;?>" quality="high" NAME="FlashContent" AllowScriptAccess="never" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></embed>');
  myprintln('</OBJECT>');
</script>
Maybe put an ad code before the swf code with a refresh and goto the swf code? I do have a delay page where it sends the person to a page for X amount of seconds while the game is loading but that is alot of pages to load I would like to just do it in the game window. Here is the code to the delay page.


Code:
<?php               
          $delayfile = file_get_contents("templates/inbetween.html");
          
          // The following two lines converts [delay]content[/delay] into HTML ... for example
          // [delay]Click here to proceed to game or wait until page loads[/delay] would be converted
          // to <a href = "link to game">Click here to proceed to game or wait until page loads</a>
          $delayfile = str_replace("[delay]","<a href = $gamelink>",$delayfile);
          $delayfile = str_replace("[/delay]","</a>",$delayfile);
          $delayfile = str_replace("[gametitle]",$gametitle,$delayfile);
          $delayfile = str_replace("[gamedescription]",$gamedesc,$delayfile);
                
          // This sets a session variable saying the user already has been delayed for this game
          $_SESSION['delayedid'] = $gameid; 
      
echo '<meta http-equiv="Refresh" content="'.$delaytime.'"; URL="'.$gamelink.'">';
echo $delayfile;
?>
spiper is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:22 AM.


Advertisement
Log in to turn off these ads.