Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
onLoadProgress() question

onLoadProgress() question

2004-03-02       - By rise4peace@(protected)

 Back
Reply:     1     2  

Hello,

I am trying to build a generic preloader in Flash MX 2004 professional for an
online scrapbook i am putting together for a family event. I've looked at many
tutorials online and I am still a little in the dark as to how I can implement
onLoadProgress.

One tutorial that I read used the onLoadProgress as part of the movieClipLoader
while another used the onLoadProgress as part of a listenerObject. Is one way
better than the other?

The part that I am still missing is exactly how to tap into the bytesloaded and
bytestotal information of the onLoadProgress call and have it be displayed
dynamically within a text field.

I currently have three layers. An actions layer, a mc layer, and a text layer.
The 'actions' layer has the following code on frame 1:

var myImage:MovieClipLoader = new MovieClipLoader();
var listenerObject:Object = new Object();

listenerObject.onLoadComplete = function() {
status_txt.text = (" -- onLoadComplete");
myMC1._width = 170;
myMC1._height = 170;
};

listenerObject.onLoadProgress = function() {
status_txt.text = (" -- onLoadProgress");
var stats:Object = myImage.getProgress(myMC1);
progress_display_txt.text = ("bytesLoaded: "+stats.bytesLoaded+" of "+stats
.bytesTotal);
};

myImage.addListener(listenerObject);
myImage.loadClip("http://www.rise4peace.com/DSCN0092.JPG", myMC1);

The 'mc' layer has an empty movieclip instance named "myMC1" and the 'text'
layer has two dynamic text fields named "progress_display_txt" and "status_txt"
respectively.

When I export the movie and drag it into an IE window nothing happens. I would
assume, based upon the code that I would've seen the following:

1.) progress_display_txt field would dynamically update to show the bytes text
as the myMC1 movieclip is being loaded.
2.) when the myMC1 has finished loading it would be displayed within the myMC1
instance on stage with a height and width of 170 pixels.

Unfortunately neither of these things are occuring and I am very stumped as to
why. Any pointers or tips would be very greatful.

Best Regards,

rise4peace



-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Supported by Fig Leaf Software
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Lower Prices for Certified Training! Check out new lower prices for
Certified Macromedia Training from Fig Leaf Software. Expand your
skill set with courses in ColdFusion, Flash, Rich Internet
Applications and .NET in the new year.  Fig Leaf Software provides
the highest caliber instruction at our training centers in Washington
D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at
your location.

Get the details at http://training.figleaf.com/
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe, e-mail: flashnewbie-unsubscribe@(protected)
For additional commands, e-mail: flashnewbie-help@(protected)