13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Handling ev<strong>en</strong>ts<br />

/**<br />

* Sets the time at which the alarm should go off.<br />

* @param hour The hour portion of the alarm time.<br />

* @param minutes The minutes portion of the alarm time.<br />

* @param message The message to display wh<strong>en</strong> the alarm goes off.<br />

* @return The time at which the alarm will go off.<br />

*/<br />

public function setAlarm(hour:Number = 0, minutes:Number = 0, message:String = "Alarm!"):Date<br />

{<br />

this.alarmMessage = message;<br />

var now:Date = new Date();<br />

// Create this time on today's date.<br />

alarmTime = new Date(now.fullYear, now.month, now.date, hour, minutes);<br />

}<br />

// Determine if the specified time has already passed today.<br />

if (alarmTime

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!