Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
Da [ { ? ?? #1
Making the browser shake for my flash animation
Is there a way that I can modify this script to make it do that... Or do
anybody know one that I can use?!!!
<body onLoad="earthquake()">
<layer id="quakenotice_ns" width=300 height=55 bgColor=black
visibility=hide></layer>
<script>
//configure the likelihood that an earthquake will occur (100% means always)
var chance_of_occurence="100%"
/////do NOT edit below this line/////////////
//variable used to store the equivalency of the 10 rector scales (in the form
of 1, 3, 6...etc)
var rectorscale=new Array(1,3,6,9,12,15,18,21,24,27)
chance_of_occurence=parseInt(chance_of_occurence)
function earthquake(){
//randomly assign a number from 1 to 10 to variable rectorindex
rectorindex=Math.floor(Math.random()*10)
//randomly assign one of element rectorscale into variable rector
rector=rectorscale[rectorindex]
if
((document.all||document.layers)&&Math.floor(Math. random()*100)<=chance_of_occur
ence) {
//shake the browser's screen according to the random rector scale!
for (i=0;i,i<20;i++){
window.moveBy(0,rector)
window.moveBy(rector,0)
window.moveBy(0,-rector)
window.moveBy(-rector,0)
}
// show quake message
quakealert()
}
}
if (document.all)
document.write('<div id="quakenotice_ie"></div>')
function quakealert(){
var quakemessage='An earthquake of magnitude <b>'+eval(rectorindex+1)+'</b>
has just occured! Please stay calm...everything\'s fine now.'
if (document.all){
quakemsg_ie=document.all.quakenotice_ie
quakemsg_ie.innerHTML=quakemessage
//position quake message in center of screen
quakemsg_ie.style.left=document.body.scrollLeft+do cument.body.clientWidth/2-quak
emsg_ie.offsetWidth/2
quakemsg_ie.style.top=document.body.scrollTop+docu ment.body.clientHeight/2-quake
msg_ie.offsetHeight/2
quakemsg_ie.style.visibility="visible"
setTimeout("quakemsg_ie.style.visibility='hidden'" ,5000)
}
else if (document.layers){
quakemsg_ns=document.quakenotice_ns
quakemsg_ns.document.write(quakemessage)
quakemsg_ns.document.close()
quakemsg_ns.left=pageXOffset+window.innerWidth/2-quakemsg_ns.document.width/2
quakemsg_ns.top=pageYOffset+window.innerHeight/2-quakemsg_ns.document.height/2
quakemsg_ns.visibility="show"
setTimeout("quakemsg_ns.visibility='hide'",5000)
}
}
</script>
PLease Help if you can....
Da [ { ? ?? Guest
-
Please help --> How can I install flash player plugin (version 8) in browser without downloading setup or redirecting to macromedia site if flash plugin is not available in browser
Hi, Please help How can I install flash player plugin (version 8) in browser without downloading setup or redirecting to macromedia site if... -
shake projector?
I've seen some websites that shake the browser on certain flash events. I've found some info on how to do it on a browser, but can it be done in the... -
making a simple font browser
Hello, I wrote a tutorial on http://www.stcassociates.com/lab/tutorials/fb-01.htm. I had a lot of requests to explain/publish how I created the... -
Drag/Drop with transparent Flash animation (flash 5 vs mx)
I am building a web application which lets you drag and drop flash objects over a user-defined local image, but I'm having trouble with Flash's... -
Anti shake CCD is here.
wow cool. in my tests while looking for a 3mp camera, the minoltas were my second choice behing the oly's (in my price range.) I'll have to give them...



Reply With Quote

