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




Preloader That Works With Attached MCs



hi

anyone know how to make a preloader that works with attached MCs? thanks!



FlashKit > Flash Help > Flash ActionScript
Posted on: 10-04-2001, 12:06 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Action Works Attached To A Button But Not When Attached To A Frame
can anyone tell me why the following button script works:

on (release) {
_root.welder.eyes.gotoAndPlay(2);
_root.welder.gotoAndPlay(2);
}

but this virtually identical script won't work in a frame (on the same timeline as the button):

_root.welder.eyes.gotoAndPlay(2);
_root.welder.gotoAndPlay(2);

i've been pulling my hair out all day over this. i can't think of an explanation as to why the second example wouldn't work. its baffling to me.

Attached File Works In Flash Player 6 But Not 7 Or 8...why?
I want to take advantage of flash 8's clearer text feature, but when I publish this .fla for flash player 8 it won't work. I also tried publishing it for flash player 7 but that won't work either. It only works (scrolls) correctly when published for flash player 6.

Anyone know why? I'd really appreciate the help.

Can Someone Explain Me Why Preloader Works In Some Browser And Some Don't Works?
CONTEXT: I did a preloader in Flash and I uploaded it
PROBLEM: I can see the preloader on IE version 5 and 6, but I also cannot see the preloader on IE version 5 and 6 depends on which computer I'm using!!! WEIRD


Can someone help me!!!

gen

Preloader And Attached Mcs
Can anyone help me with this problem.

I have a movie that has 200 mcs that get imported at different
stages of the movie.

I would like to put a small animated preloader in the previous
scene that plays untill all of the movie has downloaded, (700k).

The problem is that when I test the movie it just loads the
whole movie before showing the animation.

Any ideas on how I could do it?

This is the code that I use, (the movie loops to this);

loadPercent = (Math.floor(_root.getBytesLoaded()/_root.getBytesTotal()*100)+"%");
loadBytes = (Math.round((_root.getBytesLoaded()/1024)*1000)/1000+" Kb de "+Math.round((_root.getBytesTotal()/1024)*1000)/1000+" Kb");
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
// Check for finished loading
loadPercent = "100%";
// If loaded, final update to fields
loadBytes = (Math.round((_root.getBytesLoaded()/1024)*1000)/1000+" Kb de "+Math.round((_root.getBytesTotal()/1024)*1000)/1000+" Kb");
// Where to go once your movie is loaded
gotoAndPlay("go");
}

Attached Sound And Preloader
I have noticed that when i have a attached sound from the library, the preloader starts after that sound is loaded and it works properly only for the main movie size not the both sound and movie.
for example if my movie is 1 MB and my sound is 600K, using preloader. browser starts loading the 600K without using the preloader just with a blank screen...right after the 600K is done. the preloader starts for the 1MB of the main file....anyidead why? before i just dump the sound into the main timeline.

Preloader For Attached Movie
Hi, I'm trying to get a preloader to work inside a movie that is loading into a blank movie clip. You can see the site here

http://initiumeyewear.com/platinum_main.html

You notice that when you click on a style to the left that there is a 1-5 second gap before you see the loading movie clip.

Here is the code I have in the loader:

2nd frame

