'have the following problem: I'm trying to make an output box which is draggable with the mouse in vertical direction only (within certain
upper and lower limit).
Dependend on the vertical position it should make a calculation.
So if the _y position = 100 it should output i.e. 100 * variable
and after dragging the output box to _y position 110 it should output 110 * variable.
Hope you know what I mean. In this link I put my newbies unsuccesful attempt:
I renamed The Text Box inside the MC called 'drag'. I named it 'green'. So now, On Release of 'drag' it gets the property of itself and the varible 'green' is set to The MC drag's _y position. I also set it to update the text field when an 'On Press' function occurs.
hope you can help me with the 'final' step.(To show I'm not a lzy bastrd walking away with your code I attached some of my own code, with your dragbox on it.)
In the code you can see the last problem. I want to multiply the position property with the variable velocity (which I generate somewhere else; in the Control layer. BUT: SOMEHOW IT DOESN'T READ THE VARIABLE VELOCITY ?
on (press) {
startDrag("", false, getProperty("", _x), 385, getProperty("", _x), 535);
green = getProperty(drag,_y) * velocity;
}
on (release) {
green = getProperty(drag,_y)* velocity;
stopDrag();
}
The colored balls suppose to be particles in the fluid; as you can see the flow is the highest in the middle of the pipe and lowest near the pipe wall. Now the idea is to use your dragbox to measure flow velocity, dependent on the position of the box> in the pipe. As you see I'm doing quite well with you code and added some of myself. Thanks so much for your help. I truly appreciated it!
Now the last things would make it perfect (and once more haven't got a clue).
Now you see an update of the drag-box only at the END of dragging.
1) Would it be possible to see the output continously so DURING dragging? Than you could check the flow easily @ any position in the pipe.
2) If I change flow rate now the velocity changes, but the output on the dragbox isn't updated until pressed again with the mouse.
Any help would be great again (hope I don't take too much of your time) !