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
cXtraShapeWindow
Type Writer Fonts
Director and online database interaction
Lingo and Shockwave Sourcebook
StarMenu Xtra
MPEG / ActiveMovie ActiveX control
Orbital Slave
Increasing the effeciency of playback
Scroll Text With Mouse
cXtraComboBox
 

 

 

Behavior True/Flase Properties of a Vector Cast Member

Added on 6/13/2000

 

Compatibilities:
behavior D7 D8 Mac Shockwave

Rating:

Author: KumarK

True/Flase Properties of a Vector Cast Member

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

--- Custom Properties ---
property sourcemember,WhereTo,AntialiasProp,BroadcastProp,CenterregProp,ClosedProp,DirecttostageProp,ImageenabledProp

--- 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,#AntialiasProp,[#comment:"Set AntiAlias property Of Vector Member To :",#format:#boolean,#default:True]
  addprop descriptionlist,#BroadcastProp,[#comment:"Set BroadcastProps property Of Vector Member To :",#format:#boolean,#default:True]
  addprop descriptionlist,#CenterregProp,[#comment:"Set centerRegPoint property Of Vector Member To :",#format:#boolean,#default:True]
  addprop descriptionlist,#ClosedProp,[#comment:"Set Closed property Of Vector Member To :",#format:#boolean,#default:True]
  addprop descriptionlist,#DirecttostageProp,[#comment:"Set DirectToStage property Of Vector Member To :",#format:#boolean,#default:True]
  addprop descriptionlist,#ImageenabledProp,[#comment:"Set ImageEnabled property Of Vector Member To :",#format:#boolean,#default:True]
  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 Sets all the True/False Properties of Vector Cast member " & RETURN & RETURN & \
  "Parameters" & RETURN & \
  "* Source Vector Cast member." & RETURN & \
  "* True/False." & RETURN & \
  "* Where to attach this Script"
end
-- Get Behavior description --

-- events --
on mouseUp me
  if WhereTo="Mouse Up" then
    SetTrueFalse
  end if
end

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

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

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

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

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

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

-- events --

-- custom handlers --
on SetTrueFalse
  if member(sourcemember).type = #vectorShape then
    member(sourcemember).antiAlias = AntialiasProp
    member(sourcemember).broadcastProps = BroadcastProp
    member(sourcemember).centerRegPoint = CenterregProp
    member(sourcemember).closed = ClosedProp
    member(sourcemember).directToStage = DirecttostageProp
    member(sourcemember).imageEnabled = ImageenabledProp
  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