Photoshop Tutorials, Flash Tutorials, 3Ds Studio Max Tutorials, Web Design Tutorials |
![]() |
|
:: Free Website Templates
Welcome To WebDesignTutorials.net Flash Tutorials Area - Checking if a file exists
Sometimes
it is necessary to determine if a file exists using actionscript, for
example when you have a preloader cue, that loads a series of .jpgs one
after another, if one of the files doesnt exist then the cue wouldnt
traverse any further, you could of course use a timeout in that
scenario but why not just check if the file exists before loading it,
so that if necessary you can move onto the next item in the cue almost
instantly. It is possible to determine whether a file exists using the
success parameter of the onLoad event handler, the problem lies in the
fact that the onLoad event handler for movieclips doesnt work, so to
check if an .swf file exists, or an image, you will need to use this
method...
Here is a little example, that checks to see if a .swf file exists, and if it does, then it loads it into a movieclip.
fileExists=new LoadVars();
fileExists._parent=this; fileExists.onLoad=function(success) { //success is true if the file exists, false if it doesnt if(success) { //the file exists var nm=this._parent.createEmptyMovieClip("swfHolder",1); //so create a movieclip nm.loadMovie("myfile.swf"); //and load our .swf file into it } } fileExists.load("myfile.swf") //initiate the test
Author: Guy Watson
|
|
|||||||||||||||||||||||||||||||||
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 |