Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Preloading .flv File In Flash 8


Hi...

I've been racking my brain over finding a preloader for an flv movie that I have. The flv file is 36 megs and 9 minutes long. I'd like to have a preloader to this movie before it starts and not a buffer. I've looked everywhere and came up with one viable solution and it doesn't work. I used this Link from the adobe web site and it preloads just fine and the flv audio starts playing, but all I see is a white screen. Is there a way to make the preloader dissappear after it's done loading? Is there some other way of making a preloader that is simplier? Here's the code in case you don't want to click the link:

Code:
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
stream_ns.play("http://www.helpexamples.com/flash/video/typing_short.flv");

this.createTextField("loaded_txt", this.getNextHighestDepth(), 10, 10, 160, 22);
this.createEmptyMovieClip("progressBar_mc", this.getNextHighestDepth());
progressBar_mc.createEmptyMovieClip("bar_mc", progressBar_mc.getNextHighestDepth());
with (progressBar_mc.bar_mc) {
beginFill(0xFF0000);
moveTo(0, 0);
lineTo(100, 0);
lineTo(100, 10);
lineTo(0, 10);
lineTo(0, 0);
endFill();
_xscale = 0;
}
progressBar_mc.createEmptyMovieClip("stroke_mc", progressBar_mc.getNextHighestDepth());
with (progressBar_mc.stroke_mc) {
lineStyle(0, 0x000000);
moveTo(0, 0);
lineTo(100, 0);
lineTo(100, 10);
lineTo(0, 10);
lineTo(0, 0);
}

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) {
clearInterval(loaded_interval);
}
}
Any help is appreciated... Thanks




FlashKit > Flash Help > Flash ActionScript
Posted on: 05-18-2006, 02:18 AM


View Complete Forum Thread with Replies

Sponsored Links:

Preloading A Flash File While Another Is Playing
Let's say I have about 10 swf files that make a whole presentation and each is about 400-700k. Is it possible to play one of the files then have the next file load while the first one is playing, then play, then have the next one load ect. If it is possible will it effect the playback of the file that is playing? Your help on this matter is much appreciated!

View Replies !    View Related
Preloading A Separate Swf File In Flash 5?
Ok what I have is a preloader in it's own swf, preloader.swf, what I want to do is have that preloader load a seperate swf, Intro.swf. So once the preloader.swf has loaded the Intro.swf the preloader will be taken over by the intro.swf which will play through the intro.


Code:
this.attachMovie("empty_mc","mainMovie_mc",1);
mainMovie_mc.loadMovie("FLA_Intro.swf");
this.onEnterFrame = function()
{
var percentLoaded = mainMovie_mc.getBytesLoaded()/mainMovie_mc.getBytesTotal()*100;
preloaderbar.bar._xscale = percentLoaded;
if (percentLoaded >= 100 && mainMovie_mc.getBytesTotal() > 40)
{
this.onEnterFrame = undefined;
// Hide the preloader bar etc
preloaderbar._visible = false;
helix._visible = false;
// play the loaded movie
mainMovie_mc.play();
}
}
stop();
I was told this should work for what I am trying to do but all it does in test streaming is continuously play the intro and doesn't load anything? I am using flash 5.

View Replies !    View Related
Preloading Movie Clips In A Flash File
Hello everyone,

I just wanted to know how to load movie clips within an existing flash movie. I'm making a portfolio website and i want to include hi-res images but don't want to include it in the initial flash file because the load time to be too great. Instead I want to have a gallery that people can click on and have the individual pictures load up with its own preloader IN THE SAME PAGE. I was thinking that it has something to do with linking a seperate .swf file. The problem is just making it load withing the already loaded website.

A few examples:
http://www.noblephoto.com/puccigirl.html
http://www.jimmymcgrathphoto.com/
http://www.kennethwongphotography.com/

I'm guessing its just taking the inital "picture" of the page and including it in the preloader page so it looks like you're on the same page but its really not.. but I'm not so sure.

If anyone has any suggestions as to how I can go abouts doing this, that would be great!

Thanks,
Ryan

View Replies !    View Related
[MX04] Preloading Your Main Swf File In A Seperate File
hey there

Almost all of my flash files now use a lot of scripting and exported objects on the first frame of my main movie file, often resulting in a large weighted file on frame 1 i.e say 100-150k.

Is there a reliable way to preload this swf file? Having a standard preloader on frame one just results in a large download before you even get to see the preloader.

I would have thought its possible to have a base layer then load the main movie on a new level, but then all my _root paths would need amending, and its just not the easiest way for me to work.

I guess in an ideal world, I would need a preloader movie that sits infront of the main swf, and when it reaches say 30% of loading the main movie, then replace itself with that main movie file..... but not sure how you would do that

Anyone else having this same problem

View Replies !    View Related
Preloading A Swf File
can i preloading a swf file? do i use the IF FRAME LOADED action:

