Flash: prevent the user from draging one thumb of a HSlider - apache-flex

I'm using Flash HSlider component.
I used a slider with several thumbs. I'd like to prevent the user from draging just the middle thumb, but can drag other thumbs. I don't know how to do it. Could any one can give me some tips?
Thanks.
Yuan

on creation complete for the slider do...
slider.getThumbAt(middleThumbIndex).enabled = false;

Related

How to create a button with image in Xamarin.forms

I want to create a button with cancel option(image).
Please have a look image.
Cancel or button both have different click option.
enter image description hereHow I can achieve this.
You can use simple StackLayout with horizontal orientation and use Tap Gesture for image and label to achieve your target.
Hope this may solve your issue.
The Button has an image property you can define in xaml. Just add the name of your image and make sure it exists in the resources / drawable folders

How to make a button in Unity?

How can I make a button for mobile devices? I have a pause screen and a script that accepts touch but it activates when I click on any part of the screen, not just the button.
How can I fix it to activate only on the button? My script is attached to cube with invisible material so basically I want to activate script only when player presses the area around cube.
I wasn't sure how to paste code here so I used pastebin:
http://pastebin.com/ERC39TuU
See GUI.Button reference.
function OnGUI() {
if (GUI.Button(Rect(10,10,100,50), "Click"))
Debug.Log("Clicked button!");
}
With newer versions of unity they implemented a much better GUI designer. I would look into using Canvas. Adding images to your buttons and functions is much easier the nusing OnGUI in my opinion.
https://unity3d.com/learn/tutorials/modules/beginner/ui/ui-canvas

most rational way to drag popup menu in flex

In my app I currently have a popup menu implemented as a BorderContainer with a lot of buttons, textfields, date pickers, etc. PopUpManager handles its appearing and disappearing based on some UI events.
I'd like to be able to drag the container by clicking on any part of it minus all the components on it. In other words, when I click on buttons, text fields, etc. I'd like for them to respond as usual and for the container not be draggable.
I've tried this very simple implementation
_menu.addEventListener(MouseEvent.ROLL_OVER, toggleDragON);
_menu.addEventListener(MouseEvent.ROLL_OUT, toggleDragOFF);
private function mouseDown(event:MouseEvent):void
{
_menu.startDrag();
}
private function mouseReleased(event:MouseEvent):void
{
_menu.stopDrag();
}
but this definitely doesn't do the trick, i.e. all components lead to dragging. I've tried to make sure that mouseEnabled and mouseChildren are true for all the components but this doesn't seem to make any difference.
I then came across this thread which makes a lot of sense, but I have a hard time believing that the best way for one to handle this is to handle all click events for each of the components on the popup. Is there an obviously simple way to do this that I'm missing?
thank you!
f
How about checking the target property of the event to check if it equals your menu?
if (event.target == _menu) {
_menu.startDrag();
}

Detecting out-of-view flex controls

In my flex app I have custom tooltips on buttons that hide and show based on user context.
The problem that I dealing with is that when I call my showTips() function I only want to show tooltips on the buttons that visible in the view. So buttons that on a un-selected tab (tabNavigator) should not show the tooltips.
For some reason all tooltips are showing.
Is there a way to detect if a button is not in current view, like on a un-selected tab?
If you gave us some code I could check this out, but would this work?
if(button.parent.visible) { showTip(button);}
Instead of custom coding for each button, make use your tabnavigator's creation policy is set to "auto".
Check this link for more details
http://livedocs.adobe.com/flex/3/html/help.html?content=layoutperformance_05.html

Tree Show toolTip during drag

I am denying a user the ability to drop into my tree during certain conditions, it's all going well, but I want to tell the user why I'm denying the drop. I would prefer to do it with a toolTip, but it doesn't seem to work. Can I not have a toolTip during a drag operation? How can I force one?
Flex seems to treat toolTips as a property of the UI component, with the component deciding when and if to show it. I would like it to force it to be like doing one in javaScript where it was always just like saying "Show it now" "stop showing it now"
Does anyone know about doing this during drag?
Thanks
~Mike
What you could try is to show the tooltip yourself with the mx.managers.ToolTipManager. Create for example a VBox that implements mx.controls.ToolTip and displays the message you want to show to the user.
You can see a working example at FlexExamples.
Another idea is to show a programmatic mouse cursor when the drop is denied. I've just read an article about that on Inside Ria.

Resources