Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Quiz engine
Direct SMS Review
Windows NT and Audio
Find CD Drives letter quikly
Send OSA Script
Light Up
Setup Anim
Arca Database Xtra
Vector Shape - Create Star
Check valid date
 

 

 

Behavior Expire date

Added on 4/4/2001

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

Rating:

Author: ChristianKrauter

Put in your expire date and returns an alert if true - very easy to adjust!!!

-- ) christian krauter
-- free to use for mediamacros readers
-- drop me an email if any suggs or useful

property pmyExpYear, pmyExpMonth, pmyExpDate

on getPropertyDescriptionList me
  props = [:]
  props.addProp(#pmyExpYear, [#format: #integer, #default: 2001, #comment: "Enter the expire year as number:"])
  props.addProp(#pmyExpMonth, [#format: #integer, #default: 3, #comment: "Enter the expire month as string:"])
  props.addProp(#pmyExpDate, [#format: #integer, #default: 3, #comment: "Enter the expire month as number:"])
  return props
end


on exitFrame me
  -- set expire to false
  expire = FALSE  
  -- today's year month day    
  thisyear = (the long date).item[2].word[3]
  thismonth = (the long date).item[2].word[2]
  thisday = (the long date).item[2].word[1]
  
  -- return today's month as integer for later computing
  if thismonth = "January" then
    thismonth = 1
  else if thismonth = "Februar" then
    thismonth = 2
  else if thismonth = "March" then
    thismonth = 3
  else if thismonth = "April" then
    thismonth = 4
  else if thismonth = "May" then
    thismonth = 5
  else if thismonth = "June" then
    thismonth = 6
  else if thismonth = "July" then
    thismonth = 7
  else if thismonth = "August" then
    thismonth = 8
  else if thismonth = "September" then
    thismonth = 9
  else if thismonth = "October" then
    thismonth = 10
  else if thismonth = "November" then
    thismonth = 11
  else if thismonth = "December" then
    thismonth = 12
  end if    
  -- compares today's date values with the your data properties
  if thisyear > pmyExpYear then
    expire = TRUE
  else if thisyear = pmyExpYear then
    if thismonth > pmyExpMonth then
      expire = TRUE
    else if thismonth = pmyExpMonth and thisday >= pmyExpDate then
      expire = TRUE
    end if
  end if
  
  -- if expire returns true  excute your code here
  if expire = TRUE then
    alert "Sorry this program has expired on"&&pmyExpYear&&pmyExpMonth&&pmyExpDate
  end if
  
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail