0

Can some one help me to do this effects in flash?

I have this code for getURL but it's opening in newtab. What I need is it should be open in new window.

on(release){getURL("http://www.google.com", "_blank");}

I want something like this.

Thanks for your help in advance

blackbishop
  • 30,945
  • 11
  • 55
  • 76

1 Answers1

1

getURL offers no window control. You'll need to use getURL/navigateToURL with JavaScript to achieve that:

var jscommand:String = "window.open('http://www.google.com','win','height=400,width=400,toolbar=no,scrollbars=yes');";  

getURL("javascript:" + jscommand + " void(0);");
blackbishop
  • 30,945
  • 11
  • 55
  • 76
  • Hi Thanks for your help. I have added the code in my file, But when i press ctrl+enter it's working i don't what like that. after we click on some images it need to work please. – Ramana Kumar Chukkapalli Apr 17 '15 at 14:09
  • If I correctly understood, you whant to open that window when clicking on some image ? – blackbishop Apr 17 '15 at 14:18
  • For that you could use something like this : `click_btn_name.onRelease = function(){ //put here the above code}`, where `click_btn_name` is your button. – blackbishop Apr 17 '15 at 15:06
  • My code is like this: anotherSite_btn.onRelease = function(){ var jscommand:String = "window.open('http://www.google.com','win','height=400,width=400,toolbar=no,scrollbars=yes');"; getURL("javascript:" + jscommand + " void(0);"); } and it is giving some error massage. Scene 1, Layer 'Layer 6', Frame 1, Line 1 1119: Access of possibly undefined property onRelease through a reference with static type flash.display:SimpleButton. Scene 1, Layer 'Layer 6', Frame 1, Line 4 1180: Call to a possibly undefined method getURL. – Ramana Kumar Chukkapalli Apr 17 '15 at 15:22
  • I guess you're using AS3 ! Try this instead : `anotherSite_btn.addEventListener(MouseEvent.CLICK, function(event:MouseEvent):void {//your code here});` – blackbishop Apr 17 '15 at 15:32