Greetings All,
I am new to the site and created my first animated theme just the other day (Scarface Animated).
In building my theme, I decided to utilize custom functions with PS3 javascript as opposed to
GlowBall's template or Dynamic Theme Editor, both of which have been used to create some fantastic themes.
@GlowBall: Many kudos to you sir on your excellent animated theme tutorial. It helped me immensely in understanding
the components involved and how they fit together to create an animated theme.
All of this started me thinking about what custom javascript functionality that others may have employed in their own themes.
An example in my own theme, I needed to have five gunshots execute at a set interval a set number of times and then stop.
This was not possible using IntervalTimer because it cannot be reassigned or stopped once started. So I came up with a
function that allowed me to accomplish what I needed using a series of OneShotTimers:
function SetIntervalTimer(interval, timerID, timeInSeconds, functionName)
{
if(interval === 0) //Zero for continous loop
{
System.timer[timerID] = new IntervalTimer(timeInSeconds, functionName);
}
else //Run for a set number of times
{
for(var i = 0; i < interval; i++)
{
System.timer[timerID + i] = new OneShotTimer(timeInSeconds * (i + 1), functionName);
}
}
}
I would be curious to see what others have come up with. Perhaps we can use this topic as an exchange of ideas?
1 Guest(s)