SlideShare a Scribd company logo
Flash MX tutorial
Preloader v2.1
Jukka Paasonen
paazio@nic.fi
4/2/2004
1(4)
This tutorial is based on the Lightray tutorial. All the necessary information is in this tutorial,
but if you wish to have a good looking animation while loading, do first the Lightray tutorial
compelitely
Open new flash document and give the following properties to it:
width : 550px
height : 385px
background : #002244
Create new layer and name your layers as “koodit” and “loading”.
Make a keyframe to the third frame of the “koodit” layer. Also add an empty keyframe to
frame 4 in the “loading” layer.
Add the following code to “koodit” layer, frame 3:
allbits = _root.getBytesTotal();
nowbits = _root.getBytesLoaded();
rightnow = nowbits / allbits;
if ( rightnow < 1 ) gotoAndPlay(1);
else gotoAndStop(5);
Flash MX tutorial
Preloader v2.1
Jukka Paasonen
paazio@nic.fi
4/2/2004
2(4)
What happens there, is this:
_root presents the main part of the flash which includes everything in your flash
getBytesTotal size of the flash in bytes
getBytesLoaded size of the part what havebeen loaded to user
rightnow our variable which is always under or exactly one
This makes the movie repeat the loading intro until the movie is compeletely downloaded.
To show how much is loaded to the user, create a dynamic text in the “loading” layer. Make it
variable “kukkuu”. Align it to right so it wont jump.
Add a line in the code, after rightnow = nowbits / allbits;
kukkuu = Math.floor(rightnow*100) + ‘%’;
Flash MX tutorial
Preloader v2.1
Jukka Paasonen
paazio@nic.fi
4/2/2004
3(4)
Math.floor() is a mathematic function which parses the numbers after the decimal point.
To test the functionality of the movie, place something big on the end of the “loading” layer.
For example a big picture, about 1 megabyte.
Test the movie. Select a slow connection speed from Debug. Select Show streaming from
View.
Flash MX tutorial
Preloader v2.1
Jukka Paasonen
paazio@nic.fi
4/2/2004
4(4)
Now you are able to see if the preloader works like we wanted it.
It does. To make it load more quickly or more slowly, adjust the connection speed from
Debug.

More Related Content

PPTX
Nimbix execution steps and sample exercise
PPT
Create docker image with bluemix dev ops
PPT
Simple Java component in Mule
PDF
Deep Dive into FME Server 2017.0
PDF
Actionscript 3 with FlashDevelop3
PDF
Two Caged Tigers
PPT
Educating The Next Generation Of Translation And Interpreters
PPT
Powerpoint Opdracht 2
Nimbix execution steps and sample exercise
Create docker image with bluemix dev ops
Simple Java component in Mule
Deep Dive into FME Server 2017.0
Actionscript 3 with FlashDevelop3
Two Caged Tigers
Educating The Next Generation Of Translation And Interpreters
Powerpoint Opdracht 2

Viewers also liked (13)

PPT
Vette Klei
PDF
Flash MX Tutorial - Tweens
PPT
Speedpresentatie Geavanceerd Zoeken
ODP
Testing In Java4278
PDF
Flash MX Tutorial - How to use different layer types
PPTX
Welcom online
PDF
Tekko Process 2003 Autumn
PDF
Design implementation imporovements with QML
PPT
Pfizer
PDF
Flash MX Tutorial - Big wave
PDF
Flash MX Tutorial - Scrolling content
PPT
What Every Translator Should Know About Software Localization
PPT
Mixing Computer-Assisted Translation and Machine Translation
Vette Klei
Flash MX Tutorial - Tweens
Speedpresentatie Geavanceerd Zoeken
Testing In Java4278
Flash MX Tutorial - How to use different layer types
Welcom online
Tekko Process 2003 Autumn
Design implementation imporovements with QML
Pfizer
Flash MX Tutorial - Big wave
Flash MX Tutorial - Scrolling content
What Every Translator Should Know About Software Localization
Mixing Computer-Assisted Translation and Machine Translation
Ad

Similar to Flash MX Tutorial - Preloader (20)

