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
Custom Alert
Parse CSV File
MPEG Xtra Controller Button
SendAppleEvent
3D games online. Developed with Macromedia Director.
PrintF in Lingo
Slider-Alphamania
Title Bar Color Gradient Effect Behavior
Icon Forge
Making Multiple Animated Buttons
 

 

 

Behavior MostFramesScript

Added on 7/31/2001

 

Compatibilities:
behavior D8

This item has not yet been rated

Author: Ulla (website)

controlls the playhead via mouseposition. Sends message to a sliderbutton to make it indikate the frameposition. Use in connection with "StartFramesScript" + "EndFramesScript" + "PlayheadSlider"

Download PC Source
-- DESCRIPTION --

on getBehaviorDescription me
  return \
    "GO FORWARD OR BACKWARDS" & RETURN & RETURN & \
    "Drop this behavior into the Script Channel on 335 (=2 x (the pixel-length of the slider) +5) frames of the Score." & \
    "Controlls the playhead on mouseposition." & RETURN & RETURN & \
    "makes the sliderbutton indikate the frameposition." & RETURN & RETURN & \
    "Prevents collision with the sliderbehavior." & RETURN & RETURN & \
    "Not tested for compatibility with Java." & RETURN & RETURN & \
    "PARAMETERS: slider, sliderBut, fastDistLeft, slowDistLeft, fastDistRight, fastDistLeft"
end getBehaviorDescription


on getBehaviorTooltip me
  return \
    "Frame behavior. " & \
    "makes the framehead go forward/backwards on mouse near the stageBorders. " & \
    "makes the sliderbutton indikate the frameposition. " & \
    "Prevents collision with the sliderbehavior. " & \
    "Not tested for compatibility with Java."
end getBehaviorTooltip



-- HISTORY --

-- 15. June  2001, written by Ulla Bensby, www.uebweb.dk as an assignment  
-- for Kjell Yngve Petersen, www.boxiganga.dk. ....WARNING! don't work for him without written agreement!
-- Unfortunately, after I've been working (slaving, in fact) for him one whole month, full-time,
-- I asked for an extra 2,5$ fee pr. change of  elements already made according to agreement,
-- and then he fired me without payment. What a shame, he seemed so nice!
-- Hopefully the behaviors can be usefull to someone else


property pDrag, pFrameOffset, stageWidth, sliderBut, fastDistRight, fastDistLeft
property slowDistRight, slowDistLeft, slider, goleftcursor, goRightcursor

on getPropertyDescriptionList
  List= [:]
  addProp list, #sliderBut,\
[#comment: "SpriteNumber of the sliderbutton",\
#format: #integer,\
#default: 50]
  addProp list, #slider,\
[#comment: "SpriteNumber of the slider",\
#format: #integer,\
#default: 49]
  addProp list, #fastDistRight,\
[#comment: "pxDistance from Right stageBorder(the FastForwardarea)",\
#format: #integer,\
#default: 20]
  addProp list, #slowDistRight,\
[#comment: "pxDistance from Right stageBorder(the slowForwardarea's startpoint)",\
#format: #integer,\
#default: 80]
  
  addProp list, #fastDistLeft,\
[#comment: "pxDistance from Left stageBorder(the FastBackwardsarea)",\
#format: #integer,\
#default: 20]
  
  addProp list, #slowDistLeft,\
[#comment: "pxDistance from Left stageBorder(the FastBackwardsarea's startpoint)",\
#format: #integer,\
#default: 80]
  addProp list, #goleftcursor,\
[#comment: "SpriteNumber of the goleftcursor",\
#format: #integer,\
#default: 59]
  addProp list, #goRightcursor,\
[#comment: "SpriteNumber of the goRightcursor",\
#format: #integer,\
#default: 60]
  
  return list
end getPropertyDescriptionList

on beginSprite me
  pDrag = False
  stageWidth = the stageRight - the stageLeft
  sprite(goleftcursor).Loc = point(-24,200)
  sprite(goRightcursor).Loc = point(stageWidth+24,200)
  stop sprite(goLeftcursor)
  stop sprite(goRightcursor)
end
on Drag
  pDrag = True
  
end

on Release
  pDrag = False
end
on exitFrame me
  if pDrag = True then
    sprite(sliderBut).moveableSprite = True
    sprite(sliderBut).constraint=slider
    cursor 290
    sprite(goLeftcursor).loc = point(-24,200)
    sprite(goRightcursor).loc = point(stageWidth+24,200)
    stop sprite goLeftcursor
    stop sprite goRightcursor
    go to the frame
  else
    if pDrag = False then
      Sprite(sliderBut).moveableSprite = False
      pFrameOffset = 173 - the Frame
      sprite(sliderBut).LocH = 360 - pFrameOffset/2
      
      
      
      if (the mouseH > (stageWidth -fastDistRight) and the mouseH < stageWidth) then
        cursor 200
        sprite(goRightcursor).loc = the mouseLoc
        sprite(goRightcursor).play()
        go to the frame +2
      else
        if (the mouseH > (stageWidth -slowDistRight) and the mouseH < (stageWidth -(fastDistRight-1))) then
          cursor 200
          sprite(goRightcursor).loc = the mouseLoc
          sprite(goRightcursor).play()
          go to the frame +1
        else
          if (the mouseH >0 and the mouseH             cursor 200
            sprite(goLeftcursor).loc = the mouseLoc
            sprite(goLeftcursor).play()
            go to the frame -2
          else
            if (the mouseH >fastDistLeft and the mouseH               cursor 200
              sprite(goLeftcursor).loc = the mouseLoc
              sprite(goLeftcursor).play()
              go to the frame -1
            else
              cursor -1
              sprite(goleftcursor).Loc = point(-24,200)
              sprite(goRightcursor).Loc = point(stageWidth+24,200)              
              stop sprite goLeftcursor
              stop sprite goRightcursor
              go to the frame
            end if
          end if
        end if
      end if
    end if
  end if
  
  
end

 


Contact

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

Send e-mail