Hi,
Thank you for your enquiry.
Please find an example Opus Pro 04 publication which demonstrates one way to create a slider control using script functions. Although possible, I tend to advise against using framed objects for sliders as not only do you need to factor the width, height and position of the parent frame into any
SetPosition() actions, but the edges of the draggable object will disappear when they reach the edges of the frame.
To use this example slider in your publication, simply copy and paste all of the object (including the Script object) from my publication to the required page in the target publication.
If you do not want the percentage to be shown above the slider, simply delete the
Text object, then delete the following actions from the
percent() function:
Code:
Text.SetSelection(0,-1)
Text.ReplaceSelection(pospercent)
You can now use the
pospercent variable in conjunction with your desired actions. For example, to change the volume of a sound file, you could use the following action:
Code:
SetVolume("Wave", pospercent)
The master volume will now be set to 0% when the slider is at the left-hand edge and 100% when positioned at the right-hand edge.
I hope this helps. Please do not hesitate to contact me if you have any further queries.
Kind regards,