PDF
Flash tutorials loading external images
DOCX
Flash, actionscript 2 : preloader for loader component.docx
PDF
Flashmx Tutorials
PDF
Flash, actionscript 2 : preloader for loader component.pdf
PPTX
macromedia interface report.pptx reports
PPT
ARTDM 170, Week 16: Publishing
PPT
Dense And Hot 360 Flex
PPTX
Flash Development Guide
PDF
fpadvanced
PDF
Flash cs4 tutorials_2009
PPT
Dense And Hot Web Du
PDF
flash-flv
PDF
flash-flv
PPT
Flash 101
PPT
PPT
Another Test
PPT
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
PPTX
Tips and Tricks for Mobile Flash Development
PDF
Introduction to Flash
DOC
Module 0 introduction (enhanced)
Flash tutorials loading external images
Flash, actionscript 2 : preloader for loader component.docx
Flashmx Tutorials
Flash, actionscript 2 : preloader for loader component.pdf
macromedia interface report.pptx reports
ARTDM 170, Week 16: Publishing
Dense And Hot 360 Flex
Flash Development Guide
fpadvanced
Flash cs4 tutorials_2009
Dense And Hot Web Du
flash-flv
flash-flv
Flash 101
Another Test
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
Tips and Tricks for Mobile Flash Development
Introduction to Flash
Module 0 introduction (enhanced)
Ad

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Encapsulation theory and applications.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Machine Learning_overview_presentation.pptx
PPTX
Spectroscopy.pptx food analysis technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Machine learning based COVID-19 study performance prediction
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Cloud computing and distributed systems.
PDF
Electronic commerce courselecture one. Pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Programs and apps: productivity, graphics, security and other tools
Encapsulation theory and applications.pdf
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25-Week II
Machine Learning_overview_presentation.pptx
Spectroscopy.pptx food analysis technology
The AUB Centre for AI in Media Proposal.docx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Chapter 3 Spatial Domain Image Processing.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Machine learning based COVID-19 study performance prediction
A comparative analysis of optical character recognition models for extracting...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
A Presentation on Artificial Intelligence
MIND Revenue Release Quarter 2 2025 Press Release
Cloud computing and distributed systems.
Electronic commerce courselecture one. Pdf

Flash MX Tutorial - Preloader

  • 1. Flash MX tutorial Preloader v2.1 Jukka Paasonen paazio@nic.fi 4/2/2004 1(4) This tutorial is based on the Lightray tutorial. All the necessary information is in this tutorial, but if you wish to have a good looking animation while loading, do first the Lightray tutorial compelitely Open new flash document and give the following properties to it: width : 550px height : 385px background : #002244 Create new layer and name your layers as “koodit” and “loading”. Make a keyframe to the third frame of the “koodit” layer. Also add an empty keyframe to frame 4 in the “loading” layer. Add the following code to “koodit” layer, frame 3: allbits = _root.getBytesTotal(); nowbits = _root.getBytesLoaded(); rightnow = nowbits / allbits; if ( rightnow < 1 ) gotoAndPlay(1); else gotoAndStop(5);
  • 2. Flash MX tutorial Preloader v2.1 Jukka Paasonen paazio@nic.fi 4/2/2004 2(4) What happens there, is this: _root presents the main part of the flash which includes everything in your flash getBytesTotal size of the flash in bytes getBytesLoaded size of the part what havebeen loaded to user rightnow our variable which is always under or exactly one This makes the movie repeat the loading intro until the movie is compeletely downloaded. To show how much is loaded to the user, create a dynamic text in the “loading” layer. Make it variable “kukkuu”. Align it to right so it wont jump. Add a line in the code, after rightnow = nowbits / allbits; kukkuu = Math.floor(rightnow*100) + ‘%’;
  • 3. Flash MX tutorial Preloader v2.1 Jukka Paasonen paazio@nic.fi 4/2/2004 3(4) Math.floor() is a mathematic function which parses the numbers after the decimal point. To test the functionality of the movie, place something big on the end of the “loading” layer. For example a big picture, about 1 megabyte. Test the movie. Select a slow connection speed from Debug. Select Show streaming from View.
  • 4. Flash MX tutorial Preloader v2.1 Jukka Paasonen paazio@nic.fi 4/2/2004 4(4) Now you are able to see if the preloader works like we wanted it. It does. To make it load more quickly or more slowly, adjust the connection speed from Debug.