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
File Save Dialog Behavior
Stop Projector After Eject CD
Puzzler II - Slide Puzzle
Photo Caster
Toggle Stay On Top-Button
Message Box Behavior
Type Writer Fonts
Add a unique property to a property list
Flashation Flash Menu Builder
VSnap
 

 

 

Behavior Image skew in projectors

Added on 8/29/1999

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: MediaMacros (website)

This behavior allows you to have 4 "handle" sprites that the end user can use to skew images in a projector or shockwave file

--Copyright 1999 Chuck Neal
--chuck@mediamacros.com
--If you find this code helpful, send me an e-mail and let me know.  :-)

property whichItem, spriteNum, whichPoint, quadList

global activeSprite

on getPropertyDescriptionList me
  p_list = [:]
  p_list.addProp(#whichItem, [#format : #symbol, #comment : "Control point or object?", #default : #point, #range : [#point, #object, #background]])
  return p_list
end

on editQuad me
  if whichItem = #point then
    sprite(spriteNum).loc = sprite(activeSprite).quad[whichPoint]
    
  end if
end

on hidePoints me
  if whichItem = #point then
    sprite(spriteNum).loc = point(-1000, -1000)
  end if
end

on mouseDown me
  if whichItem = #point then
    repeat while the stillDown
      sprite(spriteNum).loc = the mouseLoc
      sendSprite(activeSprite, #rescaleQuad, whichPoint, sprite(spriteNum).loc)
    end repeat
  end if
end

on beginSprite me
  if whichItem = #point then
    whichPoint = (spriteNum mod 4) + 1
    sprite(spriteNum).loc = point(-1000,-1000)
  else
    quadList = sprite(spriteNum).quad
  end if
end

on rescaleQuad me, whatHandle, whatPoint
  quadList.setAt(whatHandle, whatPoint)
  sprite(spriteNum).quad = quadList
  updateStage
end

on mouseUp me
  if whichItem = #object then
    activeSprite = spriteNum
    sendAllSprites(#editQuad)
  else if whichItem = #background then
    sendAllSprites(#hidePoints)
  end if
end

on getBehaviorDescription me
  return "For this behavior you will need 4 small " & quote & "handle" & quote & " sprites and at least one image, text, or shape sprite.  Drop the behavior on the points, the object and on a background sprite.  When you click an object the handles will jump into place and draging them will skew and scale the image.  Click the background the hide the handles off screen."
end

 


Contact

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

Send e-mail