Smudly Posted June 7, 2010 Share Posted June 7, 2010 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 More sharing options...
TapeGun007 Posted June 7, 2010 Share Posted June 7, 2010 Since I can't see an example of what you mean, can you not just do that in the flash code itself? Link to comment https://forums.phpfreaks.com/topic/204069-replacing-swf-with-a-link/#findComment-1068844 Share on other sites More sharing options...
Alex Posted June 7, 2010 Share Posted June 7, 2010 Is it really necessary to use flash for the countdown? If it's a time countdown I think it would be more elegant just to use JavaScript. Link to comment https://forums.phpfreaks.com/topic/204069-replacing-swf-with-a-link/#findComment-1068845 Share on other sites More sharing options...
Smudly Posted June 7, 2010 Author Share Posted June 7, 2010 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 https://forums.phpfreaks.com/topic/204069-replacing-swf-with-a-link/#findComment-1068854 Share on other sites More sharing options...
Alex Posted June 7, 2010 Share Posted June 7, 2010 Yea of course, you could probably style it to get it to look the same way you had it in flash and just put a background on it. Link to comment https://forums.phpfreaks.com/topic/204069-replacing-swf-with-a-link/#findComment-1068855 Share on other sites More sharing options...
Smudly Posted June 7, 2010 Author Share Posted June 7, 2010 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 https://forums.phpfreaks.com/topic/204069-replacing-swf-with-a-link/#findComment-1068857 Share on other sites More sharing options...
Alex Posted June 7, 2010 Share Posted June 7, 2010 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 https://forums.phpfreaks.com/topic/204069-replacing-swf-with-a-link/#findComment-1068859 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.