AS: Main
This tutorial might be handy for those that have a website and want to mix some JavaScript with your Flash.
As you might know, Flash can work with other programing languages as PHP, as CGI. Well, it also works with Javascript.
Javascript is one of the easiest languages out there. In fact, it's almost as much easy as ActionScript is.
I'll try to post tutorials related to how to mix Flash with Javascript, since I'm good with it. :)
------------------------------------------
---------
Popup Window with Flash:
First, let's see the JavaScript code that will help us with it.
This code will go in the header of your page. ( Between the <head> </head> ) Open your HTM file with your HTML editor. You can even open it with your Notepad. I normally open it with this one, because it loads quick.
This is the code:
<SCRIPT LANGUAGE="JavaScript">
function popup() {
window.open('popup.html','','toolbar=no,lo
cation=no,directories=no,status=no,menubar
=no,scrollbars=no,resizable=no,width=550,h
eight=400,left=0,top=0');
}
</script>
This will "call" the page popup.html (Change the name for yours)
The page won't have menubar, toolbar, scrollbars and won't be resizable. It's perfect for a popup window where you want to put a Webcam or to launch an animation inside.
Now, the Javascript function is read. All what we need now is the "caller"
The caller in this case will be a Flash button.
Open your Flash, make a nice button for it and add it this Actionscript:
on (release) {
getURL("JavaScript:window();");
}
Now, add the Flash animation to the same page where we put the Javascript function.
Now, the caller is set and the work is done :)
If you have a question about this tutorial, feel free to post here and/or E-mail me. If you have more questions about ActionScript, check the 'AS: Main'