Button vs. Message box scripts; P.S. Invert matrices?

Alejandro Tejada capellan2000 at yahoo.com
Sat Mar 29 23:35:01 EST 2003


on Fri Mar 28 09:55:01 2003
Jim Hurley wrote:

>I ran the following single line in the msg box:
>revrotatepoly graphic "MyPoly", 90
>and sure enough, the graphic "MyPoly" rotated 90 
>degrees.
>But the button handler:
>On mouseUp
>revrotatepoly graphic "MyPoly", 90
>end mouseUp
>return an error: "Chunk source is not a container."
>Why is it that the msg box can find the graphic 
>but the button cannot?

My guess is that this function is using the
selectedobject as argument, so probably if
you script first "select graphic number X"
it would work. I don't have RunRev installed
in this machine to test now. 

>P.S. I don't suppose anyone has a routine to 
>invert matrices?

Actually, I do. If you can wait until tomorrow,
I can clean it a bit and upload to some place.

Using matrices for scaling, rotating and skewing
polygonal graphics is extraordinarly exact.

You can transform the graphics as many times as
you wish and always can retrace your steps to
get the original graphic.

The key for the exactitude of all these operations
is to hold the exact values returned by these
operations in a custom property of the graphic.
I've called this property the "exactPoints"
and is get BEFORE every operation and set AFTER the
operations are done. Of course, if the exactPoints
of a graphics is empty then is necesary to use
the points, but only one time, because all operations
create and set this custom property in the graphic.

Serious graphic users will love to use matrices 
for rotating, skewing and scaling polygon graphics.

Alejandro

=====
Useful sites:
http://www.sonsothunder.com/devres/metacard/tips/ and /revolution/tips/
http://lists.runrev.com/pipermail/metacard/ and /use-revolution/
http://wiki.macitworks.com/revdocs
http://www.google.com/advanced_search?q=site:lists.runrev.com

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com



More information about the use-livecode mailing list