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
Set actionsEnabled Property of a Flash Member
Image Flood Fill (Using getPixel and setPixel)
Easy Navigation System
Installer Vise
Xtra Safe
ScreenFade
Lissajous Motion
Indeo 5 Codec
Attr
QTGrab
 

 

 

Behavior Vector Shapes - Create Donut

Added on 2/7/2006

 

Compatibilities:
D8 D8_5 D9 Mac PC

This item has not yet been rated

Author: Chunick (website)

This custom behavior returns a vertexList of a donut shape. the outRad defines the outer radius and the inRad defines the inner radius (the hole of the donut).

on createDonut(outRad, inRad)
  vertList = []
  rXY1 = outRad * 0.552284749830794
  rXY2 = inRad * 0.552284749830794
  vertList1 = [[#vertex: point(0, -outRad), #handle1: point(rXY1, 0), #handle2: point(-rXY1, 0)], [#vertex: point(outRad, 0), #handle1: point(0, rXY1), #handle2: point(0, -rXY1)], [#vertex: point(0, outRad), #handle1: point(-rXY1, 0), #handle2: point(rXY1, 0)], [#vertex: point(-outRad, 0), #handle1: point(0, -rXY1), #handle2: point(0, rXY1)]]
  repeat with i in vertList1
    vertList.add(i)
  end repeat
  
  vertList.add([#newCurve])
  
  vertList2 = [[#vertex: point(0, -inRad), #handle1: point(rXY2, 0), #handle2: point(-rXY2, 0)], [#vertex: point(inRad, 0), #handle1: point(0, rXY2), #handle2: point(0, -rXY2)], [#vertex: point(0, inRad), #handle1: point(-rXY2, 0), #handle2: point(rXY2, 0)], [#vertex: point(-inRad, 0), #handle1: point(0, -rXY2), #handle2: point(0, rXY2)]]
  
  repeat with i in vertList2
    vertList.add(i)
  end repeat
  
  return vertList
end

 


Contact

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

Send e-mail