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
Cursors
sound volum
ECTI Editor
selling|sound - royalty free music
Check valid date
eCommerce Xtra 1.5
Clipboard Xtra
changing the color of a flash movie clip with lingo
Preload within Markers v.BETA
JTMR Digital Painter
 

 

 

Behavior Elliptical Sprite Behavior

Added on 7/7/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: ChristianKrauter

Attached to a sprite it will move the sprite on a elliptical Path with your coordinates to adjust the elliptical Path and steps

-- copywrite christian krauter
-- free to use for all regular MediaMacros visitors
-- if you have any comments pls email me
-- christian@simplicityhq.com

-- Elliptical Sprite Behavior

property pCenterX, pCenterY, pAxisX, pAxisY, pSteps, pStepSize, pTheta

on getPropertyDescriptionList me
  list = [:]
  addProp list, #pCenterX, [#comment:"Center x", #format: #integer, #default:(the stageRight - the stageLeft)/2]
  addProp list, #pCenterY, [#comment: "Center y", #format: #integer,#default:(the stageBottom - the stageTop)/2]
  addProp list, #pAxisX, [#comment: "Radius x", #format: #integer,#default:(the stageRight - the stageLeft)/4]
  addProp list, #pAxisY, [#comment: "Radius y", #format: #integer,#default:(the stageBottom - the stageTop)/4]
  addProp list, #pSteps, [#comment: "Steps per rotation", #format: #integer,#default: 30]
  return list
end

on beginSprite me
  pStepSize = (2 * pi) / pSteps
  pTheta = 0
end

on exitFrame me
  x = pAxisX * sin(pTheta) + pCenterX
  y = pAxisY * cos(pTheta) + pCenterY
  sprite(me.spriteNum).loc = point (x, y)
  pTheta = pTheta + pStepSize
end  

 


Contact

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

Send e-mail