Hello All
Generating a shape from a behavior, I got a script working with the help
of Brennan Young:
------------
on createShape me, aName, aShapeType, aFilled, aPattern, aRect,
aLineSize
--syntax:>>createShape(me, string(memberName), symbol(shapeType),/
--boolean(filled), integer(pattern), rect(rect), integer(lineSize)<<
if member(aName).name = "" then --not in cast already
mem = new(#shape)
mem.name = aName
mem.shapeType = aShapeType
mem.filled = aFilled
mem.pattern = aPattern
mem.rect = aRect
mem.lineSize = aLineSize
else
mem = member(aName)
end if
puppetSprite (20), TRUE
sprite(20).member = mem
sprite(20).loc = point(10, 10)
sprite(20).color = rgb (0, 255, 0)
sprite(20).width = 50
sprite(20).height = 50
end
on endSprite me
puppetSprite (20), FALSE
end
------------
If I call the script from within the behavior, it works fine:
------------
on mouseDown me
createShape(me, "shape1", #rect, TRUE, 1, rect(0,0,50,50), 1)
end
------------
However, if I change the "aFilled" argument, it doesn't.
------------
on mouseDown me
createShape(me, "shape2", #rect, FALSE, 1, rect(0,0,50,50), 1)
end
------------
The movie WILL NOT SHOW a nonfilled shape generated with this code.
That's a drag, but now for the wierd stuff:
*If I stop the movie and drag the newly created member on stage (having
deleted the member before I started the movie, to ensure that it IS the
newest version), it shows a nice nonfilled rectangle.
*If I create a Filled shape (1st mouseDown-handler), it shows on stage.
Fine. If I then change its Filled property from the Message window -
member("shape1").filled = 0 --or FALSE
-it disappears! This is not the case with shapes created with the
Toolbox widget.
I'm using D8 win98.
Can anyone confirm/explain?
Regards,
Clars
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]