|
#1
|
|||
|
|||
|
Example: Technique for Multiple timer events
Here is a technique I use for multiple timed events on a page. This is another example of how versatile AMS6 is in developing APs.
Code:
ON PRELOAD:
-- >>>>> setup timer invervals for firing multiple timed events.
-- >>>>> set up 6 timers
myTimers_Max=6
-- >>>>> set up a duration for when each timer should be fired
myTimers_Duration={500,1000,1200,750,4000,2000}
-- >>>>> Set up an interval counter for each timer
myTimers_Interval={0,0,0,0,0,0}
Page.StartTimer(100);
pgTimer_Counter=100
ON TIMER:
-- >>>>> increment the interval for each timer
for x = 1, myTimers_Max do
myTimers_Interval[x] = myTimers_Interval[x] + pgTimer_Counter
end
-- >>>>> check if Individual timer event should be fired
for x = 1, myTimers_Max do
if myTimers_Interval[x] >= myTimers_Duration[x] then
myTimers_Interval[x] = 0; --clear the interval counter & get ready for next time
myTimer_Funct(x); -- execute the function for timer [x]
end
end
--Global Function:
function myTimer_Funct(whichTimer)
if whichTimer == 1 then -- Timer 1 has fired
-- >>>>> timer1 scripting
end
--etc. for the other timers
|
|
#2
|
||||
|
||||
|
Nice example, thanks!
|
|
#3
|
|||
|
|||
|
I too have used a similar method, the only drawback is that if a certain timer interval has more than one function firing from it they are delayed while each function is processed. If you're not doing anything *heavy* within the function, it works great.
|
|
#4
|
|||
|
|||
|
Woah at the two year bump. Nice method though.
|
|
#5
|
||||
|
||||
thats pretty impressive, and i thought i was bad for resurecting threads
|
|
#6
|
||||
|
||||
|
Well at least he is browsing the forum. Nothing wrong with the revival.
__________________
Never know what life is gonna throw at you. (Based on a true story.) |
|
#7
|
||||
|
||||
|
yup, remember the days when we only had 1 timer per page .. .. .. lmao
|
|
#8
|
||||
|
||||
|
Hello
oh, please attache a sample that how to use this codes ;;; I can't use it
|
|
#9
|
||||
|
||||
|
Esfahan, the are easyer and more reliable timer methods on the forum, this is a pure ams workaround but its not ideal for heavy timer work
all the below timers solutions are bug free, reliable and vista compatable http://www.indigorose.com/forums/sho...t=timer+plugin http://www.indigorose.com/forums/sho...t=timer+plugin http://www.indigorose.com/forums/sho...t=timer+plugin |
|
#10
|
|||
|
|||
|
sample
Esfahan
I've attached an example of something I did awhile ago. Keep in mind that this technique is fine as long as there is not a lot of extensive processing within the timer event, where the single timer can't keep up with the processing. It does work; however I have personally switched to using one of the multiple timer options mentioned in the RizlaUK post. |
|
#11
|
||||
|
||||
|
@Rizla
THX , if AMS self have been a multi timer it be beter, but your plugin is very well @holtgrewe THX , I will check it |
|
#12
|
||||
|
||||
|
personaly speaking, unless your project already uses luaCOM then i would use retesets timer plugin
Quote:
|
|
#13
|
||||
|
||||
|
yes, they need to make use of the community... if the community finds a solution for something and it works well, then IR can spend more time working on things the community wants but cant be done from plugins etc
|
|
#14
|
||||
|
||||
|
@Rizla
OK, Your luacom method same is a good plugin. @holtgrewe very very good project. it is cool materiel for AMS multi timer without any plugin. thanks for share your method. too, it has a new idea for display timer actions. |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Important method NOT included, Timer | usernameCasper | AutoPlay Media Studio 6.0 | 18 | 12-01-2006 12:21 PM |
| Example: Loading Paragraph Text Using a Timer | Jonas DK | AutoPlay Media Studio 5.0 Examples | 7 | 11-25-2004 06:10 PM |
| Using Timer for Two or More Events | patf | AutoPlay Media Studio 5.0 | 4 | 07-26-2004 04:06 PM |
| Using Timer Events | Desmond | AutoPlay Media Studio 5.0 Examples | 0 | 09-22-2003 03:14 PM |
| Here's an easy-to-use fully configurable general purpose Flash timer for your projects... | Corey | AutoPlay Media Studio 4.0 | 14 | 06-24-2003 05:21 AM |
All times are GMT -6. The time now is 04:13 AM.









Linear Mode