ifFrameLoaded (_totalFrames) {
gotoAndPlay(6);

6th frame

gotoAndPlay(1);

10th frame

gotoAndPlay("Scene 1", 1);


Can anyone see any problems with this or have a better code to use as a preloader?

Thanks

Preloader Problems - Fla Attached
Can someone please explain why this preloader doesn't work?
I've been reading tutorials and forum posts for the last 2 days trying to figure out how to get an AS3 preloader to work.

When I simulate download, the screen is blank until it loads. I've tried unchecking the export in frame 1 box and adding instances in frame 2, etc. But these cause all kinds of various errors.

Now I'm just really confused. What am I doing wrong?

Thank you!

(MX) I Need A Preloader That Is NOT Attached To OnClipEvent
Hi people
I know scene are ''bad'' but this is a project already made that i have to update so what I really need to do is after the movie is loaded go to frame 1 scene 2. It wont go. I did try to copy scene 2 into MC but it all get in a mess...
on ClipEvent (enterFrame) {
loading = _parent.getBytesLoaded();
total = _parent.getBytesTotal();
percent -= (percent-((loading/total)*100))*.25;
per = int(percent);
percentage = per+"%";
loadBar._width = per;
if (percent>99) {
_parent.gotoAndStop("Scene 2", 1);
}
}

Can anyone suggest a preloader that display bits loaded or percentage (no bar needed) and that I can make it go to scene.
Free beers for all!
thnx

Special Preloader For Attached Sound In SWF?
Is there a special preloader to use for SWF's that contain attached sound files? For me, the usual "get bytes" functions dont mean a thing. I have a percentage preloader for a movie with an attached sound file. Unfortunately, the preloader doesnt show up when the SWF is loaded into its respective MC.

I KNOW for a fact my code is correct, everything is addressed to the correct location but NOTHING shows up, nevermind the percent. The movie is blank until the whole thing is loaded. This doesnt make much sense but thats the way it is. Anybody know whats goin on?

Attached Movie Clip & Preloader
There are two attached movie clips loaded on the first frame from the library. These are loaded before my preloader...how can I have my preloader load first and (if possible) include the attached clips in the percentage loaded.
Please post if this is not possible also....thanks a lot.
Memphix

Preloading Attached Movies Screws My Preloader(?)
hi,
i know that if you have movie clips you want to attach they are preloaded in the first frame of your movie. is this true? it seems so to me. This busts my preloader though, it comes up only at 90% of total (that is after loading the attaching movie clips i think). is there a way to solve this problem? can i move these movie clips' preloading to the next scene? any tutorials on this? please HELP.

MC That Is Attached To Mouse Is A Preloader But Wont Show
Hope the subject title does this post justice.

I finally have time to do my own project!!!

I've started with a movie clip that attaches itself to the mouse. This movie clip is also the preloader for the entire flash movie.

My problem is this preloader movieclip doesn't show the "preload" process. When I simulate download, it just shows a blank screen, then once the movie is loaded, it will play the movie. So the preloader seems to be working, just not showing.

I've even just tested the movieclip to see if it attaches itself, and it does. (just commented out the preloading actions). Below is my code, I would appreciate any help or direction.

Thanks!
L

in my library I have a movieclip called Cursor2. It is checked for exporting for AS and the class name is Cursor2

Code:

Onclip Event Going To Wrong Scene When Preloader Attached
Hi there - need some urgent help: I have a preloader which leads to one scene that has five keyframes. Each keyframe contains a m/c that is moved in the -x direction using actionscript. Using onclipevent on the m/c, I detect when _x <= 0. If so, the movie is moved onto the next keyframe, otherwise the m/c carries on moving until this._x does equal or is less than 0.

Problem: When 0 is reached, I use the following code to move to the next keyframe:

_root.gotoAndPlay (n);

n = the next keyframe. This did work until I put in the preloader. Now when _x = 0, the swf jumps back to the beginning of the preloader and starts the movie from the beginning. What am I doing wrong? I have tried to replace _root. with _parent with no success. Leaving off _root. results in the m/c grinding to a halt when 0 or less is reached.

any ideas would be great

thanks

frank

Preloader Works Only Once?
Hi!
I was having a problem in my (big) flash movie so I put in a preloader in my movie and it worked fine!

But I noticed that on subsequent visits to the page my preloader got hung i.e. the movie would't advance?! But, If I cleared the cache file in explorer then it would work fine.

Any clues as to why such a behaviour? is there a way in flash to remove the cache file ?

Thanx!
-mav

Preloader Almost Works
*SIGH* i've been working on an all-encompassing preloader that is contained in one frame of actionscript, and it ALMOST works.

the problem is targeting - i want to be able to switch targetting between the _root level and a loadclip on the stage ("centerStage") for all my child movies. when it targets the default (_root), it works, however when it targets centerStage, it returns a getBytesLoaded value of "0" infinitely. to make it more confusing, when it getsBytesTotal for centerStage, it returns the correct value.

though i've included all the code, there is only one line i think is causing problems (line 48).

any help with this will be GREATLY appreciated! any code changes/suggestions are welcome as well. you should be able to copy and paste this code in any movie of yours and call getNewMovie(); to test.

code: function getNewMovie()
{
this.preloader.loadbar._xscale = 0;
this.createEmptyMovieClip("loadFinder", this.getNextHighestDepth() );
//CHECK TO FIND TARGET - DECLARED IN TIMELINE
if (loadTarget == undefined) {

movieTotal = this.getBytesTotal();
trace("loadTarget = " + loadTarget);

} else {

loadTarget = this.centerStage;
movieTotal = this.centerStage.getBytesTotal();
trace("defined = " + movieTotal);

}//if

oldXscale = 0;
EMPTYCLIP = 12; //the default size of an empty clip

loadFinder.onEnterFrame = function ()
{
//sets defaults -- checks to make sure there is a new total value in dest. clip before beginning load
if (movieTotal > EMPTYCLIP) {

checkLoad();
this.removeMovieClip();
trace("movieTotal =" + movieTotal);

} //END if

}//END onEnter function

}//END function getNewMovie

function checkLoad ()
{
//checks how much of movie is loaded
this.createEmptyMovieClip("loadChecker", this.getNextHighestDepth() );
loadChecker.onEnterFrame = function ()
{
if (loadTarget == undefined || loadTarget == _level0 ) {
movieLoad = _root.getBytesLoaded();
//WORKS - RETURNS CORRECT VALUE
} else {
//*** ERROR - RETURNS "0" INFINITE
movieLoad = _root.centerStage.getBytesLoaded();
//*** END ERROR
}//END if

movieRemain = movieTotal - movieLoad;
moviePercent = Math.round(100-(100*(movieRemain/movieTotal)));
//adjust xScale of loadbar
if (moviePercent < 100 || moviePercent == undefined) {//not complete

loadBarTarget = moviePercent;
newLoadBar = oldXscale + ((loadBarTarget-oldXscale)/4);
_root.preloader.loadbar._xscale = newLoadBar;
oldXscale = newLoadBar;

}else {//load complete

if (movieHome == 1) {//home state

startMovie();

}else {

startSection();

}

movieTotal = undefined;
loadTarget = undefined;
this.removeMovieClip();

}//END else

}//END onEnterFrame

}//END function checkPercent

thanks,
jwt

Everything Works....until I Add Preloader?
Help I have a small flash movie, with an image that when you click on the image it zooms in. i've used the code;
code: myZoom = function (myDepth) {
if (myDepth == "deep") {
myDepth = 4;
} else if (myDepth == "medium") {
myDepth = 8;
} else if (myDepth == "light") {
// default
myDepth = 12;
}
trace(myDepth);
_root.onMouseDown = function() {
if (k>0) {
return;
}
zoom = true;
dir == 1 ? (dir=-1) : (dir=1);
if (dir == 1) {
pt = {x:_root._xmouse, y:_root._ymouse};
}
};
this.onEnterFrame = function() {
if (!zoom) {
return;
}
_root._xscale += dir*k*50/myDepth;
_root._yscale += dir*k*50/myDepth;
var pt2 = {x: pt.x, y: pt.y};
_root.localToGlobal(pt2);
_root._x -= (pt2.x-pt.x);
_root._y -= (pt2.y-pt.y);
k++;
if (k == 8) {
zoom = false;
k = 0;
}
};
};
myZoom("medium");

this works fine, however when I add a preloader in scene 1 and add a stop(); action where my image is other wise keeps replaying scene 1. When I test the movie now it does not work at all (can't zoom anymore) also am getting an output of 8 ???
Sorry this is such a long post, any ideas would be greatly appreciated!!

Everything Works.... Until I Add Preloader?
Help I have a small flash movie, with an image that when you click on the image it zooms in. i've used the code;

code:
--------------------------------------------------------------------------------


ActionScript Code:
myZoom = function (myDepth) {
    if (myDepth == "deep") {
        myDepth = 4;
    } else if (myDepth == "medium") {
        myDepth = 8;
    } else if (myDepth == "light") {
        // default
        myDepth = 12;
    }
    trace(myDepth);
    _root.onMouseDown = function() {
        if (k>0) {
            return;
        }
        zoom = true;
        dir == 1 ? (dir=-1) : (dir=1);
        if (dir == 1) {
            pt = {x:_root._xmouse, y:_root._ymouse};
        }
    };
    this.onEnterFrame = function() {
        if (!zoom) {
            return;
        }
        _root._xscale += dir*k*50/myDepth;
        _root._yscale += dir*k*50/myDepth;
        var pt2 = {x: pt.x, y: pt.y};
        _root.localToGlobal(pt2);
        _root._x -= (pt2.x-pt.x);
        _root._y -= (pt2.y-pt.y);
        k++;
        if (k == 8) {
            zoom = false;
            k = 0;
        }
    };
};
myZoom("medium");
--------------------------------------------------------------------------------



this works fine, however when I add a preloader in scene 1 and add a stop(); action where my image is other wise keeps replaying scene 1. When I test the movie now it does not work at all (can't zoom anymore) also am getting an output of 8 ???
Sorry this is such a long post, any ideas would be greatly appreciated!!

A Preloader (it Only Works Sometimes)
I used a tutorial to make the following preloader:
http://murtos.com/preload2.fla

However, it isn't working like it should. The movie is being loaded like 80% before the status bar even shows up to show the percentage. The mass of the file is made up of an MP3 file, that is embedded into the movie via the library, it is not dynamically loaded.

Is that a correct preloader? It only shows the loading bar sometimes as I mentioned...


Also, why is it when I save a Flash MX file for that preload2.fla, the file is 8MB, but when I go down to a Flash 5 file, it is only 6kb?

Preloader Only Works On First Swf
Can anyone help. I have added a preloader in the first frame of my movies. But only the first one works. The other movies are loaded into an invisable movie in the home screen. They work OK went I test the movie in simulated download. I am guessing it it something to do with importing swf into the invisable mc on my home screen. They are all visable on the web site, but the animated load bar and % just says 100%.
Please can anyone help.

I Need A Preloader Bar That Works :]
I use codes like this to load movie clips into a loader.
However, i cannot figure out how to create a preloader that will show its progress, since most BAR tutorials are for AC2.

Can someone tell me how to do this with AC3?

Thank you.







Attach Code

function toCLR(e:MouseEvent):void {
view14.removeChild(externalMovie);
var request:URLRequest = new URLRequest("media/CLOFT.swf");
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, Tier2A);
loader.load(request);
function Tier2A(e:Event) {
externalMovie = MovieClip(loader.content);
view14.addChild(externalMovie);
view14.addChild(loader);
}
}

Everything Works...til I Add Preloader?
Help I have a small flash movie, with an image that when you click on the image it zooms in. i've used the code;code: myZoom = function (myDepth) {

if (myDepth == "deep") {

myDepth = 4;

} else if (myDepth == "medium") {

myDepth = 8;

} else if (myDepth == "light") {

// default

myDepth = 12;

}

trace(myDepth);

_root.onMouseDown = function() {

if (k>0) {

return;

}

zoom = true;

dir == 1 ? (dir=-1) : (dir=1);

if (dir == 1) {

pt = {x:_root._xmouse, y:_root._ymouse};

}

};

this.onEnterFrame = function() {

if (!zoom) {

return;

}

_root._xscale += dir*k*50/myDepth;

_root._yscale += dir*k*50/myDepth;

var pt2 = {x: pt.x, y: pt.y};

_root.localToGlobal(pt2);

_root._x -= (pt2.x-pt.x);

_root._y -= (pt2.y-pt.y);

k++;

if (k == 8) {

zoom = false;

k = 0;

}

};

};

