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
Tristate button with caption
Wait for a Keypress
Set Volume - Buddy API
Dervich Pivot Xtra
Dragging multiple sprites
asUDP
CPS Audio/MIDI Xtra
Image Magnify
Deleting a range of frames
AppActive
 

 

 

Behavior Set Stroke properties

Added on 6/13/2000

 

Compatibilities:
behavior D7 D8 Mac Shockwave

This item has not yet been rated

Author: KumarK

Set Stroke properties

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

--- Custom Properties ---
property sourcemember,WhereTo,StrokeWidth,strokeR,StrokeG,StrokeB

--- 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,#StrokeWidth,[#comment:"Set Stroke Width Of Vector Member To :",#format:#Integer,#range:[#min:1,#Max:100],#default:1]
  addprop descriptionlist,#strokeR,[#comment:"Set Stroke Color(Red Value) To :",#format:#Integer,#range:[#min:0,#Max:255],#default:255]
  addprop descriptionlist,#StrokeG,[#comment:"Set Stroke Color(Green Value) To :",#format:#Integer,#range:[#min:0,#Max:255],#default:255]
  addprop descriptionlist,#StrokeB,[#comment:"Set Stroke Color(Blue Value) To :",#format:#Integer,#range:[#min:0,#Max:255],#default:255]  
  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 Stroke Properties of Vector Cast member " & RETURN & RETURN & \
  "Parameters" & RETURN & \
  "* Source Vector Cast member." & RETURN & \
  "* Stroke width." & RETURN & \
  "* RGB values for Stroke Color." & RETURN & \
  "* Where to attach this Script"
end
-- Get Behavior description --

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

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

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

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

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

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

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

-- events --

-- custom handlers --
on SetStorkeProp
  if member(sourcemember).type = #vectorShape then
    member(sourcemember).strokeWidth=strokeWidth
    member(sourcemember).StrokeColor=rgb(StrokeR,StrokeG,StrokeB)
  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