ex. ifFrameLoaded ("name.swf", 140)


if not, what do i use. thanks in advance.

View Replies !    View Related
Preloading A JPG File
Howdy ...

I have a huge Problem, which I can't solve.
I preload an Imgae (JPG) in the first scene of my Movie.
After Preloading it should wait til I press a Button to jump to the Next Scene.

Now the Problem:

After Pressing the Button and jumping to the next scene the JPG I preloaded is gone. If I let the Movie jump automaticaly instead of pressing the Button, the JPG is there. Any solutions???

cheers

Chrome

View Replies !    View Related
File Not Preloading
My flash file has 3 scenes. The first scene is a login prompt which connects to a MySQL database, the second scene is a preloader and the third scene is a song with animation. The problem is that when I load it on my page it won't preload. You sit there and wait for a bit while the entire thing loads before you can log in. I want the user to be able to log in first and then get to the preloading part. How can I do this?

If you need to see, go to http://zup.1magine.net/test/

View Replies !    View Related
Preloading Wav File
Hi, I need to preload a wav file to do a loop on my flash scene. I want to preload it on the first frame, and once it's loaded, go and play the 2nd frame.

So far, I've seen ways to preload mp3, but now wav files (the mp3 doesn't loop very well...).

Any easy way to do this ?

View Replies !    View Related
[CS3] AS2.0 [XML File PRELOADING How To]
Hello Guyz
I loaded an xml file in flash using XML Class
var fileXML:XML = new XML();
fileXML.load("myfile.xml");

it has been loaded successfully.

now i want to show the progress of loading, How can i do that?
Thanks in advance

View Replies !    View Related
Preloading XML File
Hey there,
I need help gettin a XML File to be preloaded before going to Frame2 of a Flash File.

Reason is the XML file has variables/text that need to be used for other preloaders to work off.

If at all possible, it would be great if the similar method I have used to preload my MCs (external images) could be used that would be fantastic! So I could have one bar load to 100% after the other.

Please take a look at my flash file etc and you'll see what I mean

Cheers,
Ryan

View Replies !    View Related
Preloading A File
Hey all.

Anyone know if there is a way in flash to preload a file, from a different file...for example...

Your typical pre-loader is..

totalBytes = this.getBytesTotal();
loadedBytes = this.getBytesLoaded();
remainingBytes = totalBytes - loadedBytes
percentDone = int((loadedBytes/totalBytes)*100);
bar.gotoAndStop(percentDone);
if (_framesloaded == _totalframes) {
gotoAndPlay(3);
}


Insted, I want to do something like this...

url = CorCapSm.swf

totalBytes = url.getBytesTotal();
loadedBytes = url.getBytesLoaded();
remainingBytes = totalBytes - loadedBytes
percentDone = int((loadedBytes/totalBytes)*100);
bar.gotoAndStop(percentDone);
if (_framesloaded == _totalframes) {
gotoAndPlay(3);
}

I tried it, but it just made the browser to nuts and bomb out.

Any idea's would be great
Thanks
Caden

View Replies !    View Related
Preloading Seperate File......
I'm sorry if this has been asked already but I am wondering if it's possible to preload seperate *.swf files without making the preload inside the seperate *.swf but inside the main *.swf.

The reason I am asking is I want to create 1 preload which can be dynamically used depending on which button you press.

Any ideas/help on doing this would be great.

View Replies !    View Related
Preloading External File
How can you preload an external file from another (ie main flash) file?

Eg, three or four swf files that are loaded into a main flash file via buttons with loadmovie actions attached.

View Replies !    View Related
Preloading External SWF File
I have a 600K SWF file I can't reverse engineer to .FLA Simply put I would like to load some sort of goofy preloader in the foreground then automatically have the swf movie start when it is fully loaded? I saw some scripts on here which cliamed to accomplish this but I could not get them to work or they involved users clicking buttons to load.
HELP!?!?
Thanks,
jeffrey

