Choosing random action, Flash AS3

Posted by esryl on Stack Overflow See other posts from Stack Overflow or by esryl
Published on 2010-03-31T13:42:41Z Indexed on 2010/03/31 13:53 UTC
Read the original article Hit count: 386

Filed under:
|

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"}); }})
');

© Stack Overflow or respective owner

Related posts about flash

Related posts about as3