hi calle81,
well the main idea is to have 2 flags and 1 timer
the function tick_fn( ttime ){} Does not have much loss there, just keep ticking a executing everyting inside the block
the first flag (max_delay) will help you to control the time in which you want to run the code
the second flag (music_active) will help to keep at bay the code inside the timer (Avoid repeating indefinitely, will execute only once or each time the layout.nut is loaded)
Ok, I understand the concept but still not clear on where to put the lines to make it play the snap. I'm slowly learning this scripting stuff so excuse my noob questions. This what i entered in my theme but it breaks it and does not get further to display the wheel etc which is beneath this code:
local snap_active = false;
local delay = 0;
local max_delay = 0;
snap.playing = snap_active;
max_delay=abs(("0"+my_config["dtime"]).tointeger())
max_delay=(max_delay>999 ? 100 : max_delay);
::fe.add_ticks_callback( this, "tick_fn" );
function tick_fn( ttime )
{
delay++;
if ( delay > max_delay )
{
if (snap_active == false){
snap_active = true;
snap.playing = snap_active;
local snap = FadeArt ( "snap", flx*0.183, fly*0.0376, flw*0.635, flh*0.56 );
snap.trigger = Transition.EndNavigation;
snap.preserve_aspect_ratio = true;
}
}
}