AS3 Dynamic text box over button - actionscript-3

In AS3 I have a button on the stage and above it I create a textbox box dynamically with code.
My problem is that the area that is under the text (i.e. that part of the button) is no longer clickable.
I have set:
tBox.selectable = false;
but that doesn't solve it.
Any ideas
Season greetings,
Luben

Use InteractiveObject.mouseEnabled:
textField.mouseEnabled=false;

If you set component.visible to false it does not interact with the user.
So, if you set tBox.visible = false then it will be invisible and the button will become clickable. Just a thought, but overlapping components is really bad UI design. If you have space on your stage, you should consider keeping them separate

The problem is that text field (despite it's transparent) is lying over button. To make click on button possible you have to be sure that button is in front of text. Take a look at AddChildAt method of DisplayObject. Objects with greater position index are lying over objects with lower position index. So all you need is to make sure that button has greater index:
container.addChildAt(button, 1)
...
container.addChildAt(text, 0)
P.S.: you may embed button dirrectly into text field using html <a href="javascript:..."><img src="link_to_image"><a/> or something like that.

Related

Auto resize the width of input text area on hidden DIV

I use a Hide/Show .js script that hides some checkboxes and on the right side there is the search field when I click to hide it I want to expand.
Ex.
Before hidding:
Before hidding Image
After hidding I want the search field to be expanded 100%
After hidding Image
I searched for 2 days something and can't find a way to make it expand I use the bTemplate engine to store the HTML code.
Did you try changing the CSS properties through the "setAttribute" method of the elements in question through Javascript? Basically, the code you used to "hide some of the checkboxes" in the first place is pretty much like how you'd write the code to do the other things you're looking to do.
In other words, When you want the checkboxes out of view and the text entry box centered, as in your second reference pic, you could have the Javascript code written through the "setAttribute" method so that when a particular event happens, the css "display" parameter for the check boxes could be set to "hidden", the size of the text entry box can be increased, and the css "position" parameter for the text entry box can be set to have it centered, etc.
That is, of course if I understand your issue correctly. Can you provide the code you are using? I'm sure me or someone else could clarify things more if we could see what you have written.
Hope that helps at least a little! :)

setText jolts TextButton at inital position for a microsecond or two while movement is happening

I have an actor and I'm moving it by using moveTo(destinationx, destinationy, time).
The problem is that the actor is a TextButton and I need to change the text while the movement is happening and this poses a serious problem. It seems setText calls invalidate and invalidateHierarchy so when the method is called the position of the TextButton is reset to the initial position for a while so that the movement proceeds with a jolt (jump) of the text button position (position set at initialization - .center()).
All the dynamics of my actor movements are running as planned as long as I don't modify the text while Actions.moveTo is still running. If I do modify it then I see a jolt of the text at the moment I call setText.
How can I solve this pb?
I was able to reproduce your problem by placing a Button in a Table and using moveTo actions on the Button. The problem is that when a widget belongs to a Table, the Table is responsible for controlling the widget's position and size, so actions that affect the position will not work correctly.
If you are moving a widget around the screen to arbitrary positions, it doesn't make sense for you to keep it in a static Table anyway. If you add the Button directly to the stage, the problem goes away.
However, I discovered another problem. If the Button doesn't have a Table parent, it doesn't update its own size correctly when its text changes.
I found a solution. Place the Button in a Container and add the Container to the Stage. Use your MoveToActions on the Container that wraps the Button, not the Button itself.

HTML5: make an editable textzone draggable with no side-effect?

I'am currently working on a web application in which I would have a page with a list of editable text areas and I would like to be able to change their order, simply by dragging and dropping each text area in the wanted position.
Basically, each of these text areas would come nested in , like this:
<div class="outsideDiv">
<div>
<textarea>
</textarea>
</div>
</div>
As I was trying to implement Drag and Drop feature using native HTML5 "draggable" attribute (more precisely, I put it as attribute of my most outside ), I noticed that would make my text areas draggable but also yield a side effect: whenever I click in the text area, it would, the typing cursor would always be at position 0. Thus, it is then impossible to move the cursor to another position, which is not that handy in case you want to edit an existing text.
So my question is, how could I make a text area draggable while keeping all of its features (I mean, without the mentioned side-effect)?
Have a look at the draggable effect in jQuery-ui (http://jqueryui.com/demos/draggable/)

how do I add text to a button?

This should have a really obvious answer but I can't figure it out...
I've made a button in Access 2007 that takes the user to a form (and other buttons that do other things). I've made the button's background an image so that I could have a gradient-style button but I'd also like to have text on top of this. There is text on the button but it gets hidden either because it's just a name given to the button for VB or because the gradient image is being place on top of it...
any ideas?
Access 2010, and Access 2007 supports both text and graphics on buttons.
Eg note the top buttons:
or simply this:
I do believe that transparency in 2010 is better supported, and the options for buttons in 2010 does include shadow and gradient options:
Eg:
I'm not sure how you did set picture as button background. Might be do you mean that you have two independent controls, an image and a button. In this case right click on the image and Position / Send to back. Back style of the button should be Transparent, but Transparent property should be set "No".

Can I hide the ToolTipText for a Slider Bar?

In VBA programming, is it possible to hide the ToolTipText for a Slider Bar?
The picture below shows a Slider Bar on a form in a Microsoft Access database. I would like to hide the ToolTipText in the red circle.
The reason I want to do this is because the Slider Bar cannot show decimal values (example: 0,1), so I want to display the values in a box next to the slider after they are scaled to decimal values. I know how to do this, but not how to hide the ToolTipText for the Slider that shows only integer values.
There is no easy way to remove that indicator as it's not exposed through the control itself.
However, there are a couple of solutions:
Subclassing the control and intercepting Windows messages
Not for the faint of heart, complex and overkill, but you theoretically could intercept windows messages and drop those that correspond to the tooltip.
This is not easy in VBA at all, and I wouldn't even try it.
If you feel like delving into this, have a look at an example in KB278379
Just display something else.
More interesting is the ability to change the displayed text to something else:
To change the text, handle the Scroll event and update the slider's Text property:
Private Sub MySlider_Scroll()
MySlider.Text = "Awesomeness: " & (MySlider.Value * 7.89)
End Sub
The event is not visible from the control's properties themselves, but if you open the IDE and select the Slider from the list of controls, you will be able to create the code for handling the Scroll event: