Choosing random action, Flash AS3
- by esryl
I have 2 actions in a Flash file that I would like to test for conversion. One is opening a link in a tab/window, the other loading the content in a Colorbox iframe over the page.
How do I randomly choose one of the following actions?
I currently listen for a click on a button:
clickJoin.addEventListener(MouseEvent.CLICK,toJoin);
My two actions are:
navigateToURL(new URLRequest("http://www.google.com/"), '_blank');
and
ExternalInterface.call('$.fn.colorbox({
href: "http://www.google.com/",
width:"80%",
height:"80%",
iframe:true,
onLoad:function(){ $("#player").css({"visibility":"hidden"}); },
onClosed:function(){ $("#player").css({"visibility":"visible"}); }})
');