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
QuickTime Installer
Easy Dialog
Open File WIth Associated Application
Custom Projector Icon
Format Image
Hierarchcal Menu using Imaging Lingo
castLib.saveAndCompact() from Lingo
Xtra Checker
Full control of sprite
Image Mover
 

 

 

Behavior PopUp Menu Behavior

Added on 6/30/1999

 

Compatibilities:
behavior D6_5 D7 D8 Mac PC

This item has not yet been rated

Author: AlexZavatone

Popup behavior.

-- Popup Text Menu behavior.  © Zav "1997

property pActiveSprite, pPopupCastName

on mouseDown me
  set pPopupCastName = "fonts"
  PopupMouseDown me
  return
end


on PopupMouseDown me --popupCastName
  --  put the clickon
  set lastChar = the number of chars in field pPopupCastName + 1
  set mySprite = the spriteNum of me
  set pActiveSprite = mySprite
  set myCast = the castnum of sprite mySprite
  puppetsprite mySprite, 1
  set the castnum of sprite mySprite = the number of cast
pPopupCastName
  updatestage
  hilite line the mouseline of field pPopupCastName
  set myLine = the mouseline

  -- highlight detection. Thanks Mark Shepherd
  repeat while the mouseDown
    if mySprite > 0 then
      if rollover(mySprite) then
        if myLine <<> the mouseLine  then
          set myLine = the mouseline
          if myLine > 0 then hilite line myLine of field
pPopupCastName
        end if

      else
        if myLine <<> 0 then
          set myLine = 0
          hilite char lastChar of field pPopupCastName
        end if
      end if        
    end if
  end repeat

  -- here we handle what to do on  mouseUp
  set the castnum of sprite pActiveSprite = myCast
  puppetsprite pActiveSprite, 0
  updatestage

  if myLine > 0 then
    -- insert stuff here to do things on mouse up
  end if

end


on DoDelay seconds
  set now = the timer
  startTimer
  repeat while now + seconds * 60 > the timer
  end repeat
end


on GetBehaviorDescription
  return "Turns what you mousedown on into a text popup menu.  
Fun for the whole family.  The text member to use as the popup list is
specified in pPopupCastName in the MouseDown handler - Zav"
end  

 


Contact

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

Send e-mail