Magic Scopes Directions
MAGIC SCOPES DIRECTIONS
FOR MSNTV ONLY
Magic scopes move around the page, creating forms. This effect occurs because the scopes leave their "footprints" behind as the script moves them around. There's one complication: The MSN logo appears in the lower right corner of the TV screen once every 10 minutes. Its appearance usually wipes out the figure, so you have to reload and start over.

THE TABLE AND AUDIOSCOPE


1) You must add the following to the body tag, or nothing will show up: onload="doit()"

<body bgcolor=?? onload="doit()">

Add text color, etc, if needed.



2) Create a table and a cell:

<table align="center" cellpadding="0" cellspacing="0" border="0" id="scp"> <td>

Note the id="scp" addition to the table tag. If you use more than one table, name the 2nd one id="scp2"



3) Put an audioscope in the table cell:

<audioscope id="scope" width="?" height="?" bgcolor="?" leftcolor="?" rightcolor="?" leftoffset="?" rightoffset="?" gain="?">

Note: make the scope small in width and height at first. You can also put 2 or more scopes in each table. Stack them or put them each in a separate cell. The id="scope" addition to the scope tag doesn't need numbered, even if you use more than one scope.



4) Close the cell and table:

</td></table>




THE SCRIPT THAT MAKES IT MOVE


1) Open the script:

<script>



2) I'm not sure whether these next 2 do anything. I have even used 0 instead of what is given here. Most of the time, I make these 2 numbers agree with those in #5 below:

scp.posTop = 185;
scp.posLeft = 272;


Note: if you have more than one table, you must have an additional two lines. Label them

scp2.posTop = 185;
scp2.posLeft = 272;




3) The next 2 lines set the radius of the movement. These lines control all tables/scopes, so use them only once. r means radius of a circle; n is part of the radius:

n = 1
r = 1


Note: you can change these to any number you wish, but it is best to keep to fairly small numbers.



4) The following line hooks up to the onload="doit()" command in the body tag:

function doit() {



5) The curly bracket { (end of line above) opens the following commands and must be closed at the end (see #8 below):

scp.posTop = 185+r*Math.sin(n/45);
scp.posLeft = 272+r*Math.cos(n/22);


The first number in the first line - 185 - positions the table/scope halfway down from the top.
The first number in the 2nd line - 272 - puts it halfway from the left side.

You can change sin (sine) and cos (cosine) to the same for both lines, or reverse them. These cause curves.

You can also use tan (tangent) and cot (cotangent). But these two will display vertically and horizontally as straight lines and will extend far off the screen.

The n/45 and n/22 also can be changed for different effects. Try smaller and larger numbers and making them the same.

Note: if you use more than one table, you must repeat both of these lines for each table. Be sure to change the position:

scp2.posTop = 58+r*Math.sin(n/45);
scp2.posLeft = 172+r*Math.cos(n/22);




6) Leave the line below alone until you feel confident about changing the lines above.
Leave the 0 at 0 though; change only the %:

if( ++n%30 == 0 ) { r++}



7) The line below controls the size and speed. It says that as long as n is less than 4096, the script will renew itself every 20 microseconds. You can change the 4096 (smaller is best) and the 20:

if( n <= 4096 ) setTimeout(doit,20);



8) Close the curly bracket } and close the script:

} </script>



Get the Codes for the Script here. Put this script, as is, on a new file/page and allow it to run. Keep this file/page to refer to. Then create a new file/page, copy and paste this original in it, play around with the script and have fun. Change only one item at a time in the script until you have an idea of what that one change will do. Then change something else. If you try changing everything at once, it'll just get confusing.

NOTE: Please remember that MSNTV's browser can not handle more than one script per page that involves dynamics (things moving around) and/or animations. Tom Landum explains further: "Basically I use this rule of thumb when I am playing with scripts. If the functions of all the scripts will fit into a single script, then those functions will run okay as individual scripts. You can have a scroller or moving object on the screen and blinking or fading bgcolor, text, links, etc. Webby can not even run an animated gif and a moving object (including marquees) in the same page with DHTML."


I am indebted to Tom Landrum (jawjahboy)
for introducing me to this script.
Please see Tom's Magic Motion Tute for further info.

A special treat! Wasntme has created a great new Tool with a difference: You can actually see the raw codes as you make the changes in the script!.

Tone By Tone Dot Net
Copyright 2004 ©