PDA

View Full Version : Moving an Image with the Macro Move Command


peterich8
03-18-2009, 03:42 PM
I am having problems getting a image to move with a macro. I am using the following code (courtesy Yahoo’s Chyron Duet Designers Group) to automatically space out my templates:


change = 20

set templatep = ActiveCanvas.Scene.SelectedTemplate(0)
templatep.UseTemplateRect = false
templatebottom = templatep.Rect.Bottom


set templatep = ActiveCanvas.Scene.SelectedTemplate(1)
delta = templatebottom - templatep.Rect.Top + change
templatep.Move 0, delta, -1, true

I have taken it out of the recursive style that is on Yahoo because I also want to use the “Move” command to move a bullet point (image) relative to the first line of the next template using the bottom coordinates of the previous template much like the template. The catch is that I need the bullet point to animate down – to the correct place – on the screen for each template field as it is revealed so I can’t just template the bullet point as a character. And I can’t use the normal kfYPos because the templates are random lengths.

I have written this code at the end of the above code:

ActiveCanvas.Scene.Select "DudeYellowSml"
set bbb = ActiveCanvas.Scene.ActiveObject
aaa = templatebottom - templatep.Rect.Top + change
bbb.Move 0, aaa, 30, true

I get the following error:

Error executing macro: 0x800a01b6
Object doesn't support this property or method: 'bbb.Move'
at Shot Box line: 20 [bbb.Move 0, aaa, 30, true]
at Source line: -1

So obviously I am not doing something right in the preceding lines of code to correctly identify the Object (image DudeYellowSml). From what I have read in LIEF help it seems that I can use Move on an image but I may be wrong.

What am I doing wrong and how do I fix it?

Chyron Spock
03-18-2009, 04:41 PM
ActiveObject returns the node from which you need to get the element on the node.

set bbb = ActiveCanvas.Scene.ActiveObject.Element(0)

peterich8
03-26-2009, 01:32 PM
Thank you. It is all working now.

Chyron Spock
03-26-2009, 03:20 PM
You're welcome.