A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: dragable output box

  1. #1

    dragable output box

    Hi all,

    '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:

    http://home.hccnet.nl/m.dijk/drag/

    Expert help is highly appreciated !

    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    243
    Hmm i think this is want your wanting?

    Let me know..
    Attached Files Attached Files

  3. #3
    Hi CF !

    Thanks: almost good, and in fact of good use as well

    My original need is to depict the output on the green dragable box-button itself, would that be possible with Flash ?

    Would be of great help, see att:

    Attached Files Attached Files

  4. #4
    Senior Member
    Join Date
    Jul 2000
    Posts
    243
    Ok. Not a problem..

    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.

    Cheers!

    See attached File Below:
    Attached Files Attached Files

  5. #5

    final step, I hope

    OK, absolutely great !

    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();
    }

    Can you help me out?
    ThX in advance !!!
    Attached Files Attached Files

  6. #6
    Senior Member
    Join Date
    Jul 2000
    Posts
    243
    HUhhuh DUhhh??.

    Hahah, This was my bad. I left out the _root So the Code on 'drag' should read:

    on (press) {
    startDrag("", false, getProperty("", _x), 385, getProperty("", _x), 535);
    green = getProperty(drag,_y) * _root.velocity;
    }
    on (release) {
    green = getProperty(drag,_y)* _root.velocity;
    stopDrag();
    }

    Ok?
    Hmmm.. >ponders..< What is that calculating? ....Energy?
    -Cheers

  7. #7

    Now the last things would make it perfect

    Hi,it's me again,

    It's a little flash file to calculate on fluid flows in pipes (check on my freeware site: www.pressure-drop-calculator.com )

    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) !

    Attached Files Attached Files

  8. #8
    Senior Member
    Join Date
    Jul 2000
    Posts
    243
    Hahaha, Damn WHy Can't I do this when im working on my own stuff.

    Anywho.. Took me a while to figure this out. when i did I was Like.. Damn it.. thats all it was.. Arrgggg. But hey. It works..

    Where the Code is on Layer 'Control' Frame 2. At the end remove the Stop; script, and Place the following

    drag.green = getProperty(drag,_y) * _root.velocity;

    After that you will need to insert frames for all the layers that do not go to frame 3.

    That should do it.

  9. #9

    ThanK U

    OK CF, ThX alot, you really helped me a great deal !!!

    Now back to work to update my website with all your info!

    Cheers,
    Carfi


  10. #10
    Senior Member
    Join Date
    Jul 2000
    Posts
    243
    Good Deal... I like site. Informative, even thought I have no use for the info!

    Take Care.

    Chad

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center