Display AD for a few seconds and the media will play afterwards. [Need help]

Discussion in 'HTML & Website Design' started by geneuine, Sep 19, 2007.

  1. #1
    Does anyone here know how I can do this (or a script for it)? I have a flash game site and I want an AD to display for around 5 seconds before the game starts and then right after the AD the game will automatically start. Any help is appreciated, Thanks -
     
    geneuine, Sep 19, 2007 IP
  2. geneuine

    geneuine Peon

    Messages:
    292
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Does anyone here know how to do this?
     
    geneuine, Sep 21, 2007 IP
  3. itssangy

    itssangy Peon

    Messages:
    135
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Looks like it can be done using javascript and setTimeout function. maybe create a function to show the ad through the onload event, then after a certain amount of time, hide the div and show the div with the game on..
    the idea makes sense to me :D
     
    itssangy, Sep 22, 2007 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Or, could the Flash game be contained in another "loader" Flash with the ad? It would play the ad, and then Actionscript in the last frame would make the game load.
    You'd have in your html for the Flash
    <object type="application/x-shockwave-flash"
    data="loader.swf?path=nameofgamemovie.swf"
    width="whatever" height="whatever">
    <param name="movie"
    value="loader.swf?path=nameofgamemovie.swf" />
    </object>

    and this in the Actionscript in the last frame of loader.swf:

    _root.loadMovie("nameofgamemovie",0);

    However, if the ad is supposed to change now and then, you'd have to make sure that all new ads are called "loader.swf" and the Actionscript would have to be loaded into all of them (and maybe these ads are being sent to you by someone else and you don't have access to the .fla?). And if the ads are supposed to rotate, then the above wouldn't be a good solution at all. Good thing Js and AS can work together on websites (though how isn't clear to me because I'm allergic to programming : )
     
    Stomme poes, Sep 22, 2007 IP