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
Get properties in a range of castmembers
Interactive Flash File Behavior
Dryclean
Open Help File
Ripple Follow Sprite-Alphamania
Director 7 and Lingo Authorized
cXtraTwain
Cursor trails
Sprite Blender - Distance
ZGTSB-TextInteractivity
 

 

 

Behavior Change FillCycles Continuously

Added on 6/13/2000

 

Compatibilities:
behavior D7 D8 Mac Shockwave

This item has not yet been rated

Author: KumarK

Change FillCycles Continuously

---- written for Director 8 ---
---- Kumar.K kumark@icode.com ----

--- Custom Properties ---
property sourcemember,WhereTo,Fillcycles,Gradtype

--- Get Behavior Description List ---
on getPropertyDescriptionList me
  VectorMembersList=searchVectorMember (me)
  descriptionlist = [:]
  spriteassignlist=["Mouse Up","Mouse Down", "Mouse Enter","Mouse Leave","Mouse Within"]
  frameassignlist=["Exit Frame","Enter Frame"]
  if VectorMembersList.count > 0 then
    addprop descriptionlist,#sourcemember,[#comment:"Source Vector Shape Cast member :",  \
    #format:#String,#range:VectorMembersList,#default:VectorMembersList[1]]
  else
    addprop descriptionlist,#sourcemember,[#comment:"Source Vector Shape Cast member :",#format:#Graphic,#default:1]
  end if
  addprop descriptionlist,#Gradtype,[#comment:"Select Gradient Type :",#format:#string,#range:["Linear","Radial"],#default:"Linear"]
  if the currentspritenum <> 0 then
    addprop descriptionlist, #WhereTo, [#comment:"Where To Assign this Script ?", #format:#String,#range:spriteassignlist,#default:spriteassignlist[1]]
  else
    addprop descriptionlist, #WhereTo, [#comment:"Where To Assign this Script ?", #format:#String,#range:frameassignlist,#default:frameassignlist[2]]
  end if  
  return descriptionlist
end getPropertyDescriptionList
--- Get Behavior Description List ---


-- Get Behavior description --
on getBehaviorDescription
  return "This Behavior Continuously changes the FillCycle " & RETURN & RETURN & \
  "Parameters" & RETURN & \
  "* Source Vector Cast member." & RETURN & \
  "* GradientType." & RETURN & \
  "* Where to attach this Script"
end
-- Get Behavior description --

-- events --
on beginsprite
  fillcycles=1
end

on mouseUp me
  if WhereTo="Mouse Up" then
    SetFillCycles
  end if
end

on mouseDown me
  if WhereTo="Mouse Down" then
    SetFillCycles
  end if
end

on mouseEnter me
  if WhereTo="Mouse Enter" then
    SetFillCycles
  end if
end

on mouseLeave me
  if WhereTo="Mouse Leave" then
    SetFillCycles
  end if
end

on enterframe
  if WhereTo="Enter Frame" then
    SetFillCycles
  end if
end

on ExitFrame
  if WhereTo="Exit Frame" then
    SetFillCycles
  end if
end

on mousewithin
  if WhereTo="Mouse Within" then
    SetFillCycles
  end if
end

-- events --

-- custom handlers --
on SetFillCycles
  if member(sourcemember).type = #vectorShape then
    if fillcycles=17 then
      fillcycles=1
    else
      fillcycles=fillcycles+1
    end if
    member(sourcemember).fillMode=#Gradient
    case Gradtype of
      "Linear":member(sourcemember).gradientType=#linear
      "Radial":member(sourcemember).gradientType=#Radial
    end case
    member(sourcemember).fillcycles=fillcycles  
  end if
end
-- custom handlers --

------ Availbale for both Frame & Sprite Script ------
on isOKToAttach (me, aSpriteType, aSpriteNum)
  case aSpriteType of
    #graphic:
      return true
    #script:
      return True
  end case
end isOKToAttach
------ Availbale for both Frame & Sprite Script ------

------ Search for Vector Member ------
on searchVectorMember me
  VectorMembersList = []
  maxCastLib = the number of castLibs
  repeat with theCastLib = 1 to maxCastLib
    maxMember = the number of members of castLib theCastLib
    repeat with memberNumber = 1 to maxMember
      theMember = member(memberNumber, theCastLib)
      if theMember.type = #vectorShape then
        if theMember.name = EMPTY then
          VectorMembersList.append(theMember)
        else
          VectorMembersList.append(theMember.name)
        end if
      end if
    end repeat
  end repeat
  return VectorMembersList
end
------ Search for Vector Member ------  

 


Contact

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

Send e-mail