Background Preloader
Hi,
I need a preloader for pictures from gallery tutorial.
When first picture shows I need AS to load next picture in the background, and when a user proced on next pic, that pic must show immediately.
Thanks.
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 12-22-2003, 12:03 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
More On Background Swf Loading *or* PRELOADER OF A PRELOADER
Deja vu, but here we go! I asked this before, but I'm still not quite there. I can guess you can call this post HOW TO MAKE A PRELOADER OF A PRELOADER! lol...
Here's the setup. I have 3 swf files burned off. In other words, I will have a main movie with two buttons that will load each of the other two (depending on which button is clicked) with the "loadMovie" action. I have a preloader setup for all the movies. So, when button one is clicked it will load the first swf into level 1, etc and the preloader animation will run until it's loaded...etc. for the other swf and button.
Now, that's the setup, here's what I'm looking to do.
Is there a way (on the main stage) to set an action that will start the loading process of the other two swfs (that the buttons activate)"in the backgroud" BEFORE the buttons are pressed. In other words, I want to start the loading process before anything is done and then when the button is clicked, what hasn't been loaded, if any, will finish off with the preloader animation going.
TWO THINGS:
1) I want to do this with multiple swf's (as explained above) NOT one huge swf with all the scenes.
2) Even if the swfs finish before a button is clicked, I want them to just "sit there" invisible until a button is clicked. I know that I can achieve the invisible effect by leaving the first frame of each loaded swf blank and applying a stop action.
3)The clips that I will be loading are the same size of the stage, therefore, will be covering up the main timeline completely (an "unloadMovie" action is put into a button to get back to the main timeline which acts as a "back" button of sorts).
Well, that's about it. I hope I explained it thouroughly enough. Some extra info....on the main timeline I have the preloader on frame 1 (an anonymous one, it works for any timeline of any scene or swf that I put it on), then my "main" page on frame 2 (the one with the two buttons).
Thoughts and impressions:
Should I load each of the swf's into their own movie clip in level 1? I don't know if this would make a difference, but I'm throwing it out there for comments!
Background Preloader
Hi can someone scan my code and see if there are any glaring mistakes
its ment to be a background preloader, so it loads stuff in,
but if the user selects something it stops, loads the choice item and removes it from the "to be loaded"...loadArray. so when it restarts it knows not to load it again
setback/feature 1: if a user choices to select an item, it will continue to load whatever is loading and start to load the item they want.
setback/feature 2: the preloader will not restart until the user calls userCont().... should I have a timer so after awhile it kicks back in?
error: just realised I have to stop it when it gets the end of the list.
Code:
stop();
//loadArray = stuff to load
//targetArray = target for stuff to load into
//
loader(loadArray, targetArray);
// call loader function
zuluCount = 0;
pauseVar =0
function loader() {
if (pauseVar == 0) {
MCL.loadClip(loadArray[zuluCount], targetArray[zuluCount]);
}
}
// manual override
function userLoad(img, tar,num) {
pauseVar = 1;
contains = function (tar, loadedArray) {
for (i=0; i<loadedArray.length; i++) {
//trace("PA"+zuluArray[i]);
if (loadedArray[i] == tar) {
return 1;
// found
}
for (j=0; j<loadedArray.length+1; j++) {
//viewer.image["i"+zuluArray[j]]._visible = false;
}
}
//test["i"+zuluArray[i]]._visible = false;
return -1;
};
if (contains(tar, loadedArray) == 1) {
//loaded already
//trace("Kirupa is found!");
tar._visible = true;
} else {
MCL.loadClip(loadArray[num], targetArray[num]);
for (i=0; i<loadArray.length; i++) {
if (loadArray[i] == tar) {
loadArray.splice(i, 1);
break;
}
}
}
}
function userCont(){
pauseVar =0
loader();
}
var myflickrMCL = new MovieClipLoader();
/*********************************************************************/
//callbacks
myflickrMCL.onLoadStart = function(targetMC) {
var loadProgress = myflickrMCL.getProgress(targetMC);
};
myflickrMCL.onLoadProgress = function(targetMC, loadedBytes, totalBytes) {
targetMC.bigPreview.load.preloadBar._xscale = loadedBytes/totalBytes*100
};
myflickrMCL.onLoadComplete = function(targetMC) {
trace("zuluLoad"+targetMC);
loadedArray[zuluCount] = targetMC;
zuluCount = zuluCount++;
if (pauseVar == 0) {
loader(loadArray, targetArray);
}
//;
var loadProgress = myflickrMCL.getProgress(targetMC);
};
myflickrMCL.onLoadInit = function(targetMC) {
};
myflickrMCL.onLoadError = function(targetMC, errorCode) {
};
Background Preloader
Hi,
I need a preloader for pictures from gallery tutorial.
When first picture shows I need AS to load next
picture in the background, and when a user proced on next pic,
that pic must show immediately.
Thanks.
Sequential Background Preloader
I need to load a sequence of rather long - and heavy - movies into an existing movie, and i wonder whether it's possible to preload a movie once a preceding movie has finished loading *but is still playing*?
How can this be done? And is there any performance hit on the movie that is actually playing if this sort of background preloading is going on?
White Background Before Preloader
My flash animation displays a white background for a few seconds before my preloader starts. It never use to do this before I added some images to my animation. Therefore, I'm assusming this is related to file size, so I played with the publishing settings - reducing file size considerably, but to no avail.
What could be the problem?
Thanks in advance....
Still Got The White Background Before Preloader
Hi guys.
I still have the problem with the white flashing background of
my object before the preloader starts.
I've set the background color of the object to the same as the background of
the website. The problem is still there...
Any ideas ??
Background Image With Preloader
Hi,
I'm using a background jpeg which scales to fit the browser window automatically. I want to add a preload bar to show the user that it's loading. When I add one the following code doesn't seem to work. Does anyone know how to add a preloader. An example I have seen is on http://www.hi-res.net
Thanks
PHP Code:
Stage.scaleMode = "noScale";
Stage.align = "TL";
this.onResize = function() {
this._width = Stage.width;
this._height = Stage.height;
};
Stage.addListener(this);
this.onLoad = this.onResize;
Load A Random Background With Preloader
I've searched the site, and it looks like a lot of people have the same problem, but I couldn't find any answers. The load a random background tutorial is great, but it doesn't work with my preloaders. Does anyone know how to modify it so the preloaders on the SWFs being radomly loaded work?
Much obliged.
Preloader With Full Screen Background?
i have my movie set up to load an external swf or image into an empty movieclip which allows the image to streach to the full size of the browser window.
the question is that i want there to be a preloader on the transition between the images as they will be relatively large sizes, i want to recreate something similar to:
http://www.brook-pifer.com/
...where the preloader takes up the whole window similar to how the images will be working
not really too sure how id go about this
any help would be great
thanks
Integrating Background Music Into Preloader
I'm new to Flash and ActionScript. I have recently completed some online training and I'm working on my first site.
http://www.installingdealers.com
I have the BG music stored in a SWF called bgmusic.swf located in the same directory as the main SWF. Here is the code I'm using for the preloader...
Code:
onClipEvent (enterFrame) {
_parent.loaded = _parent.getBytesLoaded();
_parent.total = _parent.getBytesTotal();
if (_parent.getBytesLoaded() == _parent.getBytesTotal()) {
_parent.nextFrame();
}
}
I'd like for the external bgmusic.swf file to load prior to moving the playhead to frame 2. I tried putting the bg music on a layer within the main FLA but I had other issues that I couldn't sort out. After turning off music, the music would restart when I clicked a link that took me back in the timeline.
Thanks in advance! :D
Background Multi-preloader Problems *urgent*
Hi, bit of a hurry - this is already overdue and I'm starting to feel a bit guilty.
Can anyone help with this? Is there some naunces of Flash I don't know about, or have I just made a stupid mistake? I'm trying to load several MCs in the background dynamically, the code I'm using is:
_root.createEmptyMovieClip("gameCont",0);
_root.createEmptyMovieClip("bossCont",0);
_root.createEmptyMovieClip("endCont",0);
function loadCode() { // this is run every 1 or 2 frames
_root.gameCont.stop();
_root.bossCont.stop();
_root.endCont.stop();
if(nowLoading=="start"){
nowLoading="game";
if (sHero == "boy") {
if(sFriend == "boy"){
_root.gameCont.loadMovie("swf/game_boy_boy.swf");
}else{
_root.gameCont.loadMovie("swf/game_boy_girl.swf");
}
}else{
if(sFriend == "boy"){
_root.gameCont.loadMovie("swf/game_girl_boy.swf");
}else{
_root.gameCont.loadMovie("swf/game_girl_girl.swf");
}
}
}else if(nowLoading=="game"){
if(_root.gameCont.getBytesLoaded/_root.gameCont.getBytesTotal==1){
_root.bossCont.loadMovie("swf/lovegods_boss.swf");
nowLoading="boss";
}
}else if(nowLoading=="boss"){
if(_root.bossCont.getBytesLoaded/_root.bossCont.getBytesTotal==1){
nowLoading="end";
if (sHero == "boy") {
if(sFriend == "boy"){
_root.endCont.loadMovie("swf/end_boy_boy.swf");
}else{
_root.endCont.loadMovie("swf/end_boy_girl.swf");
}
}else{
if(sFriend == "boy"){
_root.endCont.loadMovie("swf/end_girl_boy.swf");
}else{
_root.endCont.loadMovie("swf/end_girl_girl.swf");
}
}
}
}else if(nowLoading=="end"){
if(_root.endCont.getBytesLoaded/_root.endCont.getBytesTotal==1){
nowLoading="done"
}
}
}
Which I've based on an example I found somewhere (I forget where but it's included in the .zip with my source file.
Basically it's not working (doesn't even start preloading the files) and I'm hoping someone out there can see why 'cause can't at the mo' and I'm starting to get a bit psyched out about it.
If you're looking at the source file the important code's in the frame marked "begin". Sorry about the messy file, I've had to code around someone else's structure.
Thanks for any suggestions.
Loading A Random Background Image With A Preloader
hello
I've been following the Loading a Random Image tutorial from kirupa but I can't seem to make my image*.swf's to work..in it all I have is 3 frames, where the first 2 frames are for the preloader and the 3rd one is for the image.. but all I get is the loadBar fully loaded (but with no animation, just static) and no image... does that code from the kirupa tutorial stop the *.swf to make anykind of anymation?
another question is about how to simple load a movie on enter frame with a movieclip defining the location where it should be loaded to.. shouldn't it be: location.loadMovie("movie.swf") ? simply.... no?
thanks in advance..
Flash Background Appears White Before Starting The Preloader
Hello
well I have this flash anim with a preloader. I have a green background for my flash anim. It is also incorporated in HTML on a black table. When you first open the html page, you see a white rectangle before the preloader starts. I think it is very ugly on my design, is there any way to fix that? I know it is flash that is reading the animation and that just didn't get enough time to read the preloader yet. But there must be a solution to at least change the white to black for instance?
thks a lot
rania
Transparent Background/ XML Code To Change The Background Colour
Hi,
In a bit of a pickle here; I need a way to insert a swf file into any color background website, so it automatically matches up.
Now, can one make the swf files background transparent? And match the background of any given websites background?
Or, can one use some sort of XML file and simply change this xml file to match the background color of the website?
Now, what if the website uses a particulare pic background? How would one match this?
As usual folks, I am stuck between a rock and a hard place, so any help deeply apprecaiteed!
Kind Regards,
Boxing Boom
HTML Background Matching Flash Background
Hey, I have a flash website that opens as a pop up, the pop auto fullscreens. The background in the flash document is a gradient, and I have a gradient in the background of the html. My question is how would I get the background of the HTML to always match up with the flash background using a percentage?
www.flippingsweet.net/index2.html
Printing A MC With White Background, Not Stage Background?
I’m trying to print a movieclip with a white background while keeping the stage background black. The movieclip, printResults_mc has a white rectangle in the bottom layer, 850 pixels x 1100 pixels. The following function scales printResults_mc to the printer’s printable area but because it’s impossible to predict the aspect ratio of the printable area some black background always leaks out. I tried making the white background 20 pixels larger than I need (870 x 1120) and then setting a crop rectangle in addPage of (10,10,850,1100), no luck, the black stage background just fills in the area outside the crop. A simple solution would be to temporarily set the stage background color property to white, print, then set it back to black, but I can’t find any such property. Anyone have some ideas?
Attach Code
function printResults(e:MouseEvent):void {
var myPrintJob:PrintJob = new PrintJob();
var result:Boolean = myPrintJob.start();
var pageMargin:Number = 0;
if (result) {
prepPage();
var cropRect:Rectangle = new Rectangle(pageMargin,pageMargin,printResults_mc.width-pageMargin,printResults_mc.height-pageMargin);
printResults_mc.width = myPrintJob.pageWidth;
printResults_mc.scaleY = printResults_mc.scaleX
myPrintJob.addPage(printResults_mc,cropRect);
myPrintJob.send();
} else {
//User does not have printer or user canceled print action
};
}
Transition Problems - Background To Background
my problem is, when click on the button to make a background go away ( fade out ) and another fades in...there is a quick blip or jump when it should be a very smooth transition from one to the other.
can anybody help me with this problem? the file is attached.
oh yeah, click on the red buttons toward the buttom to see the problem.
Transition Problems - Background To Background
my problem is, when click on the button to make a background go away ( fade out ) and another fades in...there is a quick blip or jump when it should be a very smooth transition from one to the other.
can anybody help me with this problem? the file is attached.
oh yeah, click on the red buttons toward the buttom to see the problem.
Transition Problems - Background To Background
my problem is, when click on the button to make a background go away ( fade out ) and another fades in...there is a quick blip or jump when it should be a very smooth transition from one to the other.
can anybody help me with this problem? the file is attached.
oh yeah, click on the red buttons toward the buttom to see the problem.
How Do I Make A Fast And Easy Preloader Or A Hard Cool Looking Preloader
how do i make a preloader?? ive went thru many toutorials and they dont make sense to me i want a cool looking preloader if i can but if not!! a preloader that is jest flashing the words "loading" would be nice to know how to make....
im kinda new to flash MX and all Flash programs so could u explain verry well???
Preloader Not Showing In The Beginning? Did I Make The Preloader Wrong?
alright, it seems that my preloader does not show until the movie is about 85% loaded, and then after that it works fine. but how do i get the preloader to show from the begining? here is the site...
http://www.trikenit.com/6n/preloader.html
and here is the fla for the preloader
http://www.trikenit.com/6n/preloader.fla
if anyone could help me out with my preloader i would be so very grateful. thank you in advance.
Preloader For Importing Swf - Join To Initial Preloader On Level0
Hi all,
I have looked on many forums in order to sort this problem but can't quite get there.
I have a main movie (presentation.swf) which is a presentation which runs for about three minutes. After about a minute into the presentation it imports a swf (base.swf - placed onto level1) into the movie which then jointly runs together in realtime with the _root level0 movie. It all works fine. I have created a preloader on the root movie (presentation.swf - level0) which is OK but I can not work out how I can add the second swf (base.swf) onto the initial preloader. The problem is that I have lost the fla file of the base.swf file so can not add a preloader or any extra actionscript onto the base.swf file.
I have tried to see if by checking if level1 is loaded
Code:
if (_level1.getBytesLoaded() == _level1.getBytesTotal()){
_root.gotoAndPlay(20);
}
I have also tried to create a third swf which imports both the presentation.swf and base.swf but failed to produce anything.
The preloader that I have works well by its self. The code is shown below
Frame 4
Code:
_root.loadPercentage.text = "0";
_root.loadedBytesText.text = "0";
_root.ofLoadedBytesText.text = Math.round((_root.getBytesTotal() / 1024) * 1000) / 1000;
Frame 5
Code:
_root.loadPercentage.text = (Math.floor (_root.getBytesLoaded() / _root.getBytesTotal() * 100));
_root.loadedBytesText.text = Math.round(((_root.getBytesLoaded() / 1024) * 1000) / 1000);
_root.ofLoadedBytesText.text = Math.round(((_root.getBytesTotal() / 1024) * 1000) / 1000);
// START OF WORKING OUT TIME REMAINING
counter = counter + 1;// the counter incrementing 12 times (12 - set by stage)a second
seconds = counter/12;// Converting the counter into Seconds
timeMinRemaining = Math.floor(((seconds/(Math.floor(_root.getBytesLoaded() / _root.getBytesTotal() * 100))*100)-seconds)/60);
timeSecRemaining = Math.floor((seconds/(Math.floor(_root.getBytesLoaded() / _root.getBytesTotal() * 100))*100)-seconds) - (timeMinRemaining * 60);
_root.TextTest1.text = timeMinRemaining;
if (seconds == Math.round(seconds)) {
if (timeMinRemaining == 0) {// If No minutes remaining then display only minutes remaining
_root.minRemainingText.text = "";
_root.minRemainingLabel.text = "";
_root.secRemainingText.text = timeSecRemaining;
_root.secRemainingLabel.text = "sec";
} else {// If MORE THAN 0 minutes remaining then display minutes and seconds remaining
_root.minRemainingText.text = timeMinRemaining;
_root.minRemainingLabel.text = "min";
_root.secRemainingText.text = timeSecRemaining;
_root.secRemainingLabel.text = "sec";
}
}
if (_root.getBytesLoaded() == _root.getBytesTotal()){// REDIRECT TO START OF SCENE
_root.loadPercentage.text = "100";
_root.loadedBytesText.text = Math.round(((_root.getBytesLoaded() / 1024) * 1000) / 1000);
_root.ofLoadedBytesText.text = Math.round(((_root.getBytesTotal() / 1024) * 1000) / 1000);
gotoAndPlay("PreloadComplete");// The preloader was used, therefore goto Close of Preloader
}
Frame 6
Code:
gotoAndPlay(5);
Please I would appreciate your help
Thanks
Preloader Issue - Code Is Correct, But Preloader Is Flakey
I'm using Flash MX 2004 to develop a flash-based website.
There is one main movie, and several external .swf's that are loaded into the main movie as needed.
All movies have a basic preloader, created as follows:
All movies have 2 scenes.
The first scene contains the preloader, which is 3 frames in total.
Frame 1 contains the following script:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
Frame 2 contains the following:
this.gotoAndPlay(1);
Frame 3 is blank.
There is a 2nd layer which contains a dynamic text box which calls the variable "loadText".
This preloader works great in the main movie. The main movie contains buttons which call external SWFs to be loaded into a holder MC on the main movie's timeline. When I load an external SWF into my main movie, the preloader doesn't show up at first. At about 60%, the preloader FINALLY shows up and counts the last 40% before the movie plays.
After several attempts, I noticed that the problem is not with the code itself, but might have something to do with the amount of data loaded into frame 1 of my movies.
Using the debugging tool, and looking at the graph that Flash provides when previewing a movie, I noticed that my main movie contains about 5kb of data in Frame 1, and as mentioned above, the preloader works just fine.
When previewing each of my external SWFs separately, I noticed that the amount of data on Frame 1 of those movies is much greater - 101kb.
After searching the help files, I read somewhere that Flash MX 2004 loads certain data into the first frame of the movie by default, and I'm guessing that THAT is what's causing the preloader not to show up instantly.
Would appreciate any help in clarifying this issue, as the site is completely done except for this preloader problem.
TIA.
Large Movie Preloader /External Preloader Question...
I have a fairly large movie (about 380KB) with a status bar preloader in the first frame. The problem is that I load a few of the MC's in the movie into ScrollPanes and then don't work unless I export them on the first frame (these MCs make up about 200KB). Therefore, there is no flash shown until it has loaded up about half way.
I tried to use an External Preloader, but that loaded the MC on level 1, and no buttons or functions within the entire movie worked properly.
My question is, is there a way to either use the external preloader and swap (or reload) the movie on level 0, or does anyone know a way to load the MCs on another frame other than 1, but before they load to the Scroll Pane? Any other ideas would also be appreciated.
Thanks!
Complex Preloader - Load Multiple Movies W/ One Preloader
Hello to all!
I haven't asked a good question in quite a while so here's one.
I know how to create a general preloader fairly well. What I want to do is take it one step further.
I want a preloader with a status bar...but here's the caveat...I want it to load multiple external movies instead of just one. So it would load one after another and show the status of each.
I can't think of a site off the top of my head, but it would show loading and then it would load...say audio player...shows text "Loading Audio Player" and then shows loading progress...and then...image loader...shows text "Loading Image Loader" and then shows loading progress, etc.
You get the point.
Any takers?
Thanks.
Fuse And Preloader: ZigoEngine.register() Slows Preloader
Here's something I came across and am wondering if anyone ran into this issue and found a workaround.
- My entire SWF is 200kB in size.
- I have a preloader on the first frame of my movie and its an animation which is about 24kB big.
- The rest of the content is on the third frame of my movie and also on the third frame is where I register the ZigoEngine.
Now, here's what's happening:
- The preloader doesn't show right away. There appears to be some 65kB-70kB added on the first frame when I register the ZigoEngine for Fuse.
- When the preloader shows, it's already at around 44%-50%
- If I remove the code where I do the registration, the preloader loads fine.
I am guessing the overhead is happening because the registration is global. But, is there a way I can fix this or is it impossible considering the nature of the Fuse registration call?
Preloader-moving On To An Actionscript Based Preloader
Most of the sites I have designed have just used an "if frames are loaded preloader". However, I want to get a more effecient preloader by using the _framesloaded and _totalframes properties of the movie to give a more accurate preloader . I was wondering if anyone knew where I can find a good tutorial or see an example of an FLA that uses this style actionscript based preloader.
Please let me know so I can start working on figuring this out!
Thanks Dave
Actionscripted Preloader Content ....egomedia Preloader
I have aquired a preloader, it is the egomedia preloader by unclickable. I have the .fla if required...problem is that the content is an actionscripted animation. Now how the hell do I add actions to the .fla to make it operate as a preloader..The .fla basically is not a preloader but just a animation there are no references in the code to ifframesloaded etc..I would appreciate some help ..like I say I have the fla and could mail it to whoever..All someone could do is pop the actionscript in for me and explain to me how it works..thanks in advance
How Can I Make A Second Preloader Play If A File Is In The 1st Preloader?
OK I'm going to try to explain this
I have a preloader on my main movie to preload external files. This preloader preloads the external files and places them into a empty movie clip.
What I would like to do is have 2 preloaders if the 1st preloader was used, I would like the second preloader to be used there on after.
I'll try to explain what is happening I have 3 buttons to load 3 external files on a blank MC if a external file is present on the MC I what to use a second preloader. I need to use a second preloader because the first preloader is a progress bar that goes across the whole MC. If a external file is on the main I want to use a smaller progress bar.
If you have any suggestions I would appreciate your help
Thanks
Preloader Inside Preloader Type Thing
Hi,
I've got like a main page that has a preloader in a different scene. And in the main page I call loadMovie on first frame that load external swf that has same structure - preloader scene with a main scene (content for the main page) ... but the first preloader seems to wait to load the actual page and the external swf before if finishes. Why is the first preloader not just preloading for the home page and then once u are there the other preloader kicks in and loads the content??? Also the preloader seems to have a wait till 20 % before it actually appears on the screen how is that?
code is
frame 1
-----------------------------
total_bytes = _root.getBytesTotal();
kb = int (total_bytes/1000)
loaded_bytes = _root.getBytesLoaded();
kb_loaded = int (loaded_bytes/1000);
remaining_bytes = total_bytes-loaded_bytes;
kb_remaining = int (remaining_bytes/1000);
percent_done = int((loaded_bytes/total_bytes)*100);
bar.bar2.gotoAndStop(percent_done);
ifFrameLoaded ("main", 1) {
gotoAndPlay ("main", 1);
}
--------------------------------
frame 2
gotoAndPlay(1);
Cheers
Preloader For Another Movie In Current Preloader
say i have a preloader, for the first movie. in the first movie, at the end of the movie, i put up an action script in which it will load another movie call second movie
see, if the first movie got 30 frames, and at frame 30 the second movie is loaded (loadMovie method), the preloader is utterly useless cause users still need to wait at frame 30 of first movie for second movie to load.
so what i'm trying to ask here is can first movie preloader check or make second movie load then show it at frame 30.
to make things clearer, heres my source code for preloader
ifFrameLoaded ("main", 30) {
gotoAndPlay ("main", 1);
}
well looks simple, but doesnt check and see if the second movie is loaded onto frame 30
any help?
Scene Preloader Vs Movie Preloader
hi
I have a movie with about six scenes. Each scene begins with a simple preloader...
if (_root.getBytesLoaded()>=_root.getBytesTotal()) {
gotoAndPlay(4);
}
The trouble is that I think that this script only works on the first scene because it is loading the whole movie rather than just the scene to which it belongs.
does anyone know how i alter the script so that it only gets the BytesLoaded and BytesTotal of the current scene rather than the whole movie?
thanks very much for your time.
Preloader Only Showing After 30% (can I Preload A Preloader?)
Im trying to make a diferent kind of preloader. Its a dog that pulls the loader bar....
I made the dog MC animation, and i have a Bar_mc with this code
Code:
onClipEvent (load) {
_xscale = 0;
}
onClipEvent (enterFrame) {
counter = math.floor(_parent.getBytesLoaded()/_parent.getBytesTotal()*100);
_parent.counterpercent = counter+"%";
// if loaded, play;
if (counter>=100) {
_parent.gotoandStop(5);
// Alex troque isso para a ação quando tvier em 100%
} else {
// if not loaded, set the status bar width;
_xscale = counter;
}
}
So far so good, but it seems that the preloader will only appear after 30%, i guess the dog MC is heavy and it is stoping the loader to be displayed earlyer, all i get is a blank screen and near 30% all the elements pops out... Is there a way to preaload a preloader? , how can i fool that? pls my deadline is so near
Preloader (multi-external Preloader)
This loader i made is makeing my movie play() before its done? ARG!
Anyone see anything i overlooked?
Thanks,
PHP Code:
bytes_loaded = 0;
bytes_total = 0;
numOfThumbs = 15;
for (l=1; l<=numOfThumbs; l++) {
loadMovie("Images/Thumbs/image"+l+".jpg", _root.thumbStrip["TN"+l]);
_root.thumbStrip["TN"+l]._y = _root.thumbStrip["TN"+(l-1)]._y+thumbHeights;
}
for (t=1; t<=numOfThumbs; t++) {
bytes_total += _root.thumbStrip["TN"+t].bytesTotal;
}
this.onEnterFrame = function() {
for (f=1; f<=numOfThumbs; f++) {
bytes_loaded += _root.thumbStrip["TN"+f].bytesLoaded;
}
if (bytes_loaded>=bytes_total) {
_root.play();
delete this.onEnterFrame;
} else {
_root.stop();
loaded_txt = bytes_loaded+"/"+bytes_total;
loaded_percent_txt = (bytes_loaded/bytes_total)*100 add "%";
}
};
Loadmovie With Preloader (preloader Won't Work)
I finally managed to get my .swf to load into a movieclip on my main movie.
now the problem is that it doesn't show the preloader, it just sits there until it's loaded then starts to play.
i've read just about everything i got my hands on but can't figure out why the preloader won't play.
here is my code on my main movie's main scene
myButton.onRelease = function (){
_root.target_MC.loadMovie ("movie.swf"), 1);
}
any help would be greatly appreciated.
thanks
Help How Can I Make A Preloader Bar With This Preloader Code?
Hi,
I have external swf's loading into an empty movie clip, I'm using this preloader at the first frame of every external swf.
Code:
stop();
function waitForLoad() {
bytesLoaded = this.getBytesLoaded();
bytesTotal = this.getBytesTotal();
percent = Math.floor(bytesLoaded/bytesTotal * 100);
if (bytesLoaded == bytesTotal && bytesTotal > 4) {
trace("done loading");
delete this.onEnterFrame;
this.gotoAndPlay("fr1");
}
}
this.onEnterFrame = waitForLoad;
I don't have a clue how to make a bar show the loading progress. Is there an easy way I can implement it into this preloader code?
External Preloader/ Internal Preloader
can someone explain me the difference? i am trying to achieve a loader but that loads a movie clip wich is part of the same swf(i dont see the point in converting this mc to a jpeg as it would weight more), how can this be achieved?
Help Making Preloader Into A External Preloader
Hey Flash Gurus
I need some help changing a preloader I have into a preloader that can be used for loading external swf.
Now the code for the preloader is
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes/1000);
totalkbytes = Math.ceil(totalbytes/1000);
if (loadedbytes == totalbytes) {
nextScene();
}
frame = int(loadedbytes/(totalbytes/100));
tellTarget (_root.loader) {
gotoAndStop(_root.frame);
}
Ie the preloader and steps through a preloader animation filling the logo (ie loader)
Now I have tried changing a few things but having problems tried loading into a container and a level
Help would be awesome
Thanking you in advance
jacko
Help Making Preloader Into A External Preloader
Hey Flash Gurus
I need some help changing a preloader I have into a preloader that can be used for loading external swf.
Now the code for the preloader is
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes/1000);
totalkbytes = Math.ceil(totalbytes/1000);
if (loadedbytes == totalbytes) {
nextScene();
}
frame = int(loadedbytes/(totalbytes/100));
tellTarget (_root.loader) {
gotoAndStop(_root.frame);
}
Ie the preloader and steps through a preloader animation filling the logo (ie loader)
Now I have tried changing a few things but having problems tried loading into a container and a level
Help would be awesome
Thanking you in advance
jacko
Preloader Starting At 82% And Another Preloader Not Working
i have two new problems now , my global preloader is starting at 82% , i do imagine why but not sure, i suposse that all my MC are been loaded at 1st frame althouth my movie starts at 5th frame in scene 2 ... is there any way to tell MCs to load at 5th frame ?
and another preloader working when i use Crtl+enter But not working at the web when i upload it into internet, here is the code of the preloader (the second one)Code:
function fotografia(numero, texto) {
_root.MCInstalaciones.ventanita.fotoin.createEmptyMovieClip('holder', 1);
//load the external movie into the new movieclip
_root.MCInstalaciones.ventanita.fotoin.holder.loadMovie('imagenes/'+numero+'.jpg');
_root.MCInstalaciones.ventanita.notainsta.textodefoto.text = texto;
};
//check the download status of the external
//movie once every frame
_root.MCInstalaciones.ventanita.fotoin.onEnterFrame = function() {
//trace the porcentajeage of the movie that has loaded
porcentaje = (_root.MCInstalaciones.ventanita.fotoin.holder.getBytesLoaded()/_root.MCInstalaciones.ventanita.fotoin.holder.getBytesTotal())*100;
if (!isNan(porcentaje)) {
_root.MCInstalaciones.ventanita.porcent.text = porcentaje;
} else {
_root.MCInstalaciones.ventanita.porcent.text = porcentaje;
}
if (porcentaje == 100) {
delete _root.MCInstalaciones.ventanita.fotoin.onEnterFrame;
}
}; this code is called when mouse moves over and now that i write this i am getting an idea why is not working......maybe this code only executes once , a single time, due to that is called from a mouseover event? if so why does it work when i do crtl+enter
could that be the cause?
Here is the link to my temporarely work where preloaders fail to do their job http://sultanos.shinranet.com/pupito.html
second preloader is to load images at INSTALACIONES link
Background
alright, i guess im pretty new to flash but i was wondering, when you make a background image for a flash page, (in photoshop for me) what format do you save it as to get the best picture? ive tried .png and it comes out blurry and has a lot of miscolored pixels, .jpg comes out the same way, .gif was very bad, it was even distorted. i figured bitmap would be too big of a file size so i didnt try, but what does every use to get good quality pictures?
Background
Is it possible to have a transparent background and put it "behind" an html page? Because all I want is a custom cursor and it would take too long to convert the whole site to flash.
Background
This first time working with swish. I created a movie with 2 scenes is there any way to have deferent background on the second scene. If not can I make the first scene take all the browser so will not show the background and only the second one will…
|