Sie sind nicht angemeldet.

1

Freitag, 16. Juli 2010, 10:56

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

Montag, 19. Juli 2010, 11:01

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:

Quellcode

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

Anfänger

Beiträge: 14

Wohnort: baton rouge, LA

Beruf: Economist

  • Nachricht senden

3

Montag, 19. Juli 2010, 20:26

Math Operations

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

4

Donnerstag, 22. Juli 2010, 17:44

@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.

Ähnliche Themen