Control Rate With Slider

Hi, me and a friend are doing a project in uni based on particles. We are in the process of doing a GUI, but have come a little stuck. basically all we need to do is create a float slider to control the rate of the particles. We thought it would be easy, but for some reason we cant seem to get it to work properly.

many thanks in advance

Hey,

Hopefully this can give you ideas to develop.

Load the procedures into memory before executing

CODE
global proc connectSliderUI(){

if (window -exists particleRateWin)
    deleteUI particleRateWin;

window
    particleRateWin;

columnLayout
    mainCol;

button
    -label "Select emitter and click me!"
    -c "connectSlider()"
    connectParticleBut;

floatSlider
    -min 0
    -max 1000
    -value 100
    -step 1
    particleRateSlider;

showWindow particleRateWin;

};

//========================================================

proc connectSlider(){

string $emitter[] = ls -sl;

connectControl particleRateSlider ($emitter[0] + ".rate");

};

Good luck!

-matt

Thanks very much! Worked like a charm!