SWFAddress, Back button - actionscript-3

Can SWFAddress "sense" when a user has pressed the browser back button?
I know it can fire off EXTERNAL_EVENTS, but...does it do this for specific buttons?

Not really, the only awareness that swfaddress has of the user pressing the back button is that the address in the browser's location bar changes (represented by the window.location object in javascript). It detects that change by checking the window.location object on a regular interval.
When the window.location object changes, but swfaddress didn't trigger the address change, it fires an EXTERNAL_CHANGE event. This could be caused by the user typing in a new anchor into the location bar, hitting the back/forward buttons, or several other things. There's no way to do something like putting an event listener on the browser's back button.

Related

Button on form looks like it is being constantly pressed after being clicked

I have a form in Access 2013 that uses a button to jump to another form.
However when the button is clicked certain requirements have to be met in order for the jump process to actually be executed. If the requirements are not met the user is forced to stay on the current form (with the button).
When this happens the button stays in the clicked (i.e. pressed down) state on the form, making it look like it's being constantly pressed.
(Note: If the button is clicked again and the requirements again aren't met it pops back out...)
Is there any way to change the appearance of the button back to the unclicked appearance after every click when the user is forced to stay on the current form?
Many thanks in advance for any kind of help!
A regular button can stay depressed for a short while, while its _Click() event procedure is running.
But once that finishes, it always returns to its normal state.
So the assumption was, that a toggle button was used instead, which turned out to be correct.

Intercept or catch a chrome click event on the interface

Is possible to intercept a click event on the chrome interface? I mean, not in the page that I'm visiting, but a click on a tab or a click on the "go back button", a click on the print button in the settings menu or a click on the "show all favourites button", ECC...
I cannot find anything useful in the APIs documentation.
The answer would be no, you can't directly detect the 'physical' button clicking event.
On the other side, you can listen to the request sent from the button. For example, when 'go back button' is clicked, it usually means the browser history is back, and you may refer How to Detect Browser Back Button event - Cross Browser for more info.
Please be aware that those methods may be tricky and may not be supported by every browser.

Window not selected after changing frame from using a button

When I change scene with the use of a button in my game it seems to deselect the window. Then it does not respond to keyboard input without clicking the window again afterwards.
Is there a way to stop this with some sort of command or a way to bypass this with a different method.
When you click an object that object gains focus. During your buttons MouseEvent.CLICK event listener, you need to call the setFocus() function on the object you need the key strokes on.

Firefox: How to reload form *without* caching user-input?

BACKGROUND:
When you have a page that includes an HTML form, and you refresh/reload the page or use the back button, Firefox is kind enough to repopulate your inputs with what was entered before you navigated away.
PROBLEM:
For some use-cases, this is not the desired functionality. Fortunately, there are ways around this behavior if you are willing to use one of the "redraw without caching" options below:
redraw without caching ;; Press CTRL+F5
redraw without caching ;; Press form "Reset" button while holding SHIFT
redraw without caching ;; Cut the address from the address bar, Paste it back into the address bar, press ENTER
redraw with caching ;; Press F5
The problem is, not all users know these options, and some just want a simple "Reset" button that they can click on with the mouse without having to use the keyboard.
QUESTION:
Is there a way to get Firefox to do a "redraw without caching" in a way that lets the user simply click on a button with the mouse, and not have to use the keyboard?
For the sake of completeness:
<script>
document.FORMNAME.reset()
</script>
It resets the form with the name FORMNAME on every reload of the page.
Method 1:
Holding Shift + clicking the Refresh button will do a refresh without cache. This isn't a mouse only, but this is the closest I can think of while using the mouse.
Method 2:
If you really want to use no mouse, on a Mac, you can drag and hold the favicon off the URL bar, then drag and drop it back into the URL bar. Can't confirm on Windows, and this just seems more confusing than holding Shift.
Method 3: Install Hard Refresh add-on, which installs ability in context menu.
How about a link to the same URL that the user is currently on?
Since the browser treats it as a navigation, rather than a refresh/reload, the form data won't be remembered.
Note that "reset" is a different term used specifically for reverting forms to their original state without reloading the page, as in <input type="reset">, don't confuse it with refresh/reload which are terms for getting a page to be requested again from the server

Pressing the back button does not trigger <body>'s OnLoad

My checkout cart displays (1) an animation for "Processing Order..." after the 's been (2) submitted and the card is being processed in a php script. However, there's a bug triggered when the user has reached the "order accepted" page, and pressed the back button. The "Processing Order..." animation is still displayed.
(1) The processing display is shown like:
<div style="position:absolute;display:none;" id="animation">
<img src="animation.gif"/>
</div>
(2) When the button is submitted, the javascript used:
onClick="document.getElementById('animation').style.display='block';
document.the_form.submit();"
So, the button is clicked, the animation displayed, the form submitted, and the card is processed, and the user is on a new page.
When the user clicks back, we should expect a page without the animation. But, onLoad isn't triggered, and the last state of the animation (displayed) is saved.
Any idea how to remove the animation when the user returns to the page?
Inspired by Adam A's comment, you could hide the animation when the user is leaving the page (through form submit is the normal route, I would suspect) so if/when coming back to the page, the animation isn't shown.
One way to achieve this is adding the hiding code to HTML body's onunload event.
<body onunload="document.getElementById('animation').style.display='none';">
In most modern browsers, clicking back doesn't reload the page, it just displays it from memory as it last remembered it (as this is likely to be the desired behaviour).
In my limited experience of UI design, I'm not sure why you would want users to click the 'back' button after submitting an order, instead you should provide a link that takes them forward to the next task they may wish to complete, or, forward them onto a new page that has useful tasks and simply displays a message somewhere that says "Thanks, your order is accepted".