Photoshop Tutorials, Flash Tutorials, 3Ds Studio Max Tutorials, Web Design Tutorials


Software Tutorials

Featured Free Templates
View All Templates!
Preview  |  Download
Name: metamorph_flame
Downloads:
Preview  |  Download
Name: metamorph_skyandclouds
Downloads:
View All Templates!
Recommended Hosting:
Host Unlimited Domains on 1 Account
1500GB storage and 15000GB bandwidth for $6.95/mo!
Recommended Hosting:
Host Unlimited Domains on 1 Account
1500GB storage and 15000GB bandwidth for $6.95/mo!
:: Free Website Templates
Preview  |  Download Preview  |  Download Preview  |  Download
Name: metamorph_sunset Name: metamorph_flower Name: metamorph_waterfall
Downloads: Downloads: Downloads:

Do You Like Our Website? Share With Others!
GoogleGoogle slashdotYahooMyWebDiggTechnoratiDelicious
Page: 12345678910111213141516171819202122232425

Welcome To WebDesignTutorials.net Flash Tutorials Area - Flash and Java Script


------------------------------------------------
Download Flash File
Learn how to make flash communicate with javascript.

Picture 1
Step In order to have flash communicate with javascript there needs to be some javascript in an html file with an embedded shockwave file (.swf). So we are first going to create our flash movie and then work on the javascript. First, create a new Flash Movie. We are simply going to create some text and place a couple of invisible buttons so that we can interact witht the javascript. Like the example, make two static textboxes. One that says fullscreen and the other that says fixed size.

Picture 2
Step Once we have the text we need to add the buttons. Add an invisible button over each of your texboxes. If you don't understand how to make an invisible button, there is a tutorial I wrote for spoono that will explain it, but basically you make a button that only has a hit state. The up, down, and over states are left empty.

Step Lastly we need to add the code to each of the buttons that we will be using to address the javascript. On the button that you placed over your "fixed size" textbox place the following code:
  on(press) {
	getURL("javascript:fixedSize('http://www.spoono.com', 
	'', 'menubar=0, tollbar=0, scrollbars=yes, 
	resizable=0, width=800 height=600')"); 
  }
  
Now on the button that was laid over the fullscreen text place the following code:
on(press) {
	getURL("javascript:fullScreen()");
}
  
*NOTE: Type everything between the brackets on one line. I had to break it up to fit on this page. What we are doing here is calling the fixedSize function and the fullScreen function respectively from javascript by using the built in getURL() function in Flash. This makes it possible for us to call any javascript function that we have declared in the head tags of our html file.

Picture 4
Step Now that our buttons are setup we need to write the javascript. First you need to save your flash movie. Next you need to publish your flash movie so that we will get an html file. Hit shift F12, and this will export an swf and make an html file that has the flash movie embedded in it to the directory that you saved your flash file in. Open up the html file in dreamweaver, notepad or your favorite text editor and add the following code in between the head tags inside of script tags:
function fixedSize(url,name,features) {
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	win = window.open(url,name,features);
}
function fullScreen() {
	window.open ('http://www.spoono.com', 
	'','fullscreen=yes')
}
  
Here we have two functions. One is the fixedSize function that will open up a browser based on the three variables, url, name, features, that will be passed in using flash. The other is a a fullScreen function that will open up a browswer window at fullscreen. I will not go into detail about the javascript because this is just to show how flash can communicate with Javascript, however if you have any questions please refer to the javascript section of Spoono for some really informative tutorials.

Step Now all you need to do is save your html file and you will be good to go. Don't forget that this file will not work if you open up the .swf. You need to open the .html file so that flash knows what javascript functions to run. If you open the .swf and try it you will get a blank browswer window.

Step Where to go from here. Hopefully you saw how easy it was to incorporate javascript with flash. There are almost limitless possibilites in how to incoroporate this with your movies. Javascript is a very powerful webprogramming tool and when incorporated with Flash you can get some really neat effects. Be sure to email me if you have any questions or commments about this tutorial.

Advertisements
Graphic Software, Flash Templates, Free Stock Photos, Web Templates, Web Design, Corporate Web Design, Royalty Free stock Photo, Affordable Website Design, Submit site, Add Url, Stock Photos, Survey Software, Anti Virus Software, E mail software, Computer Software

Premium Partners
  Free Website Templates - Flash templates, Affordable Website Design, Website Templates, Website Redesign, Custom Website Design, Web Design Tutorials, Flash Tutorials, Promotion Tutorials - that is what we do. Metamorphosis Design Studio offers quality, free and low cost web site templates for your business and personal life, we also offer affordable web design and site re-design.
  Vertex Website Tempales - It saves tones of time and money to use pre-made web designs to build your web site. You need a web site but you don't want to pay thousands dollars to professional web design companies? Our web templates is just for you! They are designed to be easilly edited by your favorite html editor, like MS FrontPage
  Photoshop Tutorials - Learn how to build stunning web pages using Adobe Photoshop, Macromedia Flash MX and 3D Studio Max software. The step-by-step approach makes it so easy, that even beginners can produce great web pages. Get started with these tutorials covering everything from page layout to content tips.
Free website templates and paid web templates are great tools to make your websites look perfect! You will save time and money with our flash templates and free website templates Our visitors are satisfied with the quality of our free and paid website templates! Please visit our free website templates and paid website templates sections. We offer free web templates, free web layouts, free web page templates and other stuff for free download. All templates come with the html and external css file so you may easily edit HTML with your favorite HTML editor. Feel free to download our free web templates for your personal websites.

Terms of use depend upon the website template vendor.
Home  |  Submit Tutorial  |  Top Sites  |  Free Templates  |  Website Templates  |  Privacy Policy  |  Contact Us
All Right Reserved by WebDesignTutorials.net