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
Wait for cuePoint behavior
WebCamXtra - Computer Vision & Camera Tracking
Fix Bad Scripts
Custom Alert
CatEffects pack
XML Parser List Converter
Simatrix Menu
Simatrix Lingo Font
CD Autorun
Delet an Existing File
 

 

 

Behavior Simatrix Menu

Added on 7/8/2001

 

Compatibilities:
behavior D7 D8 Mac Shockwave

This item has not yet been rated

Author: simatrix (website)

Click and hold to drop down the menu, then select the voice you want. Double-click everywhere to move the whole menu.

Download PC Source
-- SIMATRIX MENU Behavior
-- the menu voices follow the double_click and slow down

-- 01/07/2001
-- simatrix@libero.it  www.baboni.com
-- example shocked movie at http://www.baboni.com/simatrixMenu/simatrixMenu.htm

-- Instructions: drop the "Simatrix Menu behavior" to the Menu Label sprite.
-- Put the other 3 voices in the right order in the channels below.
-- If you want a rollover effect on the Menu Label:
-- dispose a rollover member in the slot
-- after the one that contains the Menu Label.
-- If you do not want a rollover effect on the Menu Label:
-- delete the lines of code in the mouseEnter and mouseLeave handler
-- For the voices of the menu attach them the behaviors you want,
-- such as "rollover member change" of the behavior library/animation/interactive
-- and any other navigation behaviors.


property my, myMember, myMemberRollover
property  ptempo
property  Voice01, voice02, voice03
Property  over

on beginSprite me
  my = sprite(me.spriteNum)
  
  voice01 = sprite(me.SpriteNum - 1)
  voice02 = sprite(me.SpriteNum - 2)
  voice03 = sprite(me.SpriteNum - 3)
  
  
  pTempo = 10
  
  -- delete the next 2 line of code if you do not want a rollover effect
  myMember = (sprite me.spriteNum).member
  
  myMemberRollover = member(myMember.number + 1)
  
end






on mouseEnter me
  -- delete the next line of code if you do not want a rollover effect
  (sprite my).member = myMemberRollover
end

on mouseLeave me
  -- delete the next line of code if you do not want a rollover effect
  (sprite my).member = myMember
end

on mouseDOwn me
  over = 1
end

on mouseUp me
  over = 2
end
on mouseUpOutside me
  over = 2
end


on exitFrame me
  if the doubleClick then
    over = 3
  else
    my.loc = my.loc
    
  end if
  case over of
      
    1: menuDown  
    2: menuUp
    3: start
  end case
  
  
end




on start
  
  ---- The Menu Label goes to the double-click point ----
  
  CurrentLoc = my.loc
  
  speed = ( the clickLoc - currentLoc)/ptempo/0.5
  
  my.loc = my.loc + speed
  
  
  ---- First Voice follows the Menu Label ----
  
  voice01Loc = voice01.loc
  
  speed01 = (the clickLoc - voice01loc)/ptempo*0.6
  
  voice01.loc = voice01.loc + speed01
  
  ---- Second Voice follows the first one ----
  
  pLag = (random(2) + 1) * .1
  
  voice02loc = voice02.loc
  
  diff02 = (voice01loc - voice02loc)
  
  voice02.loc = voice02loc + diff02 *pLag
  
  ---- Third Voice follows the second one ----
  
  
  voice03loc = voice03.loc
  
  diff03 = (voice02loc - voice03loc)
  
  voice03.loc = voice03loc + diff03 *pLag
  
  
  
end


on menuDown
  
  -- vertical distance between the voices
  distance = 22 -- change this value if needed
  
  ---------------- voice 01 goes down ---------
  
  if voice01.locV < my.locV + distance then
    voice01.locV = voice01.locV + pTempo*0.5
  end if
  
  if voice02.locV < voice01.locV + distance then
    voice02.locV = voice02.locV + pTempo*0.4
  end if
  if voice03.locV < voice02.locV + distance then
    voice03.locV = voice03.locV + pTempo*0.3
  end if
  
  
end

on menuUp
  
  ---------------- voice 01 goes up ---------
  if voice01.locH > my.locH  then
    voice01.locH = voice01.locH - pTempo*0.4
  end if
  
  if voice01.locH < my.locH  then
    voice01.locH = voice01.locH + pTempo*0.4
  end if
  
  
  if voice01.locV > my.locV  then
    voice01.locV = voice01.locV - pTempo*0.5
  end if
  
  if voice01.locV < my.locV  then
   voice01.locV = voice01.locV + pTempo*0.5
  end if
  
  
  ---------------- voice 02 goes up ---------
  
  if voice02.locH > my.locH  then
    voice02.locH = voice02.locH - pTempo*0.4
  end if
  
  if voice02.locH < my.locH  then
    voice02.locH = voice02.locH + pTempo*0.4
  end if
  
  if voice02.locV > my.locV  then
    voice02.locV = voice02.locV - pTempo*0.4
  end if
  
  if voice02.locV < my.locV  then
    voice02.locV = voice02.locV + pTempo*0.4
  end if
  --------------- voice 03 goes up ---------
  
  if voice03.locH > my.locH  then
    voice03.locH = voice03.locH - pTempo*0.4
  end if
  
  if voice03.locH < my.locH  then
    voice03.locH = voice03.locH + pTempo*0.4
  end if
  
  if voice03.locV > my.locV  then
    voice03.locV = voice03.locV - pTempo*0.3
  end if
  
  if voice03.locV < my.locV  then
    voice03.locV = voice03.locV + pTempo*0.3
  end if
  
  
end

 


Contact

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

Send e-mail