Slow reaction on function

hi!

it’s quite hard to explain, especially cause i’m not a native english speaker…
i’ve uploaded my >fla< and the [URL=http://homepage.swissonline.net/bakery/seilziehen1.swf]>swf< as well
please have a look at it. when handle 1 is being dragged, handle 2 swings elastically on one axis around handle 1.
in case of dragging handle 1 (upper) everything is just perfect. but when i drag handle 2 (lower), the movement of the line, which connects the two handles all the time, is slower than the movement of handle 1.

why? both handles have got (basically) the same code…

thumbs up to pom for his wonderful tutorial on elasticity

and thx for all your hints!

instantjesus

The link to your .fla does not work!

:o whoops, now these links should work:

>fla< and [URL=http://homepage.swissonline.net/bakery/seilziehen1.swf]>swf<

any suggestions?
thx for your help!

instantjesus

it’s a weird problem, cause i’ve got two objects with the same code on it, and still they behave differently…
why is that… can anybody help?

download:

>fla<
>swf<

flash orders its code execution from top to bottom depthwise.

this seems to have something to do with your problem because if you bring schieber1 to the top (select it and press ctrl-shft-[upArrow]) you get the opposite behaviour (schieber2 falls behind).

i’m not sure why your swapDepths code at the beginning doesn’t seem to affect this. it seems that the code execution order is not effected by swap depths.

you can get more reliable behaviour by changing the order you call the methods in the onClipEvent actions. try calculating the position first, and then rendering the line. that seems to clear up the problems.

thanx a lot, sbeener!

your tips were very helpful! after i changed the order of the two function calls (first position, then line) the movie works properly now!

btw: is there any possibility to place two MCs on the same depth?
or would this be against the logic of actionscript?

i don’t think so…

the “depth” i’m referring to is how the movies appear in the editor (seperate from the programmatic depths managed by swapDepths). one has to appear above the other…

it’s normally not really a problem, but occasionally a good thing to be aware of while troubleshooting. same goes for levels in the editor … scripts in higher levels are executed before those in lower ones.