Home > Tags > ExternalInterface

ExternalInterface

[AS 3.0] SWF가 임베드 된 URL을 이용해서 변수 전달하기

html에서 swf로 변수를 전달하고 싶을 경우 보통 flashvars를 이용하는데,
flashvars를 이용하기 어려울 경우가 있다.
그럴 경우, swf가 임베드 된 html의 url을 이용해서 변수를 전달하는 것도 방법이 될 수 있다.

Continue reading

  • Share/Bookmark

[AS 2.0] swf파일이 들어있는 페이지의 URL알아내기

ExternalInterface을 이용하면 현재 swf파일이 들어있는 페이지의 URL을 알아낼 수 있다.

import flash.external.*;

if (ExternalInterface.available) {
    var rel:String = String(ExternalInterface.call("location.href.replace"));
    trace(rel);
    textOutput.text = "This Page URL is : " + rel;
}
else{
    trace("NULL");
    textOutput.text = "This Page URL is : undefined";
}

Continue reading

  • Share/Bookmark

Home > Tags > ExternalInterface

Categories
Archives
RSS Feed
Meta

Return to page top