|
Home > Archive > Macromedia Flash Server > October 2005 > Working on / Trying to find a Load Manager for SWF,
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Working on / Trying to find a Load Manager for SWF,
|
|
| Barrett 2005-10-26, 5:45 pm |
| My goal, is either to find, or mash together, a load manager that supports
FLV, SWF and JPG as well as text documents and XML.
So what I am working toward seems to be kind of an update for Bokel's
LoaderClass (08/06/2003) you can find here:
http://www.helpqlodhelp.comcombinded with the LoadQueueManager
(01/31/2004) as laid out by Michelangelo
which you can find here: http://tinlion.com/blog/?p=3D6#more-6
Now what both of these lack is handling of the preloading of FLV files, I
came up with a sequential preloader for FLV files based on the code found o=
n
LiveDocs here:
http://livedocs.macromedia.com/flas...mmon/html/wwhe=
lp.htm?context=3DLiveDocs_Parts&file=3D00001573.html
//startcode
stop();
var connection_nc:NetConnection =3D new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream =3D new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
this.createTextField("loaded_txt", this.getNextHighestDepth(), 10, 10, 160,
22);
onEnterFrame =3D function(){
download_video_1();
delete onEnterFrame;
}
download_video_1 =3D function(){
trace("Start Downloading Video: 1");
stream_ns.play("video.flv");
stream_ns.pause();
var loaded_interval:Number =3D setInterval(checkBytesLoaded, 500,
stream_ns);
function checkBytesLoaded(my_ns:NetStream) {
var pctLoaded:Number =3D Math.round(my_ns.bytesLoaded / my_ns.bytesTotal *
100);
loaded_txt.text =3D Math.round(my_ns.bytesLoaded / 1000) + " of " +
Math.round(my_ns.bytesTotal
/ 1000) + " KB loaded (" + pctLoaded + "%)";
progressBar_mc.bar_mc._xscale =3D pctLoaded;
if (pctLoaded >=3D 100) {
//stop the percent loaded check
clearInterval(loaded_interval);
//close the connection to stop downloading
stream_ns.close();
//start the next download function
download_video_2();
}
}
}
//endcode
The first problem I ran into is if I was loading a FLV while attempting to
play and load an FLV, it sucked. So on the frame where a FLV is I placed
this:
//startcode
clearInterval(loaded_interval);
stream_ns.close();
//endcode
Then if the FLV that just played was not the one that had just been stopped
from loading, reconnect and continue downloading. Else add 1 and start
downloading the next video file.
The next issue that I had was there was no video, but audio, I wanted
neither, so I did not create the video object needed to see the video, and
used this line to pause the video from playing while it was loading.
//startcode
stream_ns.pause();
//endcode
So, before I go through and chop up perfectly good code to add in FLV
support for LoaderClass and LoadQueueManager has there been any progress
since January of 2004 in this area?
I am pretty sure I need to start in this area of Bokel's class to add FLV
support, the LoadQueueManager should rely on all of Bokel's code:
//startcode
o.load =3D function(){
var loc =3D this.target;
trace("_load " + loc);
//
if( typeof( loc.load) =3D=3D 'function'){
loc.load.apply( loc, [this.sUrl].concat( this.aArgs));
} else if( typeof( loc.loadSound) =3D=3D 'function'){
loc.loadSound.apply( loc, [this.sUrl].concat( this.aArgs));
} else {
this.funcWaitUntil =3D this.waitUntilPropertiesAreInitialized;
if( this.aArgs[0].toUpperCase() =3D=3D 'POST'){
loadMovie( this.sUrl, loc, 'POST');
} else if( this.aArgs[0].toUpperCase() =3D=3D 'GET'){
loadMovie( this.sUrl, loc, 'GET');
} else {
loadMovie( this.sUrl, loc);
}
}
}
//endcode
Honestly, I'd like to keep it all AS2, but first I need to get it working,
then I'll redo it.
__________________
Thanks for any help and/or comments!
Barrett
[ http://www.sosuke.com ]
________________________________________
_______
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailma...nfo/flashcoders
| |
| András Csizmadia 2005-10-28, 5:45 pm |
| Hi,
Another load-manager example:
http://www.flashkit.com/board/showt...moviecliploader
regards,
Andrew
----- Original Message -----
From: "Barrett" <mailbin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Flashcoders mailing list" <flashcoders-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>;
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Wednesday, October 26, 2005 10:56 PM
Subject: [FlashComm] Working on / Trying to find a Load Manager for SWF,
JPG, FLV, etc
> My goal, is either to find, or mash together, a load manager that supports
> FLV, SWF and JPG as well as text documents and XML.
>
> So what I am working toward seems to be kind of an update for Bokel's
> LoaderClass (08/06/2003) you can find here:
> http://www.helpqlodhelp.comcombinded with the LoadQueueManager
> (01/31/2004) as laid out by Michelangelo
> which you can find here: http://tinlion.com/blog/?p=6#more-6
>
> Now what both of these lack is handling of the preloading of FLV files, I
> came up with a sequential preloader for FLV files based on the code found
on
> LiveDocs here:
>
http://livedocs.macromedia.com/flas...e=00001573.html
>
> //startcode
> stop();
> var connection_nc:NetConnection = new NetConnection();
> connection_nc.connect(null);
> var stream_ns:NetStream = new NetStream(connection_nc);
> my_video.attachVideo(stream_ns);
> this.createTextField("loaded_txt", this.getNextHighestDepth(), 10, 10,
160,
> 22);
> onEnterFrame = function(){
> download_video_1();
> delete onEnterFrame;
> }
>
> download_video_1 = function(){
> trace("Start Downloading Video: 1");
> stream_ns.play("video.flv");
> stream_ns.pause();
>
> var loaded_interval:Number = setInterval(checkBytesLoaded, 500,
> stream_ns);
>
> function checkBytesLoaded(my_ns:NetStream) {
> var pctLoaded:Number = Math.round(my_ns.bytesLoaded / my_ns.bytesTotal *
> 100);
> loaded_txt.text = Math.round(my_ns.bytesLoaded / 1000) + " of " +
> Math.round(my_ns.bytesTotal
> / 1000) + " KB loaded (" + pctLoaded + "%)";
> progressBar_mc.bar_mc._xscale = pctLoaded;
> if (pctLoaded >= 100) {
> //stop the percent loaded check
> clearInterval(loaded_interval);
> //close the connection to stop downloading
> stream_ns.close();
> //start the next download function
> download_video_2();
> }
> }
> }
> //endcode
>
> The first problem I ran into is if I was loading a FLV while attempting to
> play and load an FLV, it sucked. So on the frame where a FLV is I placed
> this:
>
> //startcode
> clearInterval(loaded_interval);
> stream_ns.close();
> //endcode
>
> Then if the FLV that just played was not the one that had just been
stopped
> from loading, reconnect and continue downloading. Else add 1 and start
> downloading the next video file.
>
> The next issue that I had was there was no video, but audio, I wanted
> neither, so I did not create the video object needed to see the video, and
> used this line to pause the video from playing while it was loading.
>
> //startcode
> stream_ns.pause();
> //endcode
>
> So, before I go through and chop up perfectly good code to add in FLV
> support for LoaderClass and LoadQueueManager has there been any progress
> since January of 2004 in this area?
>
> I am pretty sure I need to start in this area of Bokel's class to add FLV
> support, the LoadQueueManager should rely on all of Bokel's code:
>
> //startcode
> o.load = function(){
> var loc = this.target;
> trace("_load " + loc);
> //
> if( typeof( loc.load) == 'function'){
> loc.load.apply( loc, [this.sUrl].concat( this.aArgs));
> } else if( typeof( loc.loadSound) == 'function'){
> loc.loadSound.apply( loc, [this.sUrl].concat( this.aArgs));
> } else {
> this.funcWaitUntil = this.waitUntilPropertiesAreInitialized;
> if( this.aArgs[0].toUpperCase() == 'POST'){
> loadMovie( this.sUrl, loc, 'POST');
> } else if( this.aArgs[0].toUpperCase() == 'GET'){
> loadMovie( this.sUrl, loc, 'GET');
> } else {
> loadMovie( this.sUrl, loc);
> }
> }
> }
> //endcode
>
> Honestly, I'd like to keep it all AS2, but first I need to get it working,
> then I'll redo it.
> __________________
>
> Thanks for any help and/or comments!
> Barrett
>
> [ http://www.sosuke.com ]
>
> Supported by Fig Leaf Software - http://www.figleaf.com
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>
> --
> No virus found in this incoming message.
> Andras Csizmadia | cs.andras-J+jpbPhcmEAHWmgEVkV9KA@public.gmane.org | www.vpmedia.hu -
www.csizmadiaandras.hu
> Checked by AVG Free Edition.
> Version: 7.1.361 / Virus Database: 267.12.5/147 - Release Date:
2005.10.24.
>
>
--
No virus found in this outgoing message.
Andras Csizmadia | cs.andras-J+jpbPhcmEAHWmgEVkV9KA@public.gmane.org | www.vpmedia.hu - www.csizmadiaandras.hu
Checked by AVG Free Edition.
Version: 7.1.361 / Virus Database: 267.12.5/147 - Release Date: 2005.10.24.
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
|
|
|
|
|