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
Share on other sites

It isn't all that necessary to use flash. It just looks nicer. If I was to use Javascript instead, is there a way to replace the image with a link? Or even if I used an animated Gif.

 

The plain text just looks very dull.

Link to comment
Share on other sites

Great, I'll just do that then. What would the code look like (I am completely unfamiliar with javascript). I would prefer using PHP if that even works, but can do either.

 

If you are unsure, any sources that I could research would be appreciated.

Link to comment
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.