You are not logged in.

1

Friday, July 16th 2010, 10:56am

Math operations

Hi,

Is there an easiest way to do mathematical operations than using functions add, sub, mul and div ?

A simple exemple of what I want to do :

add(st_opt.first_x,st_opt.x,st_opt.half_width);
mul(st_opt.first_x,st_opt.first_x,2);
sub(st_opt.first_x,st_opt.first_x,st_opt.control_width);
sub(st_opt.first_x,st_opt.first_x,tmp_half_thumb_width);

Is there a way to do something like :
set(st_opt.first_x, eval(2 * (st_opt.x + st_opt.half_width) - st_opt.control_width - tmp_half_thumb_width));

Another thing I was asking me is : is there a way to specify my own basedir (not like %CURRENTXML% but a real path) ?

Thank

A.L.

2

Monday, July 19th 2010, 11:01am

Hi,

no, but with the latest version, the math actions can also be used just with two parameters,
(see the releasenotes.txt)

e.g. this would reduce the code to this:

Source code

1
2
3
4
add(st_opt.first_x, st_opt.x, st_opt.half_width);
mul(st_opt.first_x, 2);
sub(st_opt.first_x, st_opt.control_width);
sub(st_opt.first_x, tmp_half_thumb_width);


best regards,
Klaus

adamsheha2

Beginner

Posts: 14

Location: baton rouge, LA

Occupation: Economist

  • Send private message

3

Monday, July 19th 2010, 8:26pm

Math Operations

Maybe a stupid question ( Isn't that always how they start) but when would you use these functions?

4

Thursday, July 22nd 2010, 5:44pm

@Klaus : thanks for your response

@adamsheha2 : I was generating dynamic XML configuration and I have created a thumbnail script (only with actions, no swf plugin). There is a lot of math operations for placing thumbnails correctly.

A.L.