본문 바로가기

[Flash] 브라우저 띄우기(새창 띄우기)

by hansoo.labs 한수댁 2015. 5. 8.
플래시 액션스크립트 만으로 새창을 띄우는 방법을 잘 소개하고 있다.
바로 요기.

https://helpx.adobe.com/flash-player/kb/create-pop-browser-windows-flash.html
맛배기로 getUrl을 이용한 방법.

AS2
// attach this code to your button instance on the Stage (select the button instance on the Stage and then add the code
// to the Actions panel while the button instance is still the most recent selection)
 
// define the string that contains the JavaScript command you want to send to open a URL in a new window
var jscommand:String = "window.open('http://www.adobe.com','win','height=200,width=300,toolbar=no,scrollbars=yes');"; 
 
// use the getURL() method, but pass the javascript string instead of a traditional URL
getURL("javascript:" + jscommand + " void(0);");


AS3
// This code goes in a timeline frame or external AS file...
 
// define the string that contains the JavaScript command you want to send to open a URL in a new window
var jscommand:String = "window.open('http://www.adobe.com','win','height=200,width=300,toolbar=no,scrollbars=yes');"; 
 
// create an URLRequest object, containing the javascript string instead of a traditional URL
var url:URLRequest = new URLRequest("javascript:" + jscommand + " void(0);"); 
 
// use the navigateToURL() method, and pass it your URLRequest object
navigateToURL(url, "_self");

태그

댓글0