myZoom("medium");
this works fine, however when I add a preloader in scene 1 and add a stop(); action where my image is other wise keeps replaying scene 1. When I test the movie now it does not work at all (can't zoom anymore) also am getting an output of 8 ???
Sorry this is such a long post, any ideas would be greatly appreciated!!

Everything Works...til I Add Preloader?
Help I have a small flash movie, with an image that when you click on the image it zooms in. i've used the code;code: myZoom = function (myDepth) {

if (myDepth == "deep") {

myDepth = 4;

} else if (myDepth == "medium") {

myDepth = 8;

} else if (myDepth == "light") {

// default

myDepth = 12;

}

trace(myDepth);

_root.onMouseDown = function() {

if (k>0) {

return;

}

zoom = true;

dir == 1 ? (dir=-1) : (dir=1);

if (dir == 1) {

pt = {x:_root._xmouse, y:_root._ymouse};

}

};

this.onEnterFrame = function() {

if (!zoom) {

return;

}

_root._xscale += dir*k*50/myDepth;

_root._yscale += dir*k*50/myDepth;

var pt2 = {x: pt.x, y: pt.y};

_root.localToGlobal(pt2);

_root._x -= (pt2.x-pt.x);

_root._y -= (pt2.y-pt.y);

k++;

if (k == 8) {

zoom = false;

k = 0;

}

};

};