View Replies !    View Related
Preloading An External Swf File (and Then Some)
I have a bug in my current preloader. I dunno where =[

frame 1:

Code:
movname="eiffel.swf"
loadMovieNum(movname,1);

frame 2:

Code:
totalBytes = Math.round((movname.getBytesTotal())/1024*1000);
loadedBytes = Math.round((movname.getBytesLoaded())/1024*1000);
percentBytes = Math.round((loadedBytes/totalBytes)*100);
if (loadedBytes == totalBytes && totalBytes >1)
{
nextScene();
}
else
{
scrolltext=loadedBytes;
}
frame 3:

Code:
gotoAndPlay (2)

I get ZERO in the scrolltext var. What did I do wrong?

P.S. - Is there anyway to pass a variable into that movie so it takes the variable into the movie name and I don't have to write a preloader for each movie I got?

View Replies !    View Related
Help With Preloading A 235kb File
Hi Guys:
I was wondering if anyone could help me with a
problem I am having preloading a file of mine.
I have a very basic preloader that checks to see
if the frames in the second scene have loaded.

ifFrameLoaded ("new", 1009) {
gotoAndPlay("new", 1); }

The problem is that the preloader doesn't seem to
start automatically. There is a lag.

In the second scene, the movieclips are placed using the
this.attachmovie method.

removeMovieClip("rain2");
this.attachMovie("b", "b2", 1);
b2._x = 145;
b2._y = 130;
loadMovie("sound/mu.swf", "_root.empty1");

Is this causing my problem?

Any help will be appreciated.
Thanks

View Replies !    View Related
Preloading External Swf File
so i got this i got a movie in which i have a movie clip, and i am trying to load an exteranl file in that movieclip. That i have manged to do. The external movie clip haas a preloader in the first scene.Now my problem is that it is not using the preloader in the sense it just doesn't appear till all the movie il laoded and then the preloader is useless. The main prob is that it takes a bit long to laod all the external swf file, so is there some kind of way where i can just laod the first frame of the external file and then let it use it's prelaoder to load its self?

View Replies !    View Related
Preloading External Swf File
Hello all, please can someone help me to use a preloader that loads an external swf file.

I am using a preloader that i have downloaded from flash kit and the code is as follows..

FRAME 1

frLoaded = getProperty(_parent, _framesloaded);
frTotal = getProperty(_parent, _totalframes);
factor = frLoaded/frTotal*100;
if (factor < advance) {
tellTarget (_parent) { stop(); }
percentloaded = int(factor) add "%";
setProperty ("bar", _xscale, factor);
} else {
tellTarget (_parent) { play (); }
}

FRAME 2

gotoAndPlay (1);


Which works, but i want to keep the preloader seperate to my main movie. My main movie is called phase2.swf

Please can someone help me...

thanks in advance.

Darryll

View Replies !    View Related
Preloading An External Swf File
i had someone once tell me how to preload an swf from one flash file to the other but i totally lost the actionscripting...please help me, and if oldnewbie helps me, sorry for being a butt about the last project also! one more question...is it possible to preload an swf into a movie clip within a flash project? and if so then how? help is appreciated!

View Replies !    View Related
Preloading External Swf File
Im trying to load an swf file i made with swishmax with another swf file that is the loader. I made this 3mb swf file with swishmax and i cant get it to load into flash correctly. So i decided to make a preloader on a seperate swf file, to load the 3mb swf file. Heres my code that im using.

_____SOURCE CODE______

loadMovieNum("santiagointro.swf", 9);

this.onEnterFrame = function(){
percent = _level9.getBytesLoaded()/_level9.getBytesTotal()*100;
if(percent == 100 && _level9.getBytesLoaded() > 100){
_level9.gotoAndplay(1);
delete this.onEnterFrame;

_____SOURCE CODE______
but what the code does is load the first frame and stop. and notthing else plz help.

View Replies !    View Related
Preloading A File Or Movie
This is a very basic concept and I have not been able to find any documentation on it.

I want to preload a file into the user's memory while they are looking at something else within the flash webpage.

Example: a 1 MB external swf that i would like loading in the background without them knowing it... i am trying to speed up all of the preloading time when they do click on a button that calls that file with loadMovieNum. Then, by the time they get to it, it will be pretty much finished.

How do i code this? How do I code a symbol to be loaded and waiting without revealing it before it is time? With a splash page, is there a code that you can place on it that will begin preloading your flash site before the user clicks on the link?

My basic goal is to make my site as streamlined and quick for all users as possible. ANY advice when dealing with structure and preloading/behind the scenes scripting would be greatly appreciated.

Thanks in advance!
adam

View Replies !    View Related
External Txt File Preloading
I have a flash file that loads an external txt file. The txt file has several varibles which then get loaded into several dynamic text feilds. The feilds are also in a movie clip that tweens (if that really makes any difference). The trouble I have found is the feilds come up blank for a few seconds then the txt loads in fine and continues to do so fine during the tweens.

I do have a preloader on this file, however my hunch is the preloader doesn't check the txt file's progress. I know its possible checking the bytesLoaded on a txt file but I am not sure if I am checking it correctly with the path I am using.

So the questions are:

what are the correct paths to an external file when you want to check a property like bytesLoaded and bytesTotal

Is there an unforseen issue that I might be over looking that is causing my bug?

View Replies !    View Related
[F8] Preloading External .swf File
I'm trying to figure out how to preload my external .swf file, timeline.swf into my main site.

Right now, I'm loading the movieclip as follows...

on (release) {
_root.contents.loadMovie("timeline.swf");
}

I've never really messed around with preloading movieclips, so I'm not quite sure how to start and what I need to do to preload it. Can someone please help? Thanks!

View Replies !    View Related
Preloading Part Of An Swf File Only...
Hi,

I'm trying to create a preloader that will only preload frames 1 to 100, then when the user clicks a button on frame 100 it will preload frames 101 to 200 or 201 to 301. How would I create this. My current initial preloader downloads the whole SWF file. I have managed to get it to download frame 100 (labelled "anim") and start playing the movie from frame 3, but the remaining frames in the SWF file still downloads in the background? I don't really want this to happen, as users might not want to download or view part of the SWF movie.

My current opening code is:

totalBytes = Math.round(getBytesTotal() / 1024);
loadedBytes = Math.round(getBytesLoaded() / 1024;
percentDone = Math.round((loadedBytes / totalBytes) * 100);
ifFrameLoaded ("anim") {
gotoAndPlay("anim");
}

View Replies !    View Related
Preloading A Separate Swf File
Ok what I have is a preloader in it's own swf, preloader.swf, what I want to do is have that preloader load a seperate swf, Intro.swf. So once the preloader.swf has loaded the Intro.swf the preloader will be taken over by the intro.swf which will play through the intro.


Code:
this.attachMovie("empty_mc","mainMovie_mc",1);
mainMovie_mc.loadMovie("FLA_Intro.swf");
this.onEnterFrame = function()
{
var percentLoaded = mainMovie_mc.getBytesLoaded()/mainMovie_mc.getBytesTotal()*100;
preloaderbar.bar._xscale = percentLoaded;
if (percentLoaded >= 100 && mainMovie_mc.getBytesTotal() > 40)
{
this.onEnterFrame = undefined;
// Hide the preloader bar etc
preloaderbar._visible = false;
helix._visible = false;
// play the loaded movie
mainMovie_mc.play();
}
}
stop();
I was told this should work for what I am trying to do but all it does in test streaming is continuously play the intro and doesn't load anything? I am using flash 5.

View Replies !    View Related
Preloading XML From An External SWF File
Hello Everyone - first time poster here!

So I've built a great tool that uses a ginormous xml database (about 50 MBs)... to my surprise, the XML file loads relatively quickly with a fast connection.

The thing is, I have an external swf doing the preloading of the main file (and it is doing a fine job)... but it loads everything except for the database...

Any ideas on how to get this to work?
Thanks!
[/code]

View Replies !    View Related
Preloading External Jpg And Mp3 File At Once
I found a great thread on this site for preloading external jpgs. The problem is, I'm pretty much a newbie, and the other on is, I also want to preload a sound file at the same time (internal or external) before the user moves past the preloader scene.

This is the thread I found:

http://www.sitepoint.com/forums/showthread.php?t=168163

Can anyone give me a hint how to adapt these examples to include an mp3 file as well?

View Replies !    View Related
Preloading External SWF File ( GetBytesLoaded
Hi there,

I have two SWF file ( FILE_1.SWF & FILE_2.SWF )

I am going to put my preloading section to FILE_1.SWF file, and it will load FILE_2.SWF file.

I know I can use loadmovie AS to handle it.

.....HOWEVER.....

I would like to show the getBytesLoaded & getBytesTotal information in FILE_1.SWF ( can getBytesLoaded & getBytesTotal get the EXTERNAL SWF size? )


************************************************** *

Possiblly, u will ask for WHY use FILE_1.SWF to load FILE_2.SWF? Here is the answer....

my FILE_2.SWF about 4MB!!!! ( I tried to add the proloading section in it directlly. However, when try to load it. it will show the preloading after 1min!!!!!!!! )

So...

I am going to splite the FILE_2.SWF to 2 parts ( PRELOADING SWF and MAIN SWF )

Cheers

View Replies !    View Related
Preloading External Swf File Or Jpeg
I need to be able to create a preloader for external content that is to be loaded into a MC specificly a jpeg. I know that I can load external jpegs using the loadMovie command my problem now is to be able to show a loading screen while that picture is loading. I could just run an animation that displays while waiting for the picture to load but I really want to show the progress. THanks

View Replies !    View Related
Preloading External Swf File Into A Movieclip
Ok .. so this is my last hope ... coz i'm giving up on it... I amusing flash MX... I have a movie... with buttons and movieclips. Now i have a button which opens an external movieclip into a movieclip in the main movie(thus having an kind of window in anotherwindow) I am trying to make a prelaoder for this external movieclip, so that it only opens after is has fully loaded. For this i put on the main timeline a loading text and a dynamic box which shows the %
I am using this
on (release) {
mm.loadMovie("home.swf", mainmovie);
}
on (release) {
percentloaded = Math.floor(mm.getBytesLoaded()/mm.getBytesTotal()*100);
percentdisplay = percentloaded+"%";
if (percentloaded == 100 && !initialized) {
initialized = true;
_visible = false;
}
}
now when i use this the % thingie doens't work and i get a NaN% instead of it nothing loads and it stops there.

but when i use this
on (release) {
loadMovie("home.swf", mainmovie);
}
on (release) {
percentloaded = Math.floor(_level2.getBytesLoaded()/_level2.getBytesTotal()*100);
percentdisplay = percentloaded+"%";
if (percentloaded == 100 && !initialized) {
initialized = true;
_visible = false;
}
}

the nan%still shows but the thing laods.... the funny thing is that the _level2 can be cahnged to _level1 or _level11 it doesnt matter what ever that is coz it still laods...

Can anyone help me please????

View Replies !    View Related
Preloading A Large File (i'm Getting An Hourglass)
Hi,

I'm creating an important flash CD, and I'm getting into some problems in the loadMovie area. Basically, what's happening is this: I am using a small projector file to load external swf files which contain embedded video (so file sizes ranging from 20MB to 80MB); when I use the loadMovie command, the movie eventually loads, but an hourglass is displayed and all animations that were going on stop until after the movie has finished loading. What I'm trying to do is create a preloader for these swf files, either inside the swf file, or in the projector. I've made many a preloader before, and here I've tried a simple two frame loader in the swf files, and many different actionscripting preloaders in the loading projector. But once the loadMovie command is called, the movie freezes until it is fully loaded; the first frame of the movie doesn't even show or get played, and neither does any call to a simple blinking "loading" text I have in the loader file.

Does anyone know how to get this to work? I kknow it can be done. I recently saw a band's enhanced CD (that uses Flash Player 6 projector file) that has a small loading projector file, and an 80MB external swf file. This file is loaded into the projector, but the projector doesn't stop playing a simple blinking "loading" animation.

Any help is greatly appreciated, and if you have other suggestions as to how to load the swf file, please tell. Thanks,

-Anand Anbalagan

View Replies !    View Related
Preloading A Percentage Of The File Then Playing
Is it possible to preload a moive only to a certain percentage and then play the moive while the rest loads? or is there not much point in doing that. Im asking because I have a moive that is 1.7mb and its file size is far to big and i dont quite know the best way to get it on to the net.
Thanx alot

View Replies !    View Related
Preloading A Animation Swf File Issue
Hello.. I'm currently working on a preloader for my flash animation. I got a script from a guy from flash class for the preloader but I can't seem to make it work. I'd wish I can post the .fla file but its 22mb.

What's going on is that the preload bar works unfortunately it does not start the mc when it's done loading. I have two mc's that
is on the main timeline(scene 1,frame 1) and it's on they own layers. One for globe and one for santa along with skip button and background layers. I've name the globe mc, globe_mc and santa, santa_mc. I have the globe mc to play first then redirect to santa mc. Now the preload action script I got is

actions layer, frame 1:

bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
actions layer, frame 2:

this.gotoAndPlay(1);

The preloader instruction was to create three layers, loadBar, loadtext, and border with all the var and instance name changed for the script. And action layer to add the action script, frame1 for main script and frame 2 for the gotoandplay(1). Now this is where I'm having problems.I had to move the globe and santa mc's from frame 1 to frame three to make the script work. But when I test it. The preloader
works but once the swf file load, it does not play the movie clip, globe. I've tried putting all the movie clips into the globe
mc and putting globe on fram 3 on action layer, doesn't work. I've tried adding a frame label and changing this.gotoAndPlay("framelabel"), but that doesn't work. I've tried replacing this.gotoAndPlay to _root.globe_mc.gotoAndPlay(). Nothing works and it just gets worse since I know little to nothing about Action Script. Can anyone suggest a fix? I've tried other preload script but this one seems to be easier for me to understand.

I attached a screen shot for the fla file and if you want to see what's going on, you can go to www.glogems.com/christmas_preload.html. Sorry for the long post.

Thank you for the help,
Eugene

View Replies !    View Related
Preloading A Large Text File
i have this problem,
i created an actionscript that searches a text file for a number and displays some data related to the number.
the problem i have is that it is a big file, takes too much time to load, when someone clicks the search button, one might think it's not working, because it takes time to load the whole text file and search thru it.

so,
is there a way to preload the text file at the begining of the movie to the cache(with the movie preloading) so that when someone searches data is displayed instantly??

thanks in advance for your help

View Replies !    View Related
Preloading Loadmovies From Host File
please walk me through this...

i have a loadMovie on a movie clip.
it loads a .swf, but doesn't preload it.

how would i go about preloading it?

thanks in advnce.

View Replies !    View Related
[F8] Help With Preloading A Huge File, Gotta Fix Now
I've run into a big problem with a project I did for a client. The swf comes out to 15mb which i know is huge, the client has tons of pics and three videos all of which is embedded, which is what the client demanded. The preloader works on my computer, when i do a simulate download it starts at 1% and goes up to 100% like it's supposed to and then plays the file.

Now the client is saying that when they upload it, the preloader doesn't show up til around 30%. What could be the cause? Or is this something on their end? There is nothing on the first few frames where the preloading takes places, absolutely nothing. Please any ideas or advise as to what could be going on would be really appreciated. I'm at my wits end and the client is demanding this now.

View Replies !    View Related
Preloading External JPG File From An Xml Sheet.
I'm trying to create a preloader for my external jpg image, there is an xml sheet that has the complete url for it, and I want to create a preloader for it. For some reason the preloader isn't working how I wanted.


ActionScript Code:
//load featured jpg
myImageLoader.load(new URLRequest(myXML.featured.jpgURL));

myImageLoader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
myImageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
myImageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);

function onInit(evt:Event):void {

    mainPicture.loadBar_mc.visible = true;
}
function onProgress(evt:ProgressEvent):void {

    mainPicture.loadBar_mc.width = Math.round((evt.bytesLoaded / evt.bytesTotal) * 200);
}
function onComplete(evt:Event):void {

    mainPicture.mainPic_mc.addChild(myImageLoader);
    mainPicture.gotoAndPlay("_in");
}

View Replies !    View Related
Unusual Error While Preloading Swf File
Hi,

I get the error "A script in the movie caused Flash Player 10 to run slowly."

I'm doing a preload of an external swf via as2 which is around 7mb. Then the message "A script in the movie caused Flash Player 10 to run slowly" pops up around ever 15 seconds or so. However, this does happen with smaller files. Any suggestions? Many visitors may think the game is broken and leave the page..

Help?

Here is the code.


Code:
var loader:MovieClipLoader = new MovieClipLoader();
this.createEmptyMovieClip("MyImageContainer",1);
loader.loadClip(_root.gPath,MyImageContainer);

var preload:Object = new Object();
loader.addListener(preload);

preload.onLoadStart = function(target)
{
target.stop();
}

preload.onLoadProgress = function (target, loadedBytes, totalBytes)
{
bar._xscale=Math.floor((loadedBytes/totalBytes)*100);
loader_text.text=Math.floor((loadedBytes/totalBytes)*100)+"% loaded";
}

preload.onLoadComplete = function(target)
{
getUrl("javascript: loadGame('"+gPath+"');");
}
However, when i use as3's loader component to preload the game this message doesn't popup. But the problem with this approach is explained bellow for reference. Note that please don't confuse this with my as2 attempt mentioned earlier.

My as3 preload attempt problem.

I'm using the following to preload external swf.


Code:
stop();

import flash.display.*;

var request:URLRequest = new URLRequest("main.swf");
var loader:Loader = new Loader();

loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.load( request )

function loadProgress(event:ProgressEvent):void
{
var pcent:Number=event.bytesLoaded/event.bytesTotal*100;
loading_bar.scaleX=pcent/100;
percentage_text.text=int(pcent)+"%";
}

function loadComplete( event:Event ):void

{
navigateToURL( request,"_self");

}
I would also be happy if this problem is solved instead. Around 70%, some times 20% the sound of external swf plays. How can I define it so that sound does not play. I was suggested by some to insert an empty first frame, but I don't have source of all the games. so that is not a solution.

View Replies !    View Related
Preloading Wont Load File
Ive read a lot of stuff on the preloaders, but obviously not enough because the one type I want to work doesn't. Its for a website. I want to load the new swf from inside a symbol on the timeline, as it does an animation. So I made an empty MC on the main movie timeline and put it on frame 6 so theres nothing else on it. Ive tried a variety of codes.


ActionScript Code:
_root.holder.loadMovie("index3_4E.swf");

My empty clip on frame 6 is called holder, so why doesn't it play it? If I move the empty clip to frame 1 it plays the clip, but not all of it and it has the main movie behind it and I dont want to show that page, thats the whole point in using the empty mc's isnt it? I feel I have tried tons of variations but am missing something important. I tried it without a movie clip, but it doesnt align properly even though the movie was the exact same size.

View Replies !    View Related
Problem With Preloading External Swf File
Hi you'all

I have this code at frame 15 to preload an external swf file containing my sound.


Frame 15


loadMovieNum("sound.swf",1);
var soundLoaded : Number = _level1.getBytesLoaded() / _level1.getBytesTotal();
bSom._width = soundLoaded * 176;
somText.text = Math.round(soundLoaded * 100) + "%";

Frame 16
if(_level1.getBytesLoaded() == _level1.getBytesTotal()){
gotoAndPlay(30);
}
else
{
gotoAndPlay(28);
}




The problem is that the bar (bSom) is not moving to show the progress of loading the file.

I also have a MC of a text blinking Loading Sound that is not blinking either.

and My movie gets stuck at that point..

what should I do?

View Replies !    View Related
Preloading LoadMovie(JPEG-file)
I'm loading a JPEG file with the loadMovie() method, is there any way to preload this, or to view the loading progress?

(note: I quickly browsed through some of the preloading topics here, but none answered this issue.)

View Replies !    View Related
Preloading A Txt File - Loaded Dynamically
I have a project where I have a (ultimately) a bunch of buttons on a map that when you click on it, a txt file is dynamically loaded into a text field with a scrollbar component. The problem I have is the script to load the txt file loads faster than the txt file and the line of script that makes the scrollbar work checks the textfield length after the field is populated. What I want to do is have all the txt documents preload into the browsers cache and when the buttons are pressed everything loads like it is supposed too. As it is now, if you click a link, the textfield populates and you have to click it again to get the scrollbar to work.

http://www.woodardway.com/school/ here is an example. The two buttons are in the middle of the graphic (you have to scroll down).

So you know, the textbox isn't inside its own movie clip, its just sitting in its own layer in the root. For whatever reason, I cannot get the text to load if the textfield is inside its own movie clip.

View Replies !    View Related
Code For Preloading An External Text File
I have a movie that loads news entries from a text file. All I wanna know is the code to on how to make it play a preloader clip while it is downloading the text file and where to put these codes, etc.

Please thanks..

View Replies !    View Related
Preloading Dynamic Images In A Projector File
Hi All ---

I am creating a projector file to be run on a CD. The projector file loads an external swf. This external swf loads about 50 jpegs dynamically (to be displayed in the scroll component) at run time - no images actually in the external swf prior to run time. When playing the projector file on my pc it runs smooth. However, when I burn it to CD and the external swf is loaded into the projector file there is about a 10 second delay because it is loading all the images at once.

I have tried to create a preloader for this external swf in the projector file without any luck. How else can I do this? I thought about loading the swf earlier in the projector file, but it only ends up displaying the swf earlier than I want it to be displayed!

Any help is greatly appreciated.

Thanks for any and all replies.

Cheers!

View Replies !    View Related
Multiple External File Preloading Progress
I would like to load multiple files from outside of the .swf file, but I would like to make a counter/preloader that describes its progress either in

File 1 of 11 Loading
89 of 109kb Loaded

or

Loading Background1
--
Loading NavImg1
Loading NavImg2

But to update in the same textfields.
I have next to no experience with actionscript, so a tutorial would be great

http://www.snapmotion.com/flash/assignment/main.html

I want to have progress of each file until its loaded so that it can be reused again instead of having the old % preloader.

View Replies !    View Related
Preloading Images To Browser's Cache Through Xml File
Hi,
I'm working on a flash gallery project where images are loaded through xml file.Is there a way to preload images to browser's cache prior to them being called with a movieclip.?,I'm using AS2.
Thanks in advance...

View Replies !    View Related
Preloading Images From Xml File For Ready Display
Hi ,

I have a xml file from which i am loading images to view. every time the suer needs to clik on the images to load it from the xml file . Is it possible to preload the images..so if th euser clicks on the thumbnail the image will load fast?

this is the code written:

delay = 3000;
//-----------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
th = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
th = xmlNode.childNodes.childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
p = 0;
loadline._alpha = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
loadline._alpha = 100*loaded/filesize;
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
if (pictureth._alpha<100) {
pictureth._alpha += 10;
}
}
};
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
pictureth._alpha = 0;
pictureth.loadMovie(th[0], 1);
picture_num();
slideshow();
}
}
function picture_num() {
current_pos = p;
pos_txt.text = current_pos+" / "+total;
}
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
}
slideshow();
//---------
-------------------------------------------------******************---------------------------thx is xml

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>img01.jpg</image>
<caption>img01th.jpg</caption>
</pic>
<pic>
<image>img02.jpg</image>
<caption>img02th.jpg</caption>
</pic>
<pic>
<image>img03.jpg</image>
<caption>img03th.jpg</caption>
</pic>
<pic>
<image>img04.jpg</image>
<caption>img04th.jpg</caption>
</pic>
<pic>
<image>img05.jpg</image>
<caption>img05th.jpg</caption>
</pic>
<pic>
<image>img06.jpg</image>
<caption>img06th.jpg</caption>
</pic>
<pic>
<image>img07.jpg</image>
<caption>img07th.jpg</caption>
</pic>
<pic>
<image>img08.jpg</image>
<caption>img08th.jpg</caption>
</pic>
<pic>
<image>img09.jpg</image>
<caption>img09th.jpg</caption>
</pic>
<pic>
<image>img10.jpg</image>
<caption>img10th.jpg</caption>
</pic>
<pic>
<image>img11.jpg</image>
<caption>img11th.jpg</caption>
</pic>
<pic>
<image>img12.jpg</image>
<caption>img12th.jpg</caption>
</pic>
<pic>
<image>img13.jpg</image>
<caption>img13th.jpg</caption>
</pic>
<pic>
<image>img14.jpg</image>
<caption>img14th.jpg</caption>
</pic>
<pic>
<image>img15.jpg</image>
<caption>img15th.jpg</caption>
</pic>
<pic>
<image>img16.jpg</image>
<caption>img16th.jpg</caption>
</pic>
<pic>
<image>img17.jpg</image>
<caption>img17th.jpg</caption>
</pic>
<pic>
<image>img18.jpg</image>
<caption>img18th.jpg</caption>
</pic>
<pic>
<image>img19.jpg</image>
<caption>img19th.jpg</caption>
</pic>
<pic>
<image>img20.jpg</image>
<caption>img20th.jpg</caption>
</pic>
<pic>
<image>img21.jpg</image>
<caption>img21th.jpg</caption>
</pic>
<pic>
<image>img22.jpg</image>
<caption>img22th.jpg</caption>
</pic>
<pic>
<image>img23.jpg</image>
<caption>img23th.jpg</caption>
</pic>
<pic>
<image>img24.jpg</image>
<caption>img24th.jpg</caption>
</pic>
<pic>
<image>img25.jpg</image>
<caption>img25th.jpg</caption>
</pic>
<pic>
<image>img26.jpg</image>
<caption>img26th.jpg</caption>
</pic>
<pic>
<image>img27.jpg</image>
<caption>img27th.jpg</caption>
</pic>
<pic>
<image>img28.jpg</image>
<caption>img28th.jpg</caption>
</pic>
<pic>
<image>img29.jpg</image>
<caption>img29th.jpg</caption>
</pic>
<pic>
<image>img30.jpg</image>
<caption>img30th.jpg</caption>
</pic>
<pic>
<image>img31.jpg</image>
<caption>img31th.jpg</caption>
</pic>
<pic>
<image>img32.jpg</image>
<caption>img32th.jpg</caption>
</pic>
<pic>
<image>img33.jpg</image>
<caption>img33th.jpg</caption>
</pic>
<pic>
<image>img34.jpg</image>
<caption>img34th.jpg</caption>
</pic>
<pic>
<image>img35.jpg</image>
<caption>img35th.jpg</caption>
</pic>
<pic>
<image>img36.jpg</image>
<caption>img36th.jpg</caption>
</pic>
<pic>
<image>img37.jpg</image>
<caption>img37th.jpg</caption>
</pic>
<pic>
<image>img38.jpg</image>
<caption>img38th.jpg</caption>
</pic>
<pic>
<image>img39.jpg</image>
<caption>img39th.jpg</caption>
</pic>
<pic>
<image>img40.jpg</image>
<caption>img40th.jpg</caption>
</pic>
<pic>
<image>img41.jpg</image>
<caption>img41th.jpg</caption>
</pic>
<pic>
<image>img42.jpg</image>
<caption>img42th.jpg</caption>
</pic>
<pic>
<image>img43.jpg</image>
<caption>img43th.jpg</caption>
</pic>
<pic>
<image>img44.jpg</image>
<caption>img44th.jpg</caption>
</pic>
<pic>
<image>img45.jpg</image>
<caption>img45th.jpg</caption>
</pic>
</images>

