Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drawing A Rectangle to user specification 1

Status
Not open for further replies.

cobweb

IS-IT--Management
May 5, 2002
95
GB
Hi There:

I work for a Window Making Company and am trying to write a director Movie where the user can key in the height and width of the window they want to order, and it then be drawn as a rectangle on the screen to those dimensions (allowing for scaling). The user will then add the designs etc - as vector images, dragged from a library.
However, all references in Director 7 refer to a rectangle as being a new Movie In A Window.
Is it possible to draw a rectangle to the users specs on the same stage as the specs are keyed?
Is it possible to then scale the drawing (so if bigger than stage halve the dimensions)?
And can I then in theory add a library of designs?
Or am I asking too much of Director?
Or of your time and skills?
Thanks in anticipation !
 
In order to draw a vector shape dynamically, you can use
Code:
vertexList
. The following example creates the vector shape Cast member 4, which is a 200 x 100 pixel rectangle:
Code:
--
if member(4).type <> #vectorShape then
   new(#vectorShape, member(4))
end if
member(4).vertexlist = []
member(4).addVertex(1, point(-100, -50))
member(4).addVertex(1, point(100, -50))
member(4).addVertex(1, point(100, 50))
member(4).addVertex(1, point(-100, 50))
member(4).closed = 1
--

I’m not sure if Director 7 supported vector lingo though. In any case you may want to use Flash instead for your job, Flash requires less scripting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top