Flash CS3, CS4 Tutorial, Preloader
Flash CS4 Tutorials
Links to Some Great Flash CS4 Tutorials and Flash Games
- IT Admin
IT Admin is you home for all computer related issues. Stop by and check out what is going on in the it world from a real it professional. - Flash CS4 Tutorials
Adobe Flash CS4 And CS3, The Information you really need is a website and ebook deidcated to provideing quality Flash CS4 Tutorials. - Flash CS3 Tutorials
Gordon French is a Flash Developer. You have found His Free Flash CS3 Tutorials - Flash CS4 Tutorial, Preloader
ActionScript 3.0 Tutorial on how to make preloader.
Flash CS4 Tutorial on making a PreLoader
Users hate to wait, and there is a good chance the will leave your site without every actually seeing your hard work if your site takes to long to load. In this Flash CS4 Tutorial, I am going to show you how to make a Preloader using ActionScript 3.0. A Flash CS4 Preloader will tell users to be patient the site as working and will finish loading soon. A Flash CS4 Preloader is reassuring to the user, where as a blank white screen is scary. Often a user will feel that a blank white screen means that a site is broken. And why should a user wait for a broken site if they can just go somewhere else. The trick to keep the user from leaving is to simply use actionscript to create a short, simple, fast loading, animation that entertains the user. ActionScript Preloaders need to be small. Preloaders need to load quickly or there is no real point in creating one. So remember a simple nice looking preloader will work better then a fancy complex animation.
The concept of a Flash CS4 Preloader is rather simple. You tell Flash using ActionScript to compare the amount of data loaded with the total data in the movie. Then as this comparison value changes go do something, in the case of this Flash CS4 Tutorial that something is to fill a box.
Let get this Flash CS4 Tutorial under way, by download the source files. As normal in this Flash CS4 Tutorial some of the work has been done for you. You should see that the layer panel in the main time line looks like the example below. You should take note of the layers panel. You will see an object named and labeled bar_mc. That object is the magic behind this Flash CS4 Tutorial. First thing you need to do is to add a stop(); tag to the first key frame in the actions layer. The stop(); tag is so that the movie(swf) will stop at this point until we tell it to do something. In this Flash tutorial we want the time line to stop here until the preloader has finished.
Stop(); root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressAction);
Now you need to add the code from the example. Stop(); should already be there if your following along with this Flash CS4 Tutorial. By coping this code you are adding an event listener to the root time lines loaderInfo property. And then you are telling Flash to listen for the progress of that event. Basically, you are telling flash to track what on the main time line has loaded and whenever something is being loaded call the function progressAction.
Next, in this Flash CS4 Tutorial we will define the function progressAction. On the next line in the actions panel lets create the function progress action. Copy and Paste the following:
function progressAction(yourEvent:ProgressEvent):void {
var yourProgress:Number=yourEvent.target.bytesLoaded/yourEvent.target.bytesTotal; bar_mc.scaleX=yourProgress; myTextField_txt.text = Math.round(yourProgress*100)+"%"; };
If you have completed my other Flash CS4 Tutorials then the first line should be very familiar. If not what you have done is created the function called progressAction given it the parameter of ProgressEvent then voided the data type. What may not be as apparent are the next few lines. First you are creating a variable called yourProgress data typing it as a Number then setting it equal to something. In this Flash Tutorial that something is the amount of bytes loaded. The rest of the line is a property of Flash, I'm just giving you the code to access it.
On the next line we access the magic of the bar_mc. This is really cool so pay attention. All you are going to do is set the width of bar_mc = to yourProgress. That means that when nothing has loaded the width of bar_mc is equal to 0. Ok, so it isn't magic but it sure seems to be magic to those that do not know how to do it. In the last we are going to add the text to myTextField_text. You need to use Math.round() so that you get a whole number and not something like .3435346523862334 multiply it by 100 because bytes loaded comes in as a decimal with 1 being fully loaded. If you want to check it add a trace tag. +"%" simply adds the percent sign to the end of the number.
So, you now have a bar that grows with the amount of data loaded in the main time line, but nothing else happens. You need to make the movie play when the function progressAction is finished. There are several ways to do make Flash CS4 do something when it has finished loading. First, I'm going to show you the simplest way. You can simply add an if statement that checks to see when yourProgress is equal to or greater then 1. If yourProgress is greater or equal to one then play.
myTextField_txt.text = Math.round(yourProgress*100)+"%"; if if (yourProgress >= 1){ play(); }
Or add the following code, after your current function.
root.loaderInfo.addEventListener(Event.COMPLETE, finished); function finished(yourEvent:Event):void { play(); };
After you decide which method you want to use you can press Control-Enter to test your movie.
If this Flash CS4 Tutorial isn't working for you it is most likely because you are testing from you local machine and the file is already loaded. You need to use a few features of the Flash Player to test your preloader. First, you may want to turn on the bandwidth profiler. Press Control-B or View / Bandwidth Profiler.
For your preloader to work you need to adjust the Download setting. Go to View / Download Settings normally I chose DSL but feel free to set your simulation to whatever you want. Last step is to Press Control-Enter or View / Simulate Download. The first time you pressed Control-Enter was in Flash to render or publish the swf. The second time you press Control-Enter is in the actual swf, and this time you start the download sequence. Continue Smiley
Congratulation, you have a preloader. Feel free to modify the code in anyway. Think about changing alpha, rotation and/or just about any property Flash has and by all means send your friends links to my web site. FrenchSquared.com
Download Source Files
Links to a few of My Favorite Flash CS4 Web Sites
- http://worldvillage.com/what-is-house-arrest
1 reviews - 3 months ago
- MusicPlayer
1 reviews - 11 months ago
IT Admin, everything computer related
- CSS, How to understand inline and block level elements.
Block level elements are normally displayed as blocks with line breaks before and after. Examples of block level elements include paragraphs, headings, divs and block quotes. Inline elements are... - 2 years ago
- CSS, How To tweak css for only Safari?
If you have spent anytime dealing with CSS you have run into issues with a browser rendering code incorrectly. You may even have gone as far as to make several style sheets and use a browser check... - 2 years ago
- CSS, How to Hide Styles from Older Browsers?
Some older browsers, such as Netscape Navigator 4 and IE 4, have poor support for CSS. It is possible to hide styles from these browsers using specific media types and @import rules. All styles will... - 2 years ago
- CSS, How to use @import styles
@import Styles? Header and external style sheets also can import other style sheets using the @import rule. The @import rule must be placed before all other rules in the header or external style... - 2 years ago
- CSS, How to use External Style Sheets!
The third method of applying styles to document involves linking to external style sheets. External style sheets are the most appropriate method for styling documents. If styles need to be... - 2 years ago
- CSS, How to Use Header Styles
Header styles also can be used to style the <p> element. The CSS rules can be placed in the head of the document using the style element. Like inline styles, header styles, header styles... - 2 years ago
- CSS, How to Apply Inline Styles.
CSS, Inline styles can be applied directly to elements in the HTML code using the style attribute. However, inline styles should be avoided wherever possible because the styles are added to the HTML... - 2 years ago
- Twitter Weekly Updates for 2009-08-09
New blog post: CSS, What is a <div> http://bit.ly/Sbfu # Flash, ActionScript tutorials on loops http://bit.ly/QMq8t # Great PHP Tutorial on using include and require. Include is a great way... - 2 years ago
CSS How To
- CSS Howto For Web Accessibility and Search Engine Optimization
Because of the Internet’s rapid growth, disability discrimination legislation, and the increasing use of mobile phones and PDAs, it is necessary for Web content to be made accessible to users operating a wide variety of devices. Today, CSS how to … Continue reading → - 8 months ago
- Adobe Dreamweaver CS3 How-Tos: 100 Essential Techniques
Adobe Dreamweaver CS3 How-Tos: 100 Essential Techniques Adobe Dreamweaver CS3 is more than just the world’s most popular and powerful Web design tool: As part of Creative Suite 3 (which includes Photoshop CS3 and Flash CS3), it’s a key component … Continue reading → - 8 months ago
- Adobe Digital Imaging How-Tos: 100 Essential Techniques for Photoshop CS5, Lightroom 3, and Camera Raw 6 Reviews
Adobe Digital Imaging How-Tos: 100 Essential Techniques for Photoshop CS5, Lightroom 3, and Camera Raw 6 ISBN13: 9780321719874 Condition: New Notes: BRAND NEW FROM PUBLISHER! 100% Satisfaction Guarantee. Tracking provided on most orders. Buy with Confidence! Millions of books sold! … Continue reading → - 8 months ago
- CSS How to MAKE A website for free and make online money
This is CSS how to make a website and make online money. 1. Buy a Domain (this is the name of your website for instance, mywebsite.com, mywebsite.net or mywebsite.org) 2. Buy a Webhost You can buy a domain and webhost … Continue reading → - 9 months ago
- Using the Dreamweaver CS5 HTML5 Pack to Create CSS3 Transforms and max tutorial
Today, CSShowto.us will give you an article about Using the Dreamweaver CS5 HTML5 Pack to Create CSS3 Transforms and max tutorial. Many effects that used to require JavaScript, Flash, or using images to convey stylized type can now be implemented … Continue reading → - 10 months ago
- CSS Howto : Tableless Web Design
As we know, HTML was originally designed as a semantic markup language intended for sharing scientific documents and research papers online. So, CSS howto give you information about tableless web design. However, as the Internet expanded from the academic and … Continue reading → - 10 months ago
Comments
It would be great if you can provide some source files to download, for practice :)
hey guys check this out !! http://www.flashcs4tutorials.com/Flash_CS4_Tutoria
same tutorial. i think these people copy it from them. there is download files with above link. but it is not for free !! :-(
It isnt copied when it is the same writer. These hub pages are just meant to help user find the main tutorial site. All Tutorials are free, however the source files are not. The source files range from $1.98 to $3.98
is there another script that works the same way but is simpler and causes less coding syntax errors
aaaarrgghhhhh
poor formatting has ruined what would otherwise be a simple and easy tutorial
ilike2 3 years ago
Interesting tutorial