myZoom("medium");
this works fine, however when I add a preloader in scene 1 and add a stop(); action where my image is other wise keeps replaying scene 1. When I test the movie now it does not work at all (can't zoom anymore) also am getting an output of 8 ???
Sorry this is such a long post, any ideas would be greatly appreciated!!

How To See If Preloader Works
Hi,

Can someone please tell me how to see if the preloader actually works in my flash movie. I followed the exact directions in the kirupa tutorial and after hitting Ctrl + Enter twice, I saw the preloader come on. However, after I uploaded it to my website, the preloader no longer shows. Why doesn't it show?

Here is the link: Gallery

Thank you for your time.
Iceman

Preloader Works Erratically
I am hoping someone can help:

I have made a simple pre-loader for a Flash 5 site that works perfectly when tested on my home computer (using both the "test movie/show streaming" command AND when viewing a published .swf file in an html document).

The weird thing is that when I ftp the file to my web page, the pre-loader no longer works. Instead of waiting until 95% of the frames are loaded, it just jumps right to the first scene!

I can't think of any reason why it would do this: the file is identical! Any suggestions?

Thanks,
Angelique

Preloader W/loadMovie Only Works Sometimes
Okay! I have a preloader that works fine most of the time. Basically what it does is load the main movie, then sequentially load three more swfs into levels. Each one has to be fully loaded before it will move on to the next.

The main movie always loads fine but the first swf sometimes either starts and then stops or won't start at all. I believe it has something to do with the file size which is over a MB. I've tried rearranging the load order and it still has problems with this one swf file. Almost all of the swf's size is in the first frame because I've used attachMovie. Furthermore, it seems to only happen in Netscape. What is the problem? I've been trying to solve this for some time. I'm pretty sure the action script is fine since it works most of the time.

Preloader < Works But Needs Expertise>
I used a tutorial article on preloaders that is on this web site:
http://www.flashkit.com/tutorials/Ac...89/index.shtml

It works but the progress bar becomes visible only after 45% of the content has been downloaded. Why?
I want the progress bar to be visible the second the end user presses enter on their keyboard. Also, the dynamic text doesn't show any info. the 2 dynamic fields are blank!! Why??
If you want to see it first hand goto http://www.conceptualdesign.net/about.html


Thanks

Please Tell Me If This Works, Preloader I Made
http://thelof.clanpages.com enter the FLASH SITE and see if theres a preloader that loads properly, I cant check cuz my internet connection is too fast and the site itself is only 36k. also i know the site sucks, badly BUT thats my first site in flash and I made it cuz 3 days ago it just hit me exactly what was needed to do to make a site, I alreay knew SOME flash and it was just easy from then on, so Im gonna make a kick ass site, just checking out other things B4 i do.

If u want, RATE my site 1 - 10 scale, thanx. O and tell me what needs improvements.

PRELOADER WORKS ONLY OFFLINE
OK the situation
There is a main.swf file that calls SWFs1 to 5, each in another PlaceHolder MC called mMC_PH1 to mMC_PH5.

Offline while testing the following code works perfect

load("SWF1", mMC_PH1)
and so on up to PH5

then i´m defining
mTotalBytes=mMC_PH1.getBytesTotal()+...+mMC_PH5.ge tBytesTotoal()

In the following preloader Section there is
mLoadedBytes=mMC_Ph1.getBytesLoaded()+...+mMC_Ph5. getBytesLoaded()

after that i only need to check the preload state in

if(mLoadedBytes<mTotalBytes)
goto Preloader and so on

as i said, everything works great until....

i uploaded my files onto http://www.

this is my problem

the variable mTotalBytes has not any longer a value around 1 Meg but only 600 kB (??????)

Funny is the values varies

Is it possible that the loaded movie "needs a while" to fix its correct length? I would say NO

But it must have to do with transmission speed

I dont know

Please HELP


Christian

Preloader Only Works On Macs...I Think.
The preloader I have built into a site only seems to work on some computers. When it works it work great. When it doesn't, it loads the whole swf then starts at the second scene. Any advice would be helpful. Check it out - It is 1.9MB though - DBC



My code for the preloader (which is the first scene in the swf) is as follows:

Frame 1: Nothing

Frame 2:
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) {
}

