Copy link to clipboard
Copied
I think this is an enhancement that has been added to the latest Flash Player 10.1 release. It seems crazy to me to think that the MENU_ITEM_SELECT event wouldn't maintain the same respect of user interaction as a mouse click or button press. This is the error that is returned:
Error: Error #2176: Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press.
This is coming up when I am attempting to System.setClipboard( 'Q@#$%ALWT' ) via a custom Context Menu item. I would think that a user initiated click on a Context Menu Item would maintain the same priority as that of a Mouse or Button click. Could someone better help me understand why this event has been sandboxed within this context?
Thanks,
Ryan
Copy link to clipboard
Copied
i don't see that.
Copy link to clipboard
Copied
kglad, you didn't try hard enough! Here's enough timeline code to show the problem:
var menu:ContextMenu = new ContextMenu();
menu.hideBuiltInItems();
menu.customItems.push(new ContextMenuItem("Test", true, true));
menu.customItems[0].addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, setclipboard);
contextMenu=menu;
function setclipboard(e:ContextMenuEvent) {
System.setClipboard(String(getTimer()));
}
It won't go wrong in Flash, or Flash Player, but if you view the published html in a browser, then you'll see the problem.
Copy link to clipboard
Copied
i see no problem.
update to the latest flash player and retest.
Copy link to clipboard
Copied
There is a chance that it fails silently unless you're using the debug player, which I am.
If you're using a player later than 10.1.53.64, can you tell us where to get it?
Copy link to clipboard
Copied
i'm using 10,1,53,64 debug version, ff, windows 7.
Copy link to clipboard
Copied
Hey,
OK, after a little testing, this seems to be only showing itself within Safari 5 on Mac OS 10.6.4, with FP 10,1,53,64.
I have tested on FF 3.6 and Chrome 5.0.375.70 with the same FP version and I am not getting the prompt.
Might just be a new Safari thing. I'll let you know if I run into the reason why this is being thrown in Safari and not in other browsers.
Thanks,
Ryan
Copy link to clipboard
Copied
there are so many problems with safari it's surprising anyone uses it. but i see 5% of users use it.
Copy link to clipboard
Copied
Ok, it seems that Firefox and Chrome don't show the problem, but Safari does. (I see Ryan just posted the same results). The Flash bug system isn't letting me in at the moment. I'll log a bug when I can.
Copy link to clipboard
Copied
I managed to get in, and have logged a bug ( http://bugs.adobe.com/jira/browse/FP-4825 ).
Copy link to clipboard
Copied
I wonder if when you are selecting the contextual menu item, if Flash is then doing a dispatchEvent to pass around the MENU_ITEM_SELECT event? Could you have previous got away with doing this:
stage.addEventListener(MouseEvent.CLICK,setclipboard);
stage.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
function setclipboard(e:MouseEvent) {
setcb();
}
function setcb() {
System.setClipboard(String(getTimer()));
}
You can't do that now.
I can't fully understand the whole article, but reading this may lead to some clues:
http://openflash.org/devnet/flashplayer/articles/fplayer10_security_changes_02.html
Maybe checking ContextMenuEvent.isMouseTargetInaccessible and doing a loadPolicyFile is needed?
Copy link to clipboard
Copied
Hey Colin,
Yeah, I don't think it's tied to a Policy File issue since the error is thrown regardless of the site/domain that I am accessing the SWF from. It appears to have surfaced since the release of FP 10.1. Apparently MENU_ITEM_SELECT is no longer considered "user interaction". Don't quote me on that since I haven't found any posts confirming that, but I know that this was doable in 10.0. Hopefully someone from Adobe will be able to jump into this thread and shed a little light on the topic.
Let me know if you happen to run across any other information in the meantime.
Thanks,
Ryan