(Actionscript 3) How to Hide Right Click Menu? - actionscript-3

I found a cheat to one of my games in which you could access a screen you are not supposed to by right clicking and clicking on "Play".
I tried typing in the following code:
var cm:ContextMenu=new ContextMenu();
cm.builtInItems.play=false;
but it is still not removing that item. Is there anything I am doing wrong?

You forgot to apply the context menu.
stage.contextMenu = cm

Related

Google Sheets Script:Group Button At Bottom

I'm populating a new sheet with parsed data from another sheet, and then I group rows using shiftRowGroupDepth().
It works well, but I was surprised to find all the group/ungroup buttons at the bottom of a group instead of the top.
I've checked the Group Class in the docs, but I haven't found a method to revert to the default - button at top. Anyone know where this setting is?
Found the answer in another forum, it's:
spreadsheet.getActiveSheet().setRowGroupControlPosition(SpreadsheetApp.GroupControlTogglePosition.BEFORE);
It's actually pretty straight forward. Just right click on the + / - Icon and click "Move +/-" button to the top"

Opening pulldown section with button

There is probably an answer for this but I have no idea of the terminology I would search for unfortunately!
Basically, there is a button on my Wordpress website at the top right which when clicked, pulls down a form to fill out. What's the easiest way of creating a button further down the page which would open that pulldown and take the user up there, presumably with an anchor? Simple HTML/CSS would be ideal because A: I can create a text box in the page layout creator and just paste the code in there and B: My coding knowledge is quite limited!
The website is www.harringtonsproperty.co.uk. The button in question is the BOOK A VALUATION at the top right.
Thank you!
This cannot be done with CSS alone. You need to use JavaScript.
Currently, the 'click' event is described at the top of the custom.js file. You'll need to add an additional JS function into this file to achieve what you want. For starters/example:
jQuery('button#contactToggle2').click(function(e){
e.preventDefault();
if( jQuery('#contactSlide').css('display') == 'block' ) {
jQuery('#contactSlide').slideUp(500);
} else {
jQuery('#contactSlide').slideDown(500);
// Handle scroll to top
jQuery('html, body').animate({scrollTop : 0},800);
}
})
You'll then need to give your new button an id="contactToggle2" in order for this to work. Again, this is just an example.

Java swing CheckBox is not visible in JCheckBoxMenuItem

The checkbox icon is not visible in my JCheckBoxMenuItem..I add this JCheckBoxMenuItem to JideMenu which extends JMenu.How to make this checkbox visible eventhough if it is not selected..?
Thanks in advance.
I'm not entirely certain where your problem is coming from. It sounds that just the checkbox component isn't visible, while all other MenuItem types are showing up on the Menu.
I'm not very experienced with the Swing library, but if you could put a few lines of code regarding your Menu/MenuItems, I'm certain you'll get a much better answer.
Taking a shot in the dark, you mention that the MenuItem (checkbox) is added to the menu, but have you added the menu into a MenuBar/JMenuBar object and set your JFrame to use that Bar via the setMenuBar() method? This is under the assumption that the entire menu isn't showing up (not just the checkbox component), but figured I'm try to preempt a solution here.
menuBar = new JMenuBar();
menu = new JMenu("A Menu");
menuBar.add(menu);
cbMenuItem = new JCheckBoxMenuItem("A check box menu item");
menu.add(cbMenuItem);
It´s pretty much straightforward and taken directly from here. I guess it´s all anyone can say about it until you show us your code.
setState(true) will show the checkmark… IIRC there's also a constructor that you can pass a boolean if you want it created with the checkmark visible.

Flex 3 custom components positioning - popups

I have created a custom TitleWindow whcih i use as a popup. The contents of the popup are created dynamically depending on a selection a user makes from a datagrid.
My problem is, my datagrid is in another custom component whcih is toward the bottom of my page so when a user clicks one of the items the popup is displayed however with half of it out of sight at the bottom of the page.
Is there a way to position a popup so that it displays at the top of the page?
I know at least two things you can use to position a popup, though there might be more.
When you place a popup you can choose in which parent component to place the popup:
PopUpManager.createPopUp(this.parent, TitleWindowComponent);
In the component itself:
PopUpManager.centerPopUp(this);
I wanted a help tooltip type popup (with help text) to appear next to the icon that opened it. In the end I used move(x,y) to move the window where I wanted it. To get the coordinates to place it, use globalToLocal:
var globalX:Number = localToGlobal(new Point(myIcon.x, myIcon.y)).x;
var globalY:Number = localToGlobal(new Point(myIcon.x, myIcon.y)).y;
toolTip.move(globalX + myIcon.width, globalY);
That puts the window just to the right of the icon, myIcon.

Menu links not clickable

I have defined in the code for a link to go to a page, but it is not going anywhere when I click it.
If you go to this page: http://www.davidhechtkitchens.com/ and try to click on "Portfolio" in the top navigation it does nothing. If you look at the code you'll see that it's defined to go to portfolio.html.
This problem only seems to be in effect when there is a sub-menu underneith the top link. If I remove the sub-menu from "Portfolio" it works.
It seems you have some kind of script active that prevents the default action,
While checking the source code, When I click on the button it adds a class to the anchor. (In most cases this is made to make it work on mobile devices)
Simple fix Just add a class of .menu-link to all the links that you want that are not sub menu links. You can use whatever class you want but make sure that class is only on the href's you want to actually use this. Also don't forget to put this AFTER your Jquery include.
<script>
$(".menu-link").on("click", function(){
//get this clicked link
var link = $(this).attr('href');
//go to link clicked
window.location = link;
});
</script>