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
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.
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.
Creating engaging and entertaining content for designers and developers since 1998.