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
Cutting Puzzle Pieces
JTMR Image to Text
Special Edition Using Macromedia Director 8.5
Copy Text - Non Editable Fields & Shockwave
FreeRegEdit
Super Goo
GetInfoFromAIFF
Image Magnify
Preload within Markers v.BETA
MUI Designer
 

 

 

Behavior Cycle Fades of Images and Text

Added on 7/27/2004

 

Compatibilities:
D7

This item has not yet been rated

Author: dan_au

This behavior cycles (indefinately) fading images and accompanying text (optional). Place the images in the score in sequence and enter the first and last sprite numbers, do the same for the text. Then indicate how long between each fade. You need to attach Macromedias "Fade In/Out" script to the images and text. Select "Fade In" and activate by "message". Then add this handler to the "Fade In/Out" behavior. on mFadeoutActivate me pFaded = #out if pAuto = #message then mActivate me end mFadeoutActivate any probs or feedback email me danc222@hotmail.com

property fadetextList, fadeList, runFades, timeElapsed, firstRun, timeKeeper
property firstSprite, LastSprite, checkText, firstTextsprite, lastTextsprite, waitTime
on beginSprite me
  getFadeList
  firstRun = 1
  runFades = 0
  timeKeeper = 0
  timerElapsed = 0
end

on getFadeList
  fadeList = []
  fadetextList = []
  repeat with i = firstSprite to lastSprite
    fadeList.add(i)
  end repeat
  fadeList.add(fadeList[1])
  fadeList.deleteAt(1)
  if checkText = TRUE then
    repeat with i = firsttextSprite to lasttextSprite
      fadetextList.add(i)
    end repeat
    fadetextList.add(fadetextList[1])
    fadetextList.deleteAt(1)
  end if
end

on endSprite me
  runFades = 0
end

on exitFrame me
  if firstRun then
    sendSprite (firstSprite, #mFadeActivate)
    if checkText = TRUE then
      sendSprite (firstTextSprite, #mFadeActivate)
    end if
    firstRun = 0
    runFades = 1
    timeKeeper = the milliseconds
  end if
  if runFades then
    timeElapsed = ((the milliseconds) - timeKeeper)
    if timeElapsed > (waitTime * 1000) then
      sendsprite((fadeList[fadeList.count]), #mfadeOutactivate)
      sendsprite((fadeList[1]), #mfadeactivate)
      fadeList.append(fadeList[1])
      fadeList.deleteAt(1)
      if checkText = TRUE then
        sendsprite((fadetextList[fadetextList.count]), #mfadeOutactivate)
        sendsprite((fadetextList[1]), #mfadeactivate)
        fadetextList.append(fadetextList[1])
        fadetextList.deleteAt(1)
      end if
      timeKeeper = the milliseconds
    end if
  end if
  go to the frame
end

on getPropertyDescriptionList (me)
  props = [:]
  props[#firstSprite] = [
     #comment: "First image:",
     #format: #integer,
     #default: 1]
  props[#lastSprite] = [
     #comment: "Last image:",
     #format: #integer,
     #default: 2]
  props[#checkText] = [
     #comment: "Any text?:",
     #format: #boolean,
     #default: FALSE]
  props[#firstTextSprite] = [
     #comment: "First text:",
     #format: #integer,
     #default: 0]
    props[#LastTextSprite] = [
     #comment: "Last text:",
     #format: #integer,
     #default: 0]
  props[#waitTime] = [
     #comment: "Time between transitions (seconds):",
     #format: #integer,
     #default: 6]
  return props
end getPropertyDescriptionList

 


Contact

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

Send e-mail