Frame 3:
gotoAndPlay(1);

THANKS!

Preloader Works Fine But Not On IE
im having a problem with internet explorer
showing the preloader but when but all works
fine when i publish the swf and "show streaming"

here is the code i am using:

onClipEvent (enterFrame) {
counter = math.floor(_parent.getBytesLoaded()/_parent.getBytesTotal()*100);
_parent.counterpercent = counter+"%";
if (counter>=100) {
_parent.play();
}
}

thanks for any help =)

Preloader Works But If 100% He Can't Play On
people is used this script:

onClipEvent (enterFrame) {
percent = _root.getBytesLoaded()/_root.getBytesTotal()*100;
gaNaar=Math.round(percent);
_root.circle.gotoAndStop(gaNaar);
if (gaNaar == 100) {_root.circle.gotoAndPlay(101);
}
}


at an animation of 100 Frames, he loads prefect, but the last line doesnt work ({_root.circle.gotoAndPlay(101).I already traced gaNaar and it gives the value 100 so thats correct but he won't play on on frame 101 (he stops there)

how can i get it play ?

thnx already

Preloader, Can You Check If It Works?
hey,

I have a 2mg intro with background music. I have made a preloader. can you guys check to see if i did it right, because my movie still "lags". Why does my movie lag? is it because i did masking? the mask part is the only thing lagging. This lag is driving me nuts. This is my first preloader by the way.

Thx.

Baljinder

Preloader Wouldn't Works On IE
Hello, I had a preloader, working in Flash. When i upload to internet, the preloader page wouldn't works, it just show downloading on the bottom of IE page, but my flash preloader did not appear until it finished download, the it show a button for play. Please help me, it is for my birthday friend tml. Thanks.!

Preloader Only Works On Macs
I'm having a problem with my preloader only showing up when you view the .swf file on a Mac. On a PC nothing shows up until it's completely loaded. I'm using Flash 8, but export for FlashPlayer 7, ActionScript 2. (Mac Platform)

I've tried two different types of preloading, and they should both be suitable for AS2 since I'm using components. I used the advanced preloader tutorial from the GoToAndLearn site, and I tried using the ProgressBar components as well.

All of the methods I've tried work when I test the movie and simulate the download speed. They just don't show up when using a PC

Check out
http://media.graytvinc.com/video/Testing2.swf

Any advice would be awesome!

[F8] Preloader That Works With Projectors?
I have placed a preloader into my flash movie and it works fine.

When I publish this as a projector it doesn't.

Do preloaders work with Projectors?

If so, does anyone have an example of one.

Thanks!

Preloader Works In SWF But Not In HTML
Website is finished, and was testing on another PC in HTML. The prelaoders work when opening the swf directly but not when opening via html. It seems to be a path problem.
Persumably I add something to the path (current path i.e. _root.main_mc.media_mc.audioMenu_mc.etc) before "main_mc" (the empty movie clip in the index.swf), as it is being loaded by index.html...
Not sure what this should be, any ideas?

Checking If Preloader Works
Whats up fams,
I'm just checking if my preloader works and I get the (CTRL Enter) to test the movie and (CTRL Enter) again to simulate download. When I do this however, the first thing I see is a blank white screen, then after a while I see the preloader and then the tested movie. Whats with the blank white screen? Is this normal?

Very Simple Preloader - Does It Really Works?
Hi,

I have a full flash site done and I'm desperate 'cause the only thing missing is a preloader (the site has 500kb).

I tried everything but without any sucess. A preloader was a very simple thing to do in AS2, but it's killing me in AS3.

A few things you should know:

- I'm not using any frames at all, none.
- The preloader method I'd like to use is the one that works
-------------------------------------------------------------

At the moment I have a very simple preloader within the swf I want to preload, here's the code:


Code:
var _loaderBar:Sprite = new Sprite;

public function main(): void{
preloader();
}

public function preloader(): void{
addEventListener(Event.ENTER_FRAME, loading);
}

private function loading(event:Event) {
var bytestotal = stage.loaderInfo.bytesTotal;
var bytesloaded = stage.loaderInfo.bytesLoaded;
var sclbar = Math.round(bytesloaded*100/bytestotal);
if (bytesloaded >= bytestotal) {
init();
removeEventListener(Event.ENTER_FRAME, loading);
}
}The code above loads all the 500kb before it starts playing, but I read somewhere that a preloader within the code/swf is really a problem in IE6/7, and I don't know how to apply any hacks to solve it.

I tried already to load the index.swf externaly, but even with and nice a good preloader, I always have some problems with the loaded movie, specifically with the display object (Error #1009: Cannot access a property or method of a null object reference) and the code is about 400 lines so detecting where the problem is isn't easy for me.

So, my question is: Is the code above a good way to load my code? does is really works?



Does anyone has a better solution?
Sorry if this subject is already been discussed but I'm really lost here.

Thanks in advance.

Why My Swf Preloader No Longer Works?
My swf movie used to show up maybe UNTIL december last year, 2007. But how come it no longer show up now? Once the movie has been loaded, the preloader will show up very quickly.

I am using SwfObject and FlashVars.

Please help.

Very Simple Preloader - Does It Really Works?
Hi,



I have a full flash site done and I'm desperate 'cause the only thing missing is a preloader (the site has 500kb).



I tried everything but without any sucess. A preloader was a very simple thing to do in AS2, but it's killing me in AS3.



A few things you should know:



- I'm not using any frames at all, none.

- The preloader method I'd like to use is the one that works:P

-------------------------------------------------------------



At the moment I have a very simple preloader within the swf I want to preload, here's the code:




Code:

var _loaderBar:Sprite = new Sprite;

public function main(): void{
preloader();
}

public function preloader(): void{
addEventListener(Event.ENTER_FRAME, loading);
}

private function loading(event:Event) {
var bytestotal = stage.loaderInfo.bytesTotal;
var bytesloaded = stage.loaderInfo.bytesLoaded;
var sclbar = Math.round(bytesloaded*100/bytestotal);
if (bytesloaded >= bytestotal) {
init();
removeEventListener(Event.ENTER_FRAME, loading);
}
}


The code above loads all the 500kb before it starts playing, but I read somewhere that a preloader within the code/swf is really a problem in IE6/7, and I don't know how to apply any hacks to solve it.



I tried already to load the index.swf externaly, but even with a nice and good preloader, I always have some problems with the loaded movie, specifically with the display object (Error #1009: Cannot access a property or method of a null object reference) and the code is about 400 lines so detecting where the problem is isn't easy for me.



So, my question is: Is the code above a good way to load my code? does is really works?







Does anyone has a better solution?

Sorry if this subject is already been discussed but I'm really lost here.



Thanks in advance.

Preloader Works In Firefox, Not In IE
Hi flashers

I recently bumped into this problem, and I really don't know what or where it goes wrong

I made a preloader for my website, and it works in the download simulator, it works in Firefox, but not in Internet Explorer!! The preloader doesn't appear untill the whole movie is loaded in IE. In Firefox it works fine.

I don't know if it is an Actionscript-issue or a HTML-issue. But I hope somebody knows the solution to this problem...

You can visit the website here if you want to test it. The website is in Dutch, because I'm from Belgium

Actionscript of the preloader:

Code:
//PRELOADER frame 1
var Totaal = _root.getBytesTotal();
var Geladen = _root.getBytesLoaded();
var Verhouding = Geladen / Totaal;

preloader.loadText.text = Math.round(Verhouding * 100) + "%";
preloader.loadBar._width = 170 * Verhouding; //width of the preloader is 170px

//PRELOADER frame 2
if (Geladen == Totaal) {
preloader.loadPrefix.text = "Laden voltooid!";
preloader.loadText.text = "";
stop();
gaVerder = setInterval(function(){clearInterval(gaVerder); gotoAndPlay(3);}, 1000); //short break of one second before it continous to frame 3
} else {
gotoAndPlay(1);
}
My HTML:

HTML Code:
<? xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>&nbsp;The New Friends &nbsp; </title>
</head>

<body>
<object type="application/x-shockwave-flash" data="website.swf" width="950" height="560">
<param name="movie" value="website.swf" />
</object>
</body>
</html>

Preloader Only Works In Player 7
I have a preloader for my web site and I want it to show the percent loaded. I could not get the percent to update, the animation for the preloader does work. Finally I tried dropping down from version 8 in the publish settings to version 7 and it works fine. I tried stripping almost every thing out of the site but I still need to drop down to version 7 for the preloader to work. If I start from scratch and build a simple site the same as my stripped down site the preloader will work in version 8.
Any ideas?

stop();

myInterval = setInterval(preload,100);

function preload() {
var current = _root.getBytesLoaded();
var total = _root.getBytesTotal();
var pctLoaded = Math.round(current/total*100);
pct_txt.text = pctLoaded;

if (current >= total) {
gotoAndPlay("main",1);
clearInterval(myInterval);
}
}

AS3 Preloader Works On Firefox But Not IE7
Hi,
I am new to Flash CS3 and Actionscript 3 so i'm not sure if this is an elementary problem or not. I have some preloader code that works fineon all browsers the first time it loads. Once loaded the page will no longer advance past the first frame (where the preloader is located) on IE7. On firefox it works great every time.

Attached is the preloader code which is the Document class. I have it set to export classes in frame 2 but it wasn't working when i had it in frame 1.
Any help would be greately appreciated.
Thanks,
Dinko









Attach Code

package {
import flash.display.*;
import flash.text.*;
import flash.events.*;

public class Preloader extends MovieClip {
public static const ENTRY_FRAME:Number = 2;
//public static const DOCUMENT_CLASS:String = 'Program';

//private var progressBar:Sprite;
private var txtLoaded:TextField;

public function Preloader() {
super();
stop();
//progressBar = getChildByName("pBar") as Sprite;
txtLoaded = getChildByName("txtPercentLoaded") as TextField;
//progressBar.scaleX = 0;
txtLoaded.text = "";

//what to do each time progress is made
loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);

//what to do when this loader script is done
loaderInfo.addEventListener(Event.COMPLETE, completeHandler);
}

private function progressHandler(event:ProgressEvent):void {
var loaded:uint = event.bytesLoaded;
var total:uint = event.bytesTotal;
//progressBar.scaleX = loaded/total;
txtLoaded.text = String(Math.round(loaded/total*100)+"%");
}

private function completeHandler(event:Event):void {
play(); //play the movie when the loader is done
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}

private function enterFrameHandler(event:Event):void {
if (currentFrame >= Preloader.ENTRY_FRAME) {
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
stop();
main();
}
}

private function main():void {

}
}
}

Very Simple Preloader - Does It Really Works?
Hi,



I have a full flash site done and I'm desperate 'cause the only thing missing is a preloader (the site has 500kb).



I tried everything but without any sucess. A preloader was a very simple thing to do in AS2, but it's killing me in AS3.



A few things you should know:



- I'm not using any frames at all, none.

- The preloader method I'd like to use is the one that works:P

-------------------------------------------------------------



At the moment I have a very simple preloader within the swf I want to preload, here's the code:




Code:
var _loaderBar:Sprite = new Sprite;

public function main(): void{
preloader();
}

public function preloader(): void{
addEventListener(Event.ENTER_FRAME, loading);
}

private function loading(event:Event) {
var bytestotal = stage.loaderInfo.bytesTotal;
var bytesloaded = stage.loaderInfo.bytesLoaded;
var sclbar = Math.round(bytesloaded*100/bytestotal);
if (bytesloaded >= bytestotal) {
init();
removeEventListener(Event.ENTER_FRAME, loading);
}
}


The code above loads all the 500kb before it starts playing, but I read somewhere that a preloader within the code/swf is really a problem in IE6/7, and I don't know how to apply any hacks to solve it.



I tried already to load the index.swf externaly, but even with a nice and good preloader, I always have some problems with the loaded movie, specifically with the display object (Error #1009: Cannot access a property or method of a null object reference) and the code is about 400 lines so detecting where the problem is isn't easy for me.



So, my question is: Is the code above a good way to load my code? does is really works?







Does anyone has a better solution?

Sorry if this subject is already been discussed but I'm really lost here.



Thanks in advance.

Preloader, Works, But Doesn't...
I am feeling like such a n00b today, I can't get anything to work. Anyway, I have this preloader, it's supposed to make the bars go accross, but it doesn't for some reason, it changes the _x value, which i know because i traced it, but the bars don't move...? Any ideas, here's the code i used.

ActionScript Code:
onClipEvent(enterFrame) {    this._x = -55+_root.getBytesLoaded()/_root.getBytesTotal()*269.3;    trace(this._x)}

btw, the reason there isn't an if/then statement in it is cuz I have a % preloader too, and it covers that.

Kirupa Preloader *Almost* Works
Hiya - found loads of great tutorials already on this site - thanks for the easy-to-follow instructions!

However (You knew that it was gonna happen), I can't seem to get the preloader with percentage bar functioning properly remotely. The movie preloads alright, but users cannot see the preloader animation I created, rather just a blank white screen until the movie pops up. Very frustrating, and I have no idea what went wrong.

You can see the problem for yourselves at >>this site<< . Just click the hypertext to view my movie.

Any ideas/suggestions? I even put a one second delay in the first frame of the preloader just in case it was loading too fast... I guess it's like a preloaded preloader now !

Thanks so much

Harv

Please Help: Preloader Works In Simulation But Not On The Web
I'm trying to preload external swf files as needed and show the progress each time a file is being preloaded. It works exactly as intended when I simulate it on my desktop but not at all when uploaded on the web: first of all nothing happens up until 50% of the main movie is already loaded and then when the the attempt is being made to load additional content, some weird number displays (-214...%) instead of the percentage. Take a look:
http://home.comcast.net/~tenant13/preloader/
I'm also attaching a fla file (104KB):
http://home.comcast.net/~tenant13/pr...loader.fla.zip

Preloader - Works But Not Accurate...
Hello, I made the preloader from the tutorial on this site...
The one that shows a bar and a percent of what is loaded...

It works but the bar will be about half way across when it says it is at like 80%...

Is that just processor lag or something?

Here is the site...
http://www.videolinktechnologies.com/new/

Thanks...

Why My Preloader No Longer Works?
My swf movie used to show up maybe UNTIL december last year, 2007. But how come it no longer show up now? Once the movie has been loaded, the preloader will show up very quickly.

I am using SwfObject and FlashVars.

Please help.

Copyright © 2005-08 www.BigResource.com, All rights reserved