I'm creating a board game in libgdx using a board of 3 x 3 buttons in a Group that's in a VerticalGroup.
I have problems because the mouse position I get is misplaced from the actual position in screen. I can click a button, but the button below is clicked instead.
I'm using text buttons, so this should be an internal issue of the Actor. Can I configure it in some way to avoid this behaviour?
I found no cause for this on any forum.
Can you help me? Am I forgetting something?
Related
I'm developing some applications in Tcl/Tk and I would like to add on my GUIs a function to minimize the windows leaving the toplevel in the current position of screen.
This picture better explains my idea.
When the mouse pointer is in the bar (sorry if the name is wrong but I don't know the technical name of that part of GUI) I press mouse button and the window becomes as below.
I add this row in my scripts for a test
bind . <Button-3> "wm geometry . 200x1"
But this work fine only in the frame area of toplevel. My problem is bind the event when the mouse is exactly in position of the figure.
Anyone know how can I do so?
Thanks in advance for help
You cannot do what you want. Tk has very little control over what happens in the decorations added by the window manager. Simply put, you can't process events that happen in the window border or title area.
First off, I'm pretty novice when it comes to Flash and AS3.
I am trying to create a displayObject that contains 12 buttons for a mobile app. Since there are twelve buttons that will all open up into seperate menus they obviously all won't fit on a mobile devices screen. This is why I want to have all of the buttons on one display object that can be dragged up and down to show the buttons not currently displayed on the screen.
I am running into numerous problems while attempting this.
1) If I make the object containing the buttons draggable, which is behind the buttons, I can't click it through the buttons in order to drag it(unless I hit a sweet spot where there aren't any buttons but this isn't efficient for the user).
2) If I make the object containing the buttons draggable and put it in front of the buttons then I can't click the buttons in order to open the menus and access what is contained within them.
3) For some reason all of the buttons are seperately draggable when I don't want them to be. For example, I click anywhere on the screen (whether the touchID point is on a button or not) to move the entire list of buttons and if I happen to be clicking a button then, instead of moving the entire list, it moves that one button.
So the main question here is "How can I create a list of buttons and scroll through the list using a drag method (such as the settings menu on your phone) without dragging the buttons apart from each other." So the containing display object is draggable, and the buttons are clickable.
Some guy named Glenn does a good job with his example: http://rabidgadfly.com/2010/03/as3-clickable-button-inside-a-draggable-movie-clip/
However, if you click the yellow button in his example you can drag it out of the gray box. I want my button to remain stationary relative to the gray box. So you can move the gray box but the yellow button remains in the same location within the box but you cant drag the button around within the box.
I am not familiar with accelerometer events for the smartphones, but I do have an idea on how to fix this with regular actionscript 3 listeners. (You can just convert these to whatever is used by smartphone listeners)
A solution that comes to mind is to have a mouse down listener and a mouse up listener on the whole drag-able box. And when a mouse down event fires, you start a timer to go off in about a quarter of a second, and when it does you then set up a enter frame (or a timer based) function that fires every frame. This will update the whole box's position every frame corresponding to the current mouse location (your dragging box effect) and when the mouse up listener fires, it stops the dragging (and at this points, if the mouse is up, then the user is not touching the screen at all).
Also add a mouse click listener to every button. This way, with the quarter of a second timer, you KNOW that if the user simply wants to click a button, then they will click, leaving less that a quarter of a second between the mouse down and mouse up events (so that the dragging never starts) and the button is only clicked. And if the user holds the mouse down for more than a quarter of a second, then you KNOW that they must be trying to drag the whole thing.
This seams like the only way to differentiate between a user wanting to drag the box, and the user wanting to click a button inside it.
Obviously it does not have to be a quarter of a second, it can be any length of time that you want, it could even be no time at all, but then this might mess up things when people only want to click the button and accidentally slides it when clicking.
If you have any questions or problems, please comment and i'll try to help.
So what do they mean?
I am making an "interactive" iPhone as a project.
Currently I have 1 scene and within it, a movie clip labeled iphone and within it, about 8 or so buttons for different "apps". I want to create a scrolling affect after clicking one of the icons. How would I go about this?
If you're referring to creating Button type symbols, as in:
There are four states in the timeline to skin the visual appearance of the button depending on mouse interaction.
Up - Button's appearance when the pointer is not over the button.
Over - Button's appearance when the pointer is over the button.
Down - Button's appearance as it is being clicked.
Hit - Defines the area bounds that will respond to a mouse click. This area is invisible when published.
Addressing the remainder of your question, creating a virtual iPhone in Flash running various apps is substantial depending on scope. I would recommend breaking that down in to multiple questions.
I have a bordercontainer and several rectangle objects inside.
I can drag the objects inside the container, but when I right-click a rectangle and move the mouse while rmb is pressed, all dragging stops working. I have no idea why.
Right mouse button is reserved for the context menu. You can not change this. You can add to the context menu but you can not take it away. Clicking the right mouse button on your rectangle should bring up that context menu and stop all dragging. As far as I know, working as intended. If I am misunderstanding, please clarify and I will be happy to assist further if I can.
I am looking for some help with Flash (CS5 version). I have a situation where if try to put a button on the stage with visible differences in the up/over/down/hit states, when I compile the document into a .swf, the button will continuously flicker through each state in order very quickly. Also, if I break the AS3 code in the Main class file, hidden parts of a slider bar component will flicker between visible and not. I'm talking Japanese-style, seizure-inducing flicker here. I've searched my code for recursive function calls and tried deleting and re-adding components and buttons, but to no avail. Any ideas on what could be up?
Well, it seems to me you aren't using stop() to stop the button at the frame you want.
If it isn't this, then there is some error with your ActionScript, which will show up in the output panel, so check that.
When you say 'button' is it an instance of the Button Class and have you set the instance type to Button?
i.e.
Select the button in your library panel, right click and choose 'Properties'. Then set the Type to Button.
Next, select the instance of the button on the stage, open the Properties panel and just underneath where you type the instance name you should see a drop down menu containing MovieClip, Button and Graphic. Set it to Button.