Previous Tip  |  Next Tip  |  Design Tips   | [Bill's Home]

User interaction

[Expand] One thing that I have found with multimedia and WWW design is that it is important to force the user to interact in the design, and make them think. The best animation, and the best text in the world do not count for much if the user becomes bored with endless animation, and reading from the screen. A good example of user interaction is to get the user to enter values which are then checked, and automatically marked. For my subnetting examples I have used the following:

 

The ActionScript randomly generates IP addresses, within different classifications (Class A, B or C):

 


i=random(3);

trace(i);

if (i==0) //Class A address with 255.255.0.0 SM
{
val=random(126)+1;
ip=val + ".x.y.z";
sm="255.255.0.0";
ans1=val + ".1.0.0";
ans2=val + ".2.0.0";
ans3=val + ".3.0.0";
}
else if (i==1) //Class A address with 255.255.255.0 SM
{
val1=random(126)+1;

ip=val1 + ".x.y.z";
sm="255.255.255.0";
ans1=val1 + ".0.1.0";
ans2=val1 + ".0.2.0";
ans3=val1 + ".0.3.0";


}
else if (i==2) // Class B
{
val1=127+random(63);
val2=random(250)+1;
ip=val1 + "." + val2 + ".y.z";
sm="255.255.255.0";
ans1=val1 + "." + val2 + ".1.0";
ans2=val1 + "." + val2 + ".2.0";
ans3=val1 + "." + val2 + ".3.0";
}


subnet1="<1st address>";
subnet2="<2nd address>";
subnet3="<3rd address>";

setProperty ("tic1", _visible, false);
setProperty ("tic2", _visible, false);
setProperty ("tic3", _visible, false);

text_ip=ip;
text_sm=sm;

and the script to respond to the user entry is:


if (subnet1==ans1)
setProperty ("tic1", _visible, true);
else
setProperty ("tic1", _visible, false);


if (subnet2==ans2)
setProperty ("tic2", _visible, true);
else
setProperty ("tic2", _visible, false);

if (subnet3==ans3)
setProperty ("tic3", _visible, true);
else
setProperty ("tic3", _visible, false);

if (subnet1=="?") subnet1=ans1;
if (subnet2=="?") subnet2=ans2;
if (subnet3=="?") subnet3=ans3;


if ((subnet1==ans1) && (subnet2==ans2) && (subnet3==ans3)) gotoAndPlay(10);
else gotoAndPlay (2);