Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

Playing a Flash movie every hour.

Hi, does anyone know of an ActionScript to start playing a movie every hour on the hour?  I am using Flash CS3 and AS3. Totally new at this.

Yesterday someone gave me a script on how to delay the movie my 90 seconds but customer now wants every hour.

I appreciate it. Thanks.
0
ecperi58
Asked:
ecperi58
1 Solution
 
quizengineCommented:
If the 90 secs movie worked, what's wrong with multiplying the delay by 40 to get 1 time per hour (simple maths 0 - are you ok with the maths ?)
0
 
ecperi58Author Commented:
Sorry - don't get it. Does this mean that it would play every hour? So if someone signs in at 2:20PM it will play at 3 and if someone signs in at 8:05 am, it would play ant 9am?
0
 
pepsichrisCommented:
Seeing as the last script worked for you, I updated it for this scenario.

When you say:

new Timer(3600000);

...then the number is the amount of milliseconds to wait. Before then there was a second parameter:

new Timer(30000, 1);

...and that means that it runs once. If you leave that number out, or make it 0, then it will keep repeating forever.

Hope that helps!
var StartTimer:Timer = new Timer(3600000);
 
StartTimer.addEventListener(TimerEvent.TIMER, startMovie);
 
function startMovie(event:TimerEvent):void
{
        Movie.play();
}
 
StartTimer.start();

Open in new window

0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Tackle projects and never again get stuck behind a technical roadblock.
Join Now