IT News/PHP

플래쉬에서 자바 스크립트 호출하는 방법

Fshop 2012. 3. 7. 09:46
반응형

Cool, How Do I Do It?

First you’re going to need to put your javascript function between the head tags of your document. For this example, I’ve used the following function:

1
2
3
4
5
<script language="javascript">
function myfunction() {
   alert("This function was successfully triggered via the flash movie.");
}
</script>

Moving on, you’re going to need to make a small Flash video that contains either a button, or something else that can trigger events. If you’ve already previously built something, and you want to make javascript calls from your project, that is fine too. Within the Flash event in which you wish to trigger your javascript function, you’re going to be using the getURL command, to issue the call. Mine looks something like this:

1
getURL("javascript:myfunction();");

출처 : http://blog.codefidelity.com/?p=15
반응형