Search tutorials
onClipEvent(enterFrame)
{
if (_root.startcounter==true)
{
_root.count++;
trace(_root.count); if (_root.count>=_root.delay)
{
_root.count=0;
_root.startcounter=false;
_root.flag=false;
}
}
}
The second if statement checks if the 'count' variable has overtaken the 'delay' variable. If it has, the 'count' variable is reset to 0 and 'startcounter' is set to false stoppping the Counter which runs on the condition 'if (_root.startcounter==true)'. The 'flag' variable is also set to false indicating that the next click can never be a double-click.
Run it
Now run the Movie and double-click at different speeds and test if it is working properly.
{
if (_root.startcounter==true)
{
_root.count++;
trace(_root.count); if (_root.count>=_root.delay)
{
_root.count=0;
_root.startcounter=false;
_root.flag=false;
}
}
}
The second if statement checks if the 'count' variable has overtaken the 'delay' variable. If it has, the 'count' variable is reset to 0 and 'startcounter' is set to false stoppping the Counter which runs on the condition 'if (_root.startcounter==true)'. The 'flag' variable is also set to false indicating that the next click can never be a double-click.
Run it
Now run the Movie and double-click at different speeds and test if it is working properly.


Comments
There are no comments yet. Be the first to comment!