Welcome to my Actionscript tutorial on javascript functions...
Your probably thinking WTF? so let me explain.
In AS using the getURL function you can run javascript functions!
heres an example:
on(press){
getURL("JavaScript:alert('hello');");
}
this can also be used for functions that have been defined in the <head> section of a html webpage if the SWF is also in the webpage.
for example:
The HTML Page HEAD Section:The SWF MUST be embedded in the same page.
<head>
<script>
function displayAnnoyingAlerts() {
alert('hello')
alert('how are you today?')
alert('bibi')
}
</script>
</head>
Javascript trigger button's AS:
on(press){
getURL("JavaScript:displayAnnoyingAlerts()
;");
}
The possibilities are endless!
Related Tutorials:
Pop Ups
The AS Reference
Report any errors!