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
Star Parent Script
Rescale Image
Regular expressions
Interactive Flash File Behavior
OpenDBC
Flash Component Label
Animated Cursor
Set PlayBackMode Property of a Animated Gif Cast Member
Checking an open database - Valentina
A Simple Back Button
 

 

 

Behavior Button Factory

Added on 7/8/1999

 

Compatibilities:
behavior D6_5 D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: Penworks (website)

Creates a button that scrolls left or right when clicked, to display text. Reproduced with permission from Penworks Lingo User"s Journal

property memberListField

property face
property forwardList
property backwardList


on beginSprite me
  set face = 1  
  createLists me
  return me
end

on mouseUp me
  if the mouseH < the locH of sprite the spriteNum of me then
    animate me, #forward
  else animate me, #backward
end

on animate me, whichWay
  puppetSprite 1, TRUE
  if whichWay = #forward then
    set memberLIst to getAt (forwardList, face)
    set face to face + 1
    if face > count (forwardList) then
      set face to 1
    end if
  else
    set memberLIst to getAt (backwardList, face)
    set face to face - 1
    if face = 0 then set face to count (forwardList)
  end if
  repeat with theMember in memberList
    set the member of sprite the spriteNum of me to theMember
    set delay = the ticks + 5
    repeat while the ticks < delay
    end repeat
    updateStage
  end repeat
end animate

--on createLists me
--  -- FORWARD BUTTON:
--  set list1 = [1, 2, 3, 4, 5, 6, 7]
--  set list2 = [7, 8, 9, 10, 11, 12, 13]
--  set list3 = [13, 14, 15, 16, 17, 18, 1]
--  set forwardList = [list1, list2, list3]
--  -- BACKWARD BUTTON
--  set list1 = [1, 18, 17, 16, 15, 14, 13]
--  set list2 = [7, 6, 5, 4, 3, 2, 1]
--  set list3 = [13, 12, 11, 10, 9, 8, 7]
--  set backwardList = [list1, list2, list3]
--end createLists

on createLists me
  set memberList = value (field memberListField)
  set forwardList  = getProp (memberList, #forwardList)
  set backwardList = getProp (memberList, #backwardList)
end createLists

on face
  return face
end

on getPropertyDescriptIonList
  set propDesc = [:]
  --  set defaultField = the number of member "Revolving button list"
  set defaultField = "Revolving button list"
  addProp propDesc, #memberListField, ¬
  [¬
#comment:  "Field member containing the list"&RETURN&" of members for this button:",¬
#format:   #string, ¬
#default: defaultField ¬
  ]
  return propDesc
end

 


Contact

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

Send e-mail