[Flashcoders] re: preloading images from xml

2007-06-13 Thread Poole, Simon
Hi

Im having an issue with the following code. It is tracing the individual
thumbnail images correctly with the onLoadProgess function, but will only
display the percent loaded and loadbar for the last image (image 10), once
this one has preloaded, all the other images then appear correctly.

I would like it to preload all 10 images, displaying the percent and loadbar
for all 10.

The thumbnails images are buttons for a flv video player.

Ive been trying to fix this for ages and can sort it, its doing my head in!

Any help would be greatly appreciated.

Ty

s

/

var newClip:MovieClip =
vidbutn.holder_mc.createEmptyMovieClip(thumbie+(i+1),
this.getNextHighestDepth());
var myLoader:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();

myListener.onLoadProgress = function (target:MovieClip,
bytesLoaded:Number, bytesTotal:Number):Void {
trace(target + .onLoadProgress with  + bytesLoaded +  bytes of 
+ bytesTotal);
vidbutn.holder_mc.infoField =
Math.floor(bytesLoaded/bytesTotal*100)+%;
if (bytesLoaded != bytesTotal) {
vidbutn.holder_mc.loadBar._yscale =
Math.floor(bytesLoaded/bytesTotal*100);
/*return;*/
}
if(bytesLoaded == bytesTotal) {
vidbutn.holder_mc.gotoAndPlay(2);
}
}
myListener.onLoadInit = function (target:MovieClip):Void {
//trace (target + .onLoadInit);
}
myLoader.addListener(myListener);
myLoader.loadClip(myRoot+thumbPath+thumbList[i], newClip);

/


--
Simon Poole ­ Group E-Commerce

Littlewoods Shop Direct Group

e: [EMAIL PROTECTED]
--



*

This email and its attachments are confidential and are intended for the above 
named recipient only. If this has come to you in error, please notify the 
sender immediately and delete this email from your system. You must take no 
action based on this, nor must you copy or disclose it or any part of its 
contents to any person or organisation. Statements and opinions contained in 
this email may not necessarily represent those of Littlewoods Shop Direct Group 
Limited or its subsidiaries. Please note that email communications may be 
monitored. The registered office of Littlewoods Shop Direct Group Limited is 
1st Floor, Skyways House, Speke Road, Speke, Liverpool, L70 1AB, registered 
number 5059352

*




This message has been scanned for viruses by BlackSpider MailControl - 
www.blackspider.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] RE: preloading images from xml

2007-06-13 Thread Jack Doyle
You could try using the PreloadAssetManager class at
http://www.greensock.com/ActionScript/PreloadAssetManager 

Jack


-Original Message-
Date: Wed, 13 Jun 2007 16:17:42 +0100
From: Poole, Simon [EMAIL PROTECTED]
Subject: [Flashcoders] re: preloading images from xml
To: flashcoders@chattyfig.figleaf.com
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain;   charset=ISO-8859-1

Hi

Im having an issue with the following code. It is tracing the individual
thumbnail images correctly with the onLoadProgess function, but will only
display the percent loaded and loadbar for the last image (image 10), once
this one has preloaded, all the other images then appear correctly.

I would like it to preload all 10 images, displaying the percent and loadbar
for all 10.

The thumbnails images are buttons for a flv video player.

Ive been trying to fix this for ages and can sort it, its doing my head in!

Any help would be greatly appreciated.

Ty

s

/

var newClip:MovieClip =
vidbutn.holder_mc.createEmptyMovieClip(thumbie+(i+1),
this.getNextHighestDepth());
var myLoader:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();

myListener.onLoadProgress = function (target:MovieClip,
bytesLoaded:Number, bytesTotal:Number):Void {
trace(target + .onLoadProgress with  + bytesLoaded +  bytes of 
+ bytesTotal);
vidbutn.holder_mc.infoField =
Math.floor(bytesLoaded/bytesTotal*100)+%;
if (bytesLoaded != bytesTotal) {
vidbutn.holder_mc.loadBar._yscale =
Math.floor(bytesLoaded/bytesTotal*100);
/*return;*/
}
if(bytesLoaded == bytesTotal) {
vidbutn.holder_mc.gotoAndPlay(2);
}
}
myListener.onLoadInit = function (target:MovieClip):Void {
//trace (target + .onLoadInit);
}
myLoader.addListener(myListener);
myLoader.loadClip(myRoot+thumbPath+thumbList[i], newClip);

/




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com