View Replies !    View Related
Preloading An External Image/sound File
Hey, I have been messing around with it and trying different things but failed. I have a movie that on frame 2 has a preloader bar only, and all I want is for it to preload an external image called image1.gif (shows up on frame 3) and sound1.mp3 . The sound file however only loads when I click the play button on frame 10. How would I preload these 2 things but not play the sound file until frame 10?

Please help, I have searched many places but I am not near advanced enough to "expirement in mixing," it always fails.

View Replies !    View Related
Urgent Help * Preloading Images From Xml File For Ready Display
Hi ,

I have a xml file from which i am loading images to view. every time the suer needs to clik on the images to load it from the xml file . Is it possible to preload the images..so if th euser clicks on the thumbnail the image will load fast?

the code is attched below































Edited: 01/04/2007 at 11:18:15 AM by kakas

View Replies !    View Related
Complicated Fla Design Problem, Preloading Instances From The Same File
Hi ive got a problem. I have to make a flash website for my work which preloads a page every time you click the navigationmenu. So u click a button, and a page loads in (with loadingbar). My problem is, that i cant use separate movies to do this, like u usually do. I got to have the whole site in one Fla file, so i cant make separate "contentpages"/fla's (this is very important). I thought i could work around this by selecting the export on publish options in the library, and then load the files back in when needed via actionscript. The thing is, for this i need the original Mc deleted from the movie on publish. Is there a way to do this via actionscript. Like on publish delete instance1.
Or alternatively is there a way to stall the loading of certain instances in the movie? So i can preload instances which are all in the mainmovie separately?

Need help

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved