Jump to content

Replacing .swf with a Link


Smudly

Recommended Posts

I am working on a Traffic Exchange project, and currently trying to figure out a small problem I'm having. I have created a flash countdown timer that counts from 10 to 0. Once it hits 0, I need the flash to disappear and be replaced with a Link that allows users to view the next website.

 

Any suggestions of how I should go about doing this?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/204069-replacing-swf-with-a-link/
Share on other sites

The JavaScript could look something like this:

 

<script type="text/javascript">
var time = 10;

function startCountdown(){
    var t = setTimeout("countdown()", 1000);
}

function countdown(){
    --time;
    if(time == 0){
        document.getElementById("countdown").innerHTML = "<a href='...'>...</a>";
    }else{
        document.getElementById("countdown").innerHTML = time;
        var t = setTimeout("countdown()", 1000);
    }
}
</script>

<div id="countdown">10</div>
<button onclick="startCountdown();">Start</button>

 

All you need to do is style it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.