# Javascript call flash function

**URL:** <https://forum.kirupa.com/t/javascript-call-flash-function/72227>\
**Category:** flash\
**Created:** [December 3, 2004, 11:54am UTC](https://forum.kirupa.com/t/javascript-call-flash-function/72227 "2004-12-03T11:54:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![turtle](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@turtle](https://forum.kirupa.com/u/turtle)\
**Post date:** [December 3, 2004, 11:54am UTC](https://forum.kirupa.com/t/javascript-call-flash-function/72227/1 "2004-12-03T11:54:34Z")

</div>

How can I call a flash function from a javascript action ?  
Like : onClick=“ChgType(Type1)”

javascript:  
function ChgType(args){  
//tell flash to execute function “ChangeType”  
}

In flash :  
ChangeType = function() {  
switch (strType) {  
case “Type0”:  
trace(“this is Type0”);  
break  
case “Type1”:  
trace(“this is Type1”);  
breack  
case …  
}  
}  
Or is there any other way ???  
Many thanks for help.
