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








Reusable Preloader Using MovieClipLoader Help


Hi everyone,

I'm working with the Reusable Preloader Using MovieClipLoader Tutorial and was able to get it to work perfectly with images but when I try to load swf's it just shows a blank screen. Is there something I need to change to make it load the swf's?


Code:
MovieClip.prototype.fadeIn = function() {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 10;
} else {
delete this.onEnterFrame;
}
};
};
bar._visible = false;
border._visible = false;
var empty = this.createEmptyMovieClip("container", "100");
empty._x = 0;
empty._y = 0;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._alpha = 0;
bar._visible = true;
border._visible = true;
pText._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
bar._width = (lBytes/tBytes)*100;
pText.text = "% "+Math.round((lBytes/tBytes)*100);
};
preload.onLoadComplete = function(targetMC) {
container.fadeIn();
border._visible = false;
bar._visible = false;
dText._visible = false;
trace(targetMC+" finished");
};
//default image
my_mc.loadClip("slideshow1.swf", "container");
//buttons
button1.onPress = function() {
my_mc.loadClip("slideshow1.swf", "container");
};
button2.onPress = function() {
my_mc.loadClip("slideshow2.swf", "container");
};
button3.onPress = function() {
my_mc.loadClip("slideshow3.swf", "container");
};




KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 08-26-2008, 09:20 AM


View Complete Forum Thread with Replies

Sponsored Links:

Help With Reusable Preloader Using MovieClipLoader
Hello,

I have followed the tutorial "Reusable Preloader Using MovieClipLoader"
HTML Code:
http://www.kirupa.com/developer/actionscript/moviecliploader.htm
and found it extremely helpful, there is just one thing i would like to add to the code which i think should be easy, but i cannot work it out...

I would like to add a fade out as well as a fade in...

Any help with this would be grateful. thanks

Lee

View Replies !    View Related
Reusable Preloader Using MovieClipLoader
Hi ,

I have used this wonderful tutorial and it is actually working in my swf! I am so happy because it's been terrible trying to find a preloading solution for my image gallery which has a script that must be kept on the first frame. The only thing now is that my buttons are in a sliding menu and so the external jpgs being loaded are sliding as well. I am wondering , is there any way with this script to place the "container" or empty mc and the loading bar etc. in a different mc than the buttons? That is the container where the images are loading into and the loading bar be in a different place to the buttons?

Tutorial :
http://www.kirupa.com/developer/acti...cliploader.htm

Thanks for the help,

Niki

View Replies !    View Related
Reusable Preloader Using MovieClipLoader
Hi ,

I have used this wonderful tutorial and it is actually working in my swf! I am so happy because it's been terrible trying to find a preloading solution for my image gallery which has a script that must be kept on the first frame. The only thing now is that my buttons are in a sliding menu and so the external jpgs being loaded are sliding as well. I am wondering , is there any way with this script to place the "container" or empty mc and the loading bar etc. in a different mc than the buttons? That is the container where the images are loading into and the loading bar be in a different place to the buttons?

Tutorial :
http://www.kirupa.com/developer/acti...cliploader.htm

The code is:


Code:
MovieClip.prototype.fadeIn = function() {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 10;
} else {
delete this.onEnterFrame;
}
};
};
bar._visible = false;
border._visible = false;
var empty = this.createEmptyMovieClip("container", "100");
empty._x = 447;
empty._y = -250;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._alpha = 0;
bar._visible = true;
border._visible = true;
pText._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
bar._width = (lBytes/tBytes)*100;
pText.text = "% "+Math.round((lBytes/tBytes)*100);
};
preload.onLoadComplete = function(targetMC) {
container.fadeIn();
border._visible = false;
bar._visible = false;
dText._visible = false;
trace(targetMC+" finished");
};
//default image
my_mc.loadClip("movieClipLoader/picture1.jpg", "container");
//buttons
button1.onPress = function() {
my_mc.loadClip("picture1.jpg", "container");
};
button2.onPress = function() {
my_mc.loadClip("picture2.jpg", "container");
};
button3.onPress = function() {
my_mc.loadClip("picture3.jpg", "container");
};
Can anyone help me modify the code so that the container and loadbar is on the main stage ( or another mc on the main stage) outside of the sliding menu where the buttons are?

Thanks I really appreciate the help,

Niki

View Replies !    View Related
Reusable Preloader Using MovieClipLoader (Help)
Hi, I'm very new in flash and i make the "Reusable Preloader Using MovieClipLoader" tutorial in Kirupa.com, the tut work just fine, this work creating a empty movie and making Jpgs appear on it trough a XML data... the only problem i got with it, is the Registration of the empty movie is in the Upper Left corner, and i think i need the Registration Mark in the center for display different sizes Jpgs, right? if so, please somebody can explain me how i could do it? i need center my pictures and they have different sizes.


Thanks, and sorry for my english.

View Replies !    View Related
Reusable Preloader Using MovieClipLoader
Hi - thank you for the tutorial Reusable Preloader Using MovieClipLoader by Macneilslt. I used it and learned a lot - I am new to flash! However, I have two problems - the first is that the % comes up before the number! I have played with the AS and fixed this, but now when I publish the flash and transfer to Dreamweaver, I don't get anything in my site - just a flash of my outline for the loader bar, and my movie does not load at all. What am I doing wrong?
I really appreciate this site and all the help available!
Thank you

View Replies !    View Related
Help With Reusable Preloader Using MovieClipLoader
Hello,

I have followed the tutorial "Reusable Preloader Using MovieClipLoader"
HTML Code:
http://www.kirupa.com/developer/actionscript/moviecliploader.htm
and found it extremely helpful, there is just one thing i would like to add to the code which i think should be easy, but i cannot work it out...

I would like to add a fade out as well as a fade in...

Any help with this would be grateful. thanks

Lee

View Replies !    View Related
About The New Tutorial - Reusable Preloader Using MovieClipLoader
hey guys, i've tried the new tutorial Reusable Preloader using MovieClipLoader and it's working. but the problem is, it's only working if the picture it will load will be http....

my_mc.loadClip("http://www.kirupa.com/../picture3.jpg", "container");

i tried changing it like this

my_mc.loadClip("picture3.jpg", "container");

and the preloader was no longer working. but the picture exist. I was trying to load the picture in the same folder where my flash movie is.
is there any alternative of doing this? thanks!!!

View Replies !    View Related
Reusable Preloader Using MovieClipLoader Tutorial
Hello:
I,m triying to use this tutorial, but the %100 no disapear until the image is fade in. How can I make it disapear inmediatly like the bar and border?.
Thanks a lot.

View Replies !    View Related
Problem With Reusable Preloader Using MovieClipLoader Tut.
Hey All,

I am trying to use a circular preloader instead of the "bar" in the Reusable Preloader Using MovieClipLoader tut. and am running into a problem/lack of AS knowledge...

The code I used for the preloader by itself is:


Code:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.preLoader.gotoAndStop(Math.round(getPercent*100));
trace(Math.round(getPercent*100));
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
_root.loading.gotoAndPlay(2);
}
I have tried adapting this to the following code:


Code:
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {

bar._width = (lBytes/tBytes)*100;
pText.text = "% "+Math.round((lBytes/tBytes)*100);

};
I am stuck so any help would be appreciated, the .fla is linked below, thanks!

http://www.missionvisionproductions.org/main_3.fla

View Replies !    View Related
About The New Tutorial - Reusable Preloader Using MovieClipLoader
hey guys, i've tried the new tutorial Reusable Preloader using MovieClipLoader and it's working. but the problem is, it's only working if the picture it will load will be http....

my_mc.loadClip("http://www.kirupa.com/../picture3.jpg", "container");

i tried changing it like this

my_mc.loadClip("picture3.jpg", "container");

and the preloader was no longer working. but the picture exist. I was trying to load the picture in the same folder where my flash movie is.
is there any alternative of doing this? thanks!!!

View Replies !    View Related
Reusable Preloader Using MovieClipLoader Tutorial
Hello:
I,m triying to use this tutorial, but the %100 no disapear until the image is fade in. How can I make it disapear inmediatly like the bar and border?.
Thanks a lot.

View Replies !    View Related
[FMX04] Paths Trouble In "Reusable Preloader Using MovieClipLoader Tutorial"
Hi. First off it's great to be here.. what a killer resource! Thanks!

I am having trouble with my paths in the Reusable Preloader Using MovieClipLoader" tutorial found here: http://www.kirupa.com/developer/acti...liploader2.htm

I am trying to basically load that entire swf into another movie. When I do of course nothing loads. I am almost positive that it's my paths in the preloader tutorial. Question is.. what needs to have the path modified in the turotial in order to load correctly inside another movie? I am assuming I need to use this. but am confused on where I should add it.

Perhaps this explains a little better. I have a master flash movie that is loading in the preloader tutorial swf (slightly modified not to use the buttons) into the loader component. When this happens it breaks. I am sure if I can just see it with all the paths I will be able to understand it. I have already read the paths tutorial here as well so I understand what paths to use.. just not where to use them. (slightly embarrased.. but I am learning).

Thanks in advance for any assistance offered!

View Replies !    View Related
Help With Reusable Preloader
I have writen the script for a reusable preloader. basically you click on one of the buttons and an swf clip is loaded onto the screen. However, there are two problems I need to solve:
1. the clips continues playing over and over again. I dont need them to loop. Probably I should include "stop();" somewhere so that they would stop after the first time but can't figure out how exactly to do that.
2. imagine that you are on the main page then you click a button and are forwarded to the place where you see clips. after you are dont you click back to go to the main page again and that is what happens except the fact the clip remain loaded on the screen. how to remove it? I guess I should write "false" for "container", but once again i dont have a clear idea how to solve this.

HERE IS THE SCRIPT:

MovieClip.prototype.fadeIn = function() {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 10;
} else {
delete this.onEnterFrame;
}
};
};
clip_preloader._visible = false;
loading_text02._visible = false;
var empty = this.createEmptyMovieClip("container", "100");
empty._x = 240;
empty._y = 263;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._alpha = 0;
clip_preloader._visible = true;
loading_text02._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
clip_preloader._width = (lBytes/tBytes)*100;
};
preload.onLoadComplete = function(targetMC) {
container.fadeIn();
loading_text02._visible = false;
clip_preloader._visible = false;
trace(targetMC+" finished");
};
//default image
my_mc.loadClip("default.jpg", "container");
//buttons
slot01.onPress = function() {
my_mc.loadClip("clip01.swf", "container");
};
slot02.onPress = function() {
my_mc.loadClip("clip02.swf", "container");
};
slot03.onPress = function() {
my_mc.loadClip("clip03.swf", "container");
};

View Replies !    View Related
Reusable Preloader
Hi,

I am trying to preload sections of my site, apears to be working great except the percentage (pText) refuses to display and none of my traces are working, any ideas?



empty = _root.main_mc.createEmptyMovieClip("container", "100")
empty._x = -250;
empty._y = -280;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
_root.main_mc.container._alpha = 0;
pText._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
pText.text = "% "+Math.round((lBytes/tBytes)*100);
};
preload.onLoadComplete = function(targetMC) {
// maskmove
_root.main_mc.container._alpha = 100;
pText._visible = false;
trace(targetMC+" finished");
};
var myLoad = _root.main_mc.container.loadMovie("news.swf");

View Replies !    View Related
Help With Reusable Preloader
I have writen the script for a reusable preloader. basically you click on one of the buttons and an swf clip is loaded onto the screen. However, there are two problems I need to solve:
1. the clips continues playing over and over again. I dont need them to loop. Probably I should include "stop();" somewhere so that they would stop after the first time but can't figure out how exactly to do that.
2. imagine that you are on the main page then you click a button and are forwarded to the place where you see clips. after you are dont you click back to go to the main page again and that is what happens except the fact the clip remain loaded on the screen. how to remove it? I guess I should write "false" for "container", but once again i dont have a clear idea how to solve this.

HERE IS THE SCRIPT:

MovieClip.prototype.fadeIn = function() {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 10;
} else {
delete this.onEnterFrame;
}
};
};
clip_preloader._visible = false;
loading_text02._visible = false;
var empty = this.createEmptyMovieClip("container", "100");
empty._x = 240;
empty._y = 263;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._alpha = 0;
clip_preloader._visible = true;
loading_text02._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
clip_preloader._width = (lBytes/tBytes)*100;
};
preload.onLoadComplete = function(targetMC) {
container.fadeIn();
loading_text02._visible = false;
clip_preloader._visible = false;
trace(targetMC+" finished");
};
//default image
my_mc.loadClip("default.jpg", "container");
//buttons
slot01.onPress = function() {
my_mc.loadClip("clip01.swf", "container");
};
slot02.onPress = function() {
my_mc.loadClip("clip02.swf", "container");
};
slot03.onPress = function() {
my_mc.loadClip("clip03.swf", "container");
};

View Replies !    View Related
Reusable Preloader
Hello. I used the resuable preloader in one of my projects lately. The code used is as follows:

bar._visible = false;
this.createEmptyMovieClip("container", "100");
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {

trace("started loading "+targetMC);
container._visible = false;
bar._visible = true;
border._visible = true;
pText._visible = true;

};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {

bar._width = (lBytes/tBytes)*100;
pText.text = "% "+Math.round((lBytes/tBytes)*100);

};
preload.onLoadComplete = function(targetMC) {

container._visible = true;
bar._visible = false;
pText._visible = false;
trace(targetMC+" finished");

};
//default image
my_mc.loadClip("news.swf", "container");
//buttons
button1.onPress = function() {

my_mc.loadClip("news.swf", "container");

};
button2.onPress = function() {

my_mc.loadClip("kills.swf", "container");

};
button3.onPress = function() {

my_mc.loadClip("picture3.jpg", "container");

};

so I am preloading .swf instead of simple pictures, which is fine. Although.. I have the menu included in the SWF's that I load so I dont know to edit the events on the code above to match those objects. (The code above is included in main.swf: the file that includes the preloader, and navigation menus are on news or killls.swf) Please help me out

View Replies !    View Related
Reusable Preloader
Hi,

I am trying to preload sections of my site, apears to be working great except the percentage (pText) refuses to display and none of my traces are working, any ideas?



empty = _root.main_mc.createEmptyMovieClip("container", "100")
empty._x = -250;
empty._y = -280;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
_root.main_mc.container._alpha = 0;
pText._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
pText.text = "% "+Math.round((lBytes/tBytes)*100);
};
preload.onLoadComplete = function(targetMC) {
// maskmove
_root.main_mc.container._alpha = 100;
pText._visible = false;
trace(targetMC+" finished");
};
var myLoad = _root.main_mc.container.loadMovie("news.swf");

View Replies !    View Related
Reusable Preloader Question
Hi. I've downloaded a reusable preloader and wanted to modify it so when you load the next image it comes up beside the original image rather than replacing it. The idea is that when the new image is loaded, both will then move so the new image is where the old one was.

Can anyone help me with this? i'm battling.

View Replies !    View Related
Moving A Reusable Preloader
Hi,

I've got a reusable preloader that I got from kirupa and modified, which works fine. I want to attach a movement script to it so when its in use it moves up a bit, then when its 100% it moves back down.


Code:
////////////////////////////////////////////////////////////////////////////////////////////////////////

speed = 8
elas = 1.3

function wobble() {
this.dy = this.ty - this._y
this.tempy = this.tempy/elas + this.dy/speed
this._y += this.tempy
}

////////////////////////////////////////////////////////////////////////////////////////////////////////

var empty = this.createEmptyMovieClip("container", "100");
empty._x = 0;
empty._y = 0;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
pText.ty = 100
pText.onEnterFrame = wobble
};

preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
pText.text = Math.round((lBytes/tBytes)*100)+"% ";
};

preload.onLoadComplete = function(targetMC) {
trace(targetMC+" finished");
pText.ty = 50
pText.onEnterFrame = wobble
};

////////////////////////////////////////////////////////////////////////////////////////////////////////

button1.onPress = function() {
my_mc.loadClip("http://www.kirupa.com/developer/actionscript/animation/picture1.jpg", "container");
};
button2.onPress = function() {
my_mc.loadClip("http://www.kirupa.com/developer/actionscript/animation/picture2.jpg", "container");
};
button3.onPress = function() {
my_mc.loadClip("http://www.kirupa.com/developer/actionscript/animation/picture3.jpg", "container");
};

////////////////////////////////////////////////////////////////////////////////////////////////////////

View Replies !    View Related
Reusable Preloader, Again But With A New Problem ;)
Hi!

I think the tutorial "Reusable Preloader Using MovieClipLoader" it's great!

I just have one simple problem that I belive is quite easy to solve. If I use this preloader code in my main movie and have other objects that I want to appear over the "container" mc, how do I change the code? I can see that in the output that the container loads the external files in _level10 but I don't know how to change that...

Here is the code that you all know:


Code:
MovieClip.prototype.fadeIn = function() {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 10;
} else {
delete this.onEnterFrame;
}
};
};
bar._visible = false;
border._visible = false;
var empty = this.createEmptyMovieClip("container", "100");
empty._x = 0;
empty._y = 0;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._alpha = 0;
bar._visible = true;
border._visible = true;
pText._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
bar._width = (lBytes/tBytes)*100;
pText.text = "% "+Math.round((lBytes/tBytes)*100);
};
preload.onLoadComplete = function(targetMC) {
container.fadeIn();
border._visible = false;
bar._visible = false;
dText._visible = false;
trace(targetMC+" finished");
};
//default image
my_mc.loadClip("movieClipLoader/picture1.jpg", "container");
//buttons
button1.onPress = function() {
my_mc.loadClip("http://www.kirupa.com/developer/actionscript/animation/picture1.jpg", "container");
};
button2.onPress = function() {
my_mc.loadClip("http://www.kirupa.com/developer/actionscript/animation/picture2.jpg", "container");
};
button3.onPress = function() {
my_mc.loadClip("http://www.kirupa.com/developer/actionscript/animation/picture3.jpg", "container");
};

View Replies !    View Related
AS3 - Reusable Preloader Questions
hey, umm so i finally got the time to start experimenting with AS3 and im having a little trouble with making a preloader i can use in multiple swfs, im not sure if im going about it the right ( or should i say preferable ) way.. my goal is to have a movie clip i can call to load something on the stage. have it appear on the stage, load whatever clip i send to the construcor, fade out, and have the content fade in.. fairly simple.. im just sure there are some wholes in my logic so far, id like to plug em and move on to the actuall content building. i just cant leave things like this though .. HAYELP!!


Code:
package com.illSci.ui
{
import flash.display.MovieClip;
import flash.net.URLLoader;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.text.TextField;
import flash.text.*;
import flash.display.Loader;
import caurina.transitions.*;




public class LoadClip extends MovieClip
{
private var urlRequest:URLRequest;
private var loader:Loader;
private var requestURL:String;



public function LoadClip(requestURL:String="content.swf"):void
{

var requestURL=requestURL;
var loader = new Loader();
var urlRequest:URLRequest = new URLRequest(requestURL);
loader.load(urlRequest);
loader.contentLoaderInfo.addEventListener(Event.OPEN, openHandler);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);

}

private function openHandler(e:Event):void
{
loadBar.scaleX = .001;
percent.text = "0%";

}

private function progressHandler (e:ProgressEvent):void
{
var pVal:Number = e.bytesLoaded / e.bytesTotal;
loadBar.scaleX= pVal;
percent.text = pVal*100+"%";

}

private function completeHandler (e:Event):void
{
var content=e.currentTarget.content;

//MOUSE EVENTS .. i have these to i can move the clip and see if the loader is still there.. couldnt figure out how to get rid of it and then add the content..
//
content.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler);
content.addEventListener(MouseEvent.MOUSE_UP, onMouseUpHandler);

putToStage(content)

}

private function putToStage(obj:MovieClip):void
{
trace(obj)
var contentHolder:MovieClip = new MovieClip();
var content = obj;
contentHolder.alpha = 0;
contentHolder.addChild(content)
stage.addChild(contentHolder)


}

private function onMouseDownHandler (e:MouseEvent):void
{
e.currentTarget.startDrag()
}

private function onMouseUpHandler (e:MouseEvent):void
{
e.currentTarget.stopDrag()
}


}
}
heres what i got so far .. if it helps any http://illsci.com/flash/exp/

View Replies !    View Related
How To Create Reusable Preloader...?
oftenly we create preloader for first in when whole site load.i saw some site have let's say xml base photoslid show their every photo transition has a preloader.how do it?is every transition manually create or external preloader or what..?
any one can explain it i want approach.!!!!!!!!!!!!!!!!!!!!!! thanks

View Replies !    View Related
[FMX04] Reusable Preloader From Tutorial
I've been using the "Reusable Preloader Using MovieClipLoader" from the tutorial section of this site.
The only difference is that i don't use 'm for preloading jpg. I load external swf files containing video. Everything works fine so far. The only problem is that the preloaded video already starts playing while preloading (at about 30%), but without showing the video.

This is the code i have so far:

Code:
bar._visible = false;
border._visible = false;
this.createEmptyMovieClip("container", "100");
container._x = 10;
container._y = 10;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {

trace("started loading "+targetMC);
container._visible = false;
bar._visible = true;
border._visible = true;
pText._visible = true;

};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {

bar._width = (lBytes/tBytes)*100;
pText.text = "% "+Math.round((lBytes/tBytes)*100);

};
preload.onLoadComplete = function(targetMC) {

container._visible = true;
border._visible = false;
bar._visible = false;
pText._visible = false;
trace(targetMC+" finished");

};
//default image
my_mc.loadClip("img/flash/screen.jpg", "container");
//buttons
button1.onPress = function() {
my_mc.loadClip("img/flash/commercial_high.swf", "container");
};
button2.onPress = function() {
my_mc.loadClip("img/flash/commercial_med.swf", "container");
};
button3.onPress = function() {
my_mc.loadClip("img/flash/commercial_low.swf", "container");
};
I think it goes wrong at the accentuated code?

Can anyone of you help me with this?

View Replies !    View Related
[FMX04] Reusable Preloader From Tutorial
I've been using the "Reusable Preloader Using MovieClipLoader" from the tutorial section of this site.
The only difference is that i don't use 'm for preloading jpg. I load external swf files containing video. Everything works fine so far. The only problem is that the preloaded video already starts playing while preloading (at about 30%), but without showing the video.

This is the code i have so far:

Code:
bar._visible = false;
border._visible = false;
this.createEmptyMovieClip("container", "100");
container._x = 10;
container._y = 10;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {

trace("started loading "+targetMC);
container._visible = false;
bar._visible = true;
border._visible = true;
pText._visible = true;

};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {

bar._width = (lBytes/tBytes)*100;
pText.text = "% "+Math.round((lBytes/tBytes)*100);

};
preload.onLoadComplete = function(targetMC) {

container._visible = true;
border._visible = false;
bar._visible = false;
pText._visible = false;
trace(targetMC+" finished");

};
//default image
my_mc.loadClip("img/flash/screen.jpg", "container");
//buttons
button1.onPress = function() {
my_mc.loadClip("img/flash/commercial_high.swf", "container");
};
button2.onPress = function() {
my_mc.loadClip("img/flash/commercial_med.swf", "container");
};
button3.onPress = function() {
my_mc.loadClip("img/flash/commercial_low.swf", "container");
};
I think it goes wrong at the accentuated code?

Can anyone of you help me with this?

View Replies !    View Related
Question About Reusable Preloader Tutorial (FlashMX 04)
Hi,

I tried out the tutorial Reusable Preloader Using MovieClipLoader:
http://www.kirupa.com/developer/acti...liploader2.htm

It worked fabulously, even a newbie like me was able to pull it off. However, I was wondering if anybody had an idea about how I would get the image that is loaded to center itself horizontally. I'm making a portfolio page, and I have lots of images of various sizes. As it is now, all images align themselves to the far left. I'm not at all familiar with Actionscript, so I don't have the first idea how to modify the code in the tutorial.

If anyone has any suggestions, I'd greatly appreciate it.

View Replies !    View Related
Reusable Preloader Working After First Preload Image
I am using the tutorial on the reusable preloader which works great on the first image. But, I recently noticed that it only preloads the first image time it is called, and I never see the preloader again. I am fairly comfortable with AS and I am not a newbie. But, I cant help but feel a little ticked off because I know it is something small that I am just overlooking. I have been searching for an answer for a couple of days nows....

Anyway, here is the link for the preview file.

http://boundless-vision.com/temp/v4_sample.html

Click on portfolio and choose a section and then a gallery piece. NOTE the preloader on the first gallery piece load... but you never see it again...

Which leads me to believe it is something that has to do with my coding - for putting a dynamic path to preload.. I have a loop which spits out the buttons and all of the corresponding data.

Anyway, here is what I believe is the affected code
this is in between my chGallery Function - that handles all of my load / parse / display functions.. Formatting might have it break, I apologize for that...


ActionScript Code:
<font size="2">for (var i = 0; i<chGalleryMC_path.GalleryItem.length; i++) {        // loop through the gallery item var I declared earlier        // this variable is a house for all of the gallery item         // nodes that are located within the chosen gallery xml file        chGalleryMC_Item_path.createEmptyMovieClip("container", i);        //        var myItemTitle = chGalleryMC_path.GalleryItem[i].firstChild.firstChild.nodeValue;        // declare a local variable to hold temporary name data for text input        chGalleryMC_path.gItem.duplicateMovieClip("gItem"+i, StartDepth+i);        // duplicate the attatched movie clip in order to loop        // through all of the required gallery items that were        // loaded from the xml file        //        gItem_Temp_MCPATH_Array.push(chGalleryMC_path["gItem"+i]);        trace(chGalleryMC_path["gItem"+i]);        //        //        //        chGalleryMC_path["gItem"+i]._y = startY+(MenuSpace*i)+200;        // increment each gallery item down the page        chGalleryMC_path["gItem"+i]._x = startX;        // set the horizontal space        chGalleryMC_path["gItem"+i].id = chGalleryMC_path.GalleryItem[i].attributes.id;        // set.id for the item from the xml node id attribute        chGalleryMC_path["gItem"+i].itemName.text = myItemTitle;        // display item Title        //chGalleryMC_Item_path.createEmptyMovieClip(myItemTitle, i);        //        chGalleryMC_path["gItem"+i].itemName_btn.num = i;        //        chGalleryMC_path["gItem"+i].itemName_btn.path = chGalleryMC_path.GalleryItem[i].attributes.path;        // set the button.path the same as the xml loaded gallery item path        // easy load in the release function below        //        chGalleryMC_path["gItem"+i].itemName_btn.onRollOver = function() {            if (this.num != GalleryItem_Selected) {                this._parent.itemName.setTextFormat(formatText_Bold);            }        };        //        chGalleryMC_path["gItem"+i].itemName_btn.onRollOut = function() {            if (this.num != GalleryItem_Selected) {                this._parent.itemName.setTextFormat(formatText_NOBold);            }        };        //        //        chGalleryMC_path["gItem"+i].itemName_btn.onRelease = function() {            // loop generated on release, to load the path of this button             // which is parsed from the xml doc            if (this.num != GalleryItem_Selected) {                // if you already clicked on it, it wont happen again                //                //                gItem_Old = gItem_New;                gItem_New = this.num;                gItemOLDpath = chGalleryMC_path["gItem"+gItem_Old];                //                //                MenuTitle_SET(gItem_Old, this.num, gItemOLDpath);                //                <font color="Red">gItemMCLoader.loadClip(chGalleryMC_path.GbasePath+this.path, chGalleryMC_Item_path.container);</font>                //loadMovie(chGalleryMC_path.GbasePath+this.path, gIContainer);                trace(chGalleryMC_Item_path[myItemTitle]);                // loads the image located at the chosen gallery path + xml loaded                 // gallery base path into the 'MYWINDOW' titled window                GalleryItem_Selected = this.num;                // set item selection the the parent id                trace("New: "+gMenuSelection_New);                trace("Old: "+gMenuSelection_Old);                trace("This.num: "+this.num);                trace("This.path: "+this.path);            }        };    }//////////////gItemMCLoader = new MovieClipLoader();gItemPreload = new Object();gItemMCLoader.addListener(gItemPreload);gItemPreload.onLoadStart = function(targetMC) {    gIContainer._alpha = 0;    bar._visible = true;    border._visible = true;    bgDS._visible = true;    gItemPreloaderMC.gItemFadeIn();};gItemPreload.onLoadProgress = function(targetMC, lBytes, tBytes) {    bar._width = (lBytes/tBytes)*100;};gItemPreload.onLoadComplete = function(targetMC) {    gIContainer.gItemFadeIn();    //gItemPreloaderMC.gItemFadeOut();    border.gItemFadeOut();    bar.gItemFadeOut();    bgDS.gItemFadeOut();};</font>


The preload call is made in the dynamically generated onRelease handler for the gallery item button. which loads the image / sets text / etc.. etc..

There are four _Shells that i use to load my portfolio images into , each for the sections of my gallery, I dont really want to break this method, only becuase once the image is loaded, it is loaded and there is no real reason for it to have it's own mc just yet. However, if you could come up with a solution for that also, It would be much appreciated.

Thank you for any responses in advance.

View Replies !    View Related
My Code For Reusable Preloader Doesn't Work
Hey plp!!

guys i need a little help here,im trying to create an advert box that loads different files from urls contained in an external xml src.
The code for the XML loading works well, but the rest of the code does not seem to work.

what im trying to archieve is:

1. get the list of urls from the XML file
2. trigger the loading of these files as soon as the xml file is loaded
3. loop among these files (5 in total), in a given period of time,
4. Each time they are loaded ,the loading bar should show the progress

here is my code (sorry its not organised ) :

Code:
_root.start_load_advert = function() {
load_advert_int = setInterval(load_advert, 10000);
};
load_advert = function () {
if (current_advert == undefined || current_advert == 6) {
current_advert = 1;
}
mcLoader.loadClip(_root["advert"+current_advert].url,container);
current_advert++;
};
function loadXML(loaded) {
if (loaded) {
i = 0;
while (i<=5) {
new_name = "advert"+(i+1);
_root[new_name] = new Array();
_root[new_name].url = this.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue;
_root[new_name].link = this.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue;
i++;
}
load_advert();
} else {
trace("file not loaded!");
; ;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("http://agmitre.vze.com/laconic/adver..._advert_db.xml");

var container:MovieClip = this.createEmptyMovieClip("container", _root.getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
B = bytesLoaded;
A = bytesTotal;
percentage = (B/A)*100;
loader._width = (percentage/100)*580;
clearInterval(load_advert_int);
trace(percentage);
};
listener.onLoadInit = function(target:MovieClip):Void {
mc_width = container._width;
mc_height = container._height;
container._x = (590-mc_width)/2;
container._y = (590-mc_height)/2;
removeMovieClip(sub_container);
container.duplicateMovieClip("sub_container",_root.getNextHighestDepth());
_root.start_load_advert();
};
mcLoader.addListener(listener);
loader._x = 5;
loader._alpha = 10;
stop();
NB:The code for the progress bar works when loading a single file using
mcLoader.loadClip("URL",container);


THX ALOT

AG

View Replies !    View Related
Question About Reusable Preloader Tutorial (FlashMX 04)
Hi,

I tried out the tutorial Reusable Preloader Using MovieClipLoader:
http://www.kirupa.com/developer/acti...liploader2.htm

It worked fabulously, even a newbie like me was able to pull it off. However, I was wondering if anybody had an idea about how I would get the image that is loaded to center itself horizontally. I'm making a portfolio page, and I have lots of images of various sizes. As it is now, all images align themselves to the far left. I'm not at all familiar with Actionscript, so I don't have the first idea how to modify the code in the tutorial.

If anyone has any suggestions, I'd greatly appreciate it.

View Replies !    View Related
Demo: FlashMX Multi Purpose Reusable Preloader
Last edited by monolithdd : 2002-07-06 at 22:09.
























Just copy and paste this code into frame one of your authouring enviornment
/* Preloader custom class. Developed and coded by Aaron Sears ©monolithDigital 2002
* Can use without charge, so long as credit is given and code is not altered.
* ---------------------------------------------------
* AddonList: in the future, concidering adding feature that allows one to set the preloading bar and textfield
* as properties, and will combine them at runtime, so as to create complete customization, or perhaps
* colour alteration in code, sound compatibility or other such widgets, as of yet, it is designed mostly for
* speed.
* -------------------------------------------------------
* message = string; If you want to display a specific message after
* byesLoaded or % in text window, state it here
* max_percent = amount of the movie to load before playing
* display_bar = bool; show progress bar or not default true;
* _axis = string; string literal of property to affect eg. '_alpha' or '_xscale' default _xscale
* display_text = string;'bytes','percent','none' | show bytes, percentage or no text in clip default none
* loading_clip = movieclip to preload;
* loading_fun = custom function to load when preloader is finished, default simply plays the loaded movieclip
* -------------------------------------------------------
*register class to preloading linked movieclip, all a movieclip needs to run is:
*a textfield (dynamic:'progress')
*a movieclip (_name = 'progress_bar')
*/

//==============================
function preloader(){
/*set defaults in event of no data in ob -------- */
(this.message==null)?(this.message='Loaded'):(0);
(this.display_bar==null)?(this.display_bar=true):(0);
(this._axis==null)?(this._axis='_xscale'):(0);
(this.display_text==null)?(this.display_text = 'none'):(0);
(this.max_percent==null)?(this.max_percent=100):(0);
(this.loading_clip==null)?(this.loading_clip=_level0):(0);
(this.loading_fun==null)?(this.loading_fun=function(){this.loading_clip.play()}):(0);
/*set constants and other misc data ----------- */
this.loading_clip.stop();
this.total_bytes = this.loading_clip.getBytesTotal();
/* init values of textfield and movieclip --------- */
(this.display_bar)?(this.bar[this.display_axis]=this.getPercent(false)):(0);
(this.display_text!='none')?(this.progress.text =(this.display_text=='bytes')?(this.displayBytes()):(this.getPercent(true))):(this.display.text='');
}
preloader.prototype = new MovieClip();
preloader.prototype.onEnterFrame=function(){
// set textfielf ------------------------------------
if (this.display_text!='none'){
this.progress.text=(this.display_text=='bytes')?(this.displayBytes()):(this.getPercent(true));
}
// set preloading bar ----------------------------
if (this.display_bar){
this.bar[this._axis]=this.getPercent(false);
}
/*status ---------------------------------------- */
(this.getPercent(false)>=this.max_percent)?(this.unloadMe()):(0);
}
preloader.prototype.unloadMe=function(){
/*im done, goodbye ------------------------------ */
this.loading_fun();
this.unloadMovie();
}
preloader.prototype.displayBytes=function(){
return this.loading_clip.getBytesLoaded()+'/'+this.total_bytes+'Bytes '+this.message;
}
preloader.prototype.getPercent=function(showText){
/*showtext detirmined if its textfield or property that gets value, string or int ------------*/
var _percent = (this.loading_clip.getBytesLoaded()/this.total_bytes)*100;
return (showText)?(''+(_percent<<.5)+'% '+this.message):(_percent);
}
//EOF============================

View Replies !    View Related
Moviecliploader With A Preloader
I'm having troubles with my preloader showing up when it's on the server. It seems to work fine when testing it locally, the preloader (a circle) spins until the clip is loaded, then it goes away. When it's on the server, nothing happens, and when the image is loaded it shows up as it's supposed to, the preloader never shows up. Any ideas?


Code:
this.createEmptyMovieClip("container",100);
this.attachMovie('circle','circle',1,{_x:Stage.width/2,_y:Stage.height/2,_visible:false,_width:26.4,_height:25});
//the image to load
theImg = "bannerImgs/1.jpg";
//the mcl and listener
myMCL = new MovieClipLoader();
myListener = new Object();
//on load start
myListener.onLoadStart = function(targetMC){
_root.circle._visible = true;
}
//on load progress
myListener.onLoadProgress = function(targetMC,lBytes,tBytes){
//spin the circle
_root.circle.onEnterFrame = function(){
this._rotation += 15;
}
}
//on load complete
myListener.onLoadComplete = function(targetMC){
_root.circle.onEnterFrame = null;
_root.circle._visible = false;
targetMC._alpha = 30;
}
function loadImg():Void{
myMCL.loadClip(theImg,"container");
}
myMCL.addListener(myListener);
loadImg();

View Replies !    View Related
Moviecliploader With A Preloader
I'm having troubles with my preloader showing up when it's on the server. It seems to work fine when testing it locally, the preloader (a circle) spins until the clip is loaded, then it goes away. When it's on the server, nothing happens, and when the image is loaded it shows up as it's supposed to, the preloader never shows up. Any ideas?


Code:
this.createEmptyMovieClip("container",100);
this.attachMovie('circle','circle',1,{_x:Stage.width/2,_y:Stage.height/2,_visible:false,_width:26.4,_height:25});
//the image to load
theImg = "bannerImgs/1.jpg";
//the mcl and listener
myMCL = new MovieClipLoader();
myListener = new Object();
//on load start
myListener.onLoadStart = function(targetMC){
_root.circle._visible = true;
}
//on load progress
myListener.onLoadProgress = function(targetMC,lBytes,tBytes){
//spin the circle
_root.circle.onEnterFrame = function(){
this._rotation += 15;
}
}
//on load complete
myListener.onLoadComplete = function(targetMC){
_root.circle.onEnterFrame = null;
_root.circle._visible = false;
targetMC._alpha = 30;
}
function loadImg():Void{
myMCL.loadClip(theImg,"container");
}
myMCL.addListener(myListener);
loadImg();

View Replies !    View Related
Preloader Problem: MovieClipLoader Bug?
So here's the deal: I've created a Preloader object that queues up a bunch of clips and displays the total percentage loaded via a StatusIndicator object.

Problem is, when I load a series of MovieClips via the MovieClipLoader.loadClip() function, Flash starts loading some clips and waits for them to finish downloading before loading the rest. This action appears to be random, inasmuch as there is no consistent behavior with regards to which clips are loaded and in what order. The end result is that my preloader keeps jumping up and down as new clips begin downloading and kick up the total percentage. The issue can be viewed in action in the work section at my agency's web site, http://www.in-comum.com.

So my question is, has anyone encountered this problem, and if so, have you found a bug fix and/or workaround for it?

View Replies !    View Related
Preloader Question Using MovieClipLoader
Hi guys, im making a preloader for detecting the progress of an external movie ill be loading into the main movie using the MovieClipLoader class. The code on the first frame of my actionscript movie is as follows( please note i have added trace actions for debugging purposes). The problem is when i test it in the bandwidth profiler the external movie just loads and starts playing, in fact the trace action within the function onLoadProgress is not even executed (and obviously the preloader isnt working as it seems this function isnt even being executed).

Does anybody have any idea what the cause for this is? Thanks a lot


Code:

//create movieClipLoader
mcLoader_mcl = new MovieClipLoader();
trace("Movie clip loader created");

//create the listener 'ears' for the MovieClipLoader
loadListener = new Object();
trace("Listener object created");

//attach the listener to the movieClipLoader
mcLoader_mcl.addListener(loadListener);
trace("Listener object added to mcLoader");

//tell moviecliploader to load the clip into the placeholder
mcLoader_mcl.loadClip("externalMovie.swf", placeHolder_mc);
trace("Put external movie in placeHolder");

//listening
loadListener.onLoadStart = function() {
trace("Inside onLoadStart");
placeHolder_mc.stop();
};

loadListener.onLoadProgress = function(loadTarget, loadedBytes, totalBytes) {
trace("Inside onLoadProgress");
bytesLoaded_txt.text = loadedBytes;
bytesTotal_txt.text = totalBytes;
bytesPercent_txt = Math.round((loadedBytes / totalBytes) * 100);
preloader_mc._xscale = Math.round((loadedBytes / totalBytes) * 100);
};

loadListener.onLoadComplete = function() {
trace("Inside onLoadComplete");
bytesLoaded_txt._visible = false;
bytesTotal_txt._visible = false;
bytesPercent_txt._visible = false;
placeHolder_mc.play();
};

The trace action i get is a as follows:


Movie clip loader created
Listener object created
Listener object added to mcLoader
Put external movie in placeHolder
Inside onLoadStart
Inside onComplete

View Replies !    View Related
[F8] MovieClipLoader - Preloader Issues
hi, i am constructing a portfolio website for a photographer friend.

i have a main stage, and external movie .swf for each gallery to save loading issues. i have spent days trying to construct a suitable preloader/progress bar for the external movies, and have finally built one that works. the only problem is that the galleries are supposed to fade in, but once the gallery has loaded, (ie. surpassing the preloader 'loading' screen) it has already faded in, the gallery's fade in animation has already completed, so the screen is still.

i hope someone can tell me how to make the external movie only begin to play once it has been fully loaded, so that the short fade in animation is displayed.

the current action script for the preloader is as follows:

stop();
var mcl:MovieClipLoader = new MovieClipLoader();

var mclL:Object = new Object();

mclL.onLoadProgress = function(target,loaded,total) {
loader.percent.text = Math.round((loaded/total) * 100) + "%";
}

mclL.onLoadInit = function() {
loader._visible = false;
loader.percent.text = "";
}

mcl.addListener(mclL);

mcl.loadClip("personalgallery01.swf",holder);

b1.onRelease = function() {
loader._visible = true;
mcl.loadClip("personalgallery01.swf",holder);
}

b2.onRelease = function() {
loader._visible = true;
mcl.loadClip("personalgallery02.swf",holder);
}



if it would help i can provide a web link if necessary. many thanks in advance for any help anyone can suggest

View Replies !    View Related
MovieClipLoader: Preloader Visibility
Greetings,
I am using a MovieClipLoader to load external SWFs into a blank movie clip.
I have created a 100 frame preloader (preloader.swf) to load every time a new SWF is triggered. When I test and publish the main movie, the preloader plays on the first frame of the main movie by default (no buttons clicked).I would like to the preloader to only be visible when trying to load another SWF. What have I done wrong? Thanks in advance!



Code:
//--------------------<MCL>-------------------\
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object ();

myMCL.addListener(myListener);

myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
_level50._visible = true;
var preloadPercent:Number = Math.round((loadedBytes/totalBytes) * 100);
_level50.preloader.gotoAndStop(preloadPercent);


}

myListener.onLoadComplete = function(target_mc:MovieClip) {
_level50._visible = false;
}
//--------------------</MCL>------------------\

//trigger the MCL to load these assets

myMCL.loadClip("preloader.swf", 50);


//-----------------<global Buttons>------------------\
yourButton.onRelease=function(){
myClip.gotoAndPlay(10);
}

myButton.onRelease=function() {
myMCL.loadClip("chapter1.swf", "myClip");

}

View Replies !    View Related
Preloader Using MovieClipLoader Problems
Hi ,

I have used this wonderful tutorial and it is actually working in my swf! I am so happy because it's been terrible trying to find a preloading solution for my image gallery which has a script that must be kept on the first frame. The only thing now is that my buttons are in a sliding menu and so the external jpgs being called are sliding as well. I am wondering , is there any way with this script to place the "container" or empty mc and the loading bar etc. in a different mc than the buttons?

Tutorial :
http://www.kirupa.com/developer/acti...cliploader.htm

The code is:


Code:
MovieClip.prototype.fadeIn = function() {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 10;
} else {
delete this.onEnterFrame;
}
};
};
bar._visible = false;
border._visible = false;
var empty = this.createEmptyMovieClip("container", "100");
empty._x = 447;
empty._y = -250;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._alpha = 0;
bar._visible = true;
border._visible = true;
pText._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
bar._width = (lBytes/tBytes)*100;
pText.text = "% "+Math.round((lBytes/tBytes)*100);
};
preload.onLoadComplete = function(targetMC) {
container.fadeIn();
border._visible = false;
bar._visible = false;
dText._visible = false;
trace(targetMC+" finished");
};
//default image
my_mc.loadClip("movieClipLoader/picture1.jpg", "container");
//buttons
button1.onPress = function() {
my_mc.loadClip("picture1.jpg", "container");
};
button2.onPress = function() {
my_mc.loadClip("picture2.jpg", "container");
};
button3.onPress = function() {
my_mc.loadClip("picture3.jpg", "container");
};
Can anyone help me modify the code so that the container and loadbar is on the main stage ( or another mc on the main stage) outside of the sliding menu where the buttons are?

Thanks I really appreciate the help,

Niki

View Replies !    View Related
Struggling With MovieClipLoader Preloader
Can anyone help with this little problem,

I'm trying to display a loader to show the percentage of a swf that is loading into my master swf.

The master swf uses a file called trigger.swf to load in all the assets from a sharedLib - its the sharedLib percentage that i would like to show - have a look at my master.swf AS and please someone help - i've been trawling through basic preloader scripts all day!!

code:

stop();

var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);

myMCL.loadClip("trigger.swf", 5);

(Trigger.swf starts the playhead when it is completley loaded)

Thanks

View Replies !    View Related
F8: ONE Preloader For All Clips Using MovieClipLoader
Hello folks,
I'm using a MovieClipLoader to load multiple images into multiple movieclips, and I would like to have a preloader bar that loads them all at the same time, rather than one after the other. I've seen some that dynamically create empty movie clips on the fly, but I need to load my images into specifically named and placed movieclips.

As far as I can tell, my script should update a global variable for total bytes loaded so far(totalLoaded) and another for total bytes to be loaded (totalToLoad). I am able to get that second variable accurately, but not the first--the slower the connection is (with Simulate Download), the closer it gets to 100, but never quite makes it. (With local testing speed it only reaches around 60%!)

Maybe this has something to do with a difference between getProgress and onLoadProgress?


ActionScript Code:
this.createEmptyMovieClip("dash_holder", -10);this.createEmptyMovieClip("bar_holder", 20);dash_holder._x = bar_holder._x = 0;dash_holder._y = bar_holder._y = 0;var images:Array = ["dash.jpg", "bar.png"];var destinations:Array = [_root.dash_holder, _root.bar_holder];var totals:Array = [0, 0];_global.totalLoaded = 0;_global.totalToLoad = 0;var myLoader = new MovieClipLoader();myLoader.onLoadStart = function(targetMC) {    var loadProgress = myLoader.getProgress(targetMC);    _global.totalToLoad += loadProgress.bytesTotal;};myLoader.onLoadProgress = function(targetMC, lBytes, tBytes) {    for (i=0; i<images.length; i++) {        if (destinations[i].loadedBytes != undefined) {            totals[i] = destinations[i].loadedBytes;        }    }    _global.totalLoaded = totals[0] + totals[1]; //Not sure how to find the sum of all totals[] values without typing them out this way?    targetMC.loadedBytes = lBytes;    trace(_global.totalLoaded+" out of "+_global.totalToLoad+" loaded");};for (i=0; i<images.length; i++) {    myLoader.loadClip(images[i], destinations[i]);}


Any help is appreciated!

View Replies !    View Related
HELP MovieClipLoader Preloader Playing .swf Before %100
HELP!

I've built a Preloader using the MovieClipLoader to load an external .swf into a blank container on another page.

the problem I am having is that the movie will begin to play before it's loaded and before the preloader has completed. I cannot for the life of me figure out why the movie doesn't wait to play until the whole swf has download. Please HELP, I would be very grateful.

here's the action script i'm using, anybody see what the problem is?!

var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();

myMCL.addListener(myListener);

myListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
var loaded:Number = Math.round((bytesLoaded/bytesTotal) * 100);
progressBar.gotoAndStop(loaded);
}

myListener.onLoadComplete = function (target_mc:MovieClip) {
progressBar._visible = false;
}

myListener.onLoadStart = function (target_mc:MovieClip) {
progressBar._visible = true;
}

myMCL.loadClip("main.swf", "container");

thank you!!!!

View Replies !    View Related
MovieClipLoader Preloader Woes: Help Me OB One
I'm getting frustrated. I can't find a complete example of new way of pre-loading in mx 2004.

So... I have mclic i want to pre-load in to my main clip. I want the source path to be a variable so when i click something else it will load the chosen clip and use this one pre-loader for each new clip loaded.

My clips to be loaded have an empty frame with stop(). So when it will finish loading the pre-loader will tell it to got nextFrame.

This is the AC2 i have so far from some tuts but no avail. This code is in the first frame. It will end up being a seperate standalone loading clip.


ActionScript Code:
stop();
var loadthis = "images.swf";
var mcLoader:MovieClipLoader = new MovieClipLoader();
var Listener:Object = new Object();
Listener.onLoadComplete = function(empty_mc) {
    this.empty_mc.gotoAndStop(2);
    this.nextFrame();
};
mcLoader.addListener(Listener);
mcLoader.loadClip(_root.loadthis, this.empty_mc);
trace(_root.loadthis);



Thanks in advance

View Replies !    View Related
Array Preloader With MovieClipLoader Class
I am making this array preloader, here is the script:


PHP Code:




stop();


arrayLength = movieClipArray._length;
totalLoaded = 0;
i = 0;


var myMCL = new MovieClipLoader();//create an instance of MovieClipLoader
totalAll = 0;

// this will be called when the preloader finishes animating out



myMCL.onLoadProgress = function (targetMC:MovieClip, loadedBytes:Number, totalBytes:Number) {
        
        if(container[i].loadedBytes == container[i].totalBytes){totalLoaded += loadedBytes};

        totalAll += totalBytes;
        myTrace("totalLoaded= " + totalLoaded);
        myTrace("totalAll= " + totalAll);
        pct = Math.round((totalLoaded/totalAll) * 100);
        myTrace("pct= " + pct);
        progress_mc.gotoAndStop(pct);
        cf=progress_mc._currentframe;
        myTrace("currentFrame= " + cf);

}

myMCL.onLoadComplete = function(targetMC)
{
        myTrace("loadcomplete" + i);
        
        
        
        
}

myMCL.onLoadInit = function (targetMC)
{

    myTrace("init");
    i++;
    //if the laoder has gone through the array then stop, otherwise keep going

    createEmptyMovieClip("container"+i,_root.getNextHighestDepth());//creates empty movieclip for movie to load into
    myMCL.loadClip(movieClipArray[i],"container"+i);
    setProperty("container"+i, _alpha, 0); //sets movie to invisible
    myTrace("container=" + i);
    
}

myMCL.onLoadError = function (targetMC, errorCode)
{
    trace("ERROR BZATCH!");
}

function myTrace(msg)
{
        _root.traceBox.text += msg + newline;
        _root.traceBox.vPosition = _root.traceBox.maxVPosition;
}


movieClipArray = new Array("intro.swf","team.swf", "photogallery.swf", "overview.swf", "history.swf");

createEmptyMovieClip("container"+i,_root.getNextHighestDepth());
myMCL.loadClip(movieClipArray[i],"container"+i);
setProperty("container"+i, _alpha, 0);








The problem I am having is the percentage is coming out at the end: 1069% when it shouldn't go over 100%. My Bytesloaded never equal my bytesTotal either, so I don't know how the percentage variable(pct) is going over 100.

Can anyone help?

View Replies !    View Related
Full Screen Preloader With MovieClipLoader
Hi,

Im trying to make a reusable preloader that stretches across the screen like this...

http://www.answerracing.com/

Here is my code, but I can not seem to get it to work. Can anyone point out where I'm going wrong.

Many Thanks


ActionScript Code:
Stage.scaleMode = "noscale";
Stage.align = "tl";
 
 
 
stop();
#include "lmc_tween.as"
 
//--< SET UP LISTENER >---------------------------------------------------------
 
var myMCL:MovieClipLoader = new MovieClipLoader ();
var myListener: Object = new Object();
myMCL.addListener(myListener);
 
 
 
//--< PRELOADER CODE >----------------------------------------------------------
var sl:Object = new Object();
 
sl.onResize = function() {
    preloader._width = Stage.width;
    preloader._height = Stage.width;
};
preloader.bar._xscale = 0;
 
 
//onLoadStart - Function executed when the file is just pulled from the server before loading starts
myListener.onLoadStart = function(targetMC) {
    trace("started loading " + targetMC);
    preloader.bar._xscale = 0;
};
 
   
//onLoadProgress - Function executed while the files is being loaded
myListener.onLoadProgress = function(targetMC, loadedBytes, totalBytes) {
   
    trace("load in progress");
    var preloadPercent:Number = Math.round(loadedBytes/totalBytes *100);
    preloader.bar._xscale = preloadPercent; //Math.floor((Stage.width/100) *preloadPercent)
};
   
   
//onLoadComplete - Function executed once the file is finished loading
myListener.onLoadComplete = function(targetMC) {
    preloader.bar._xscale = 100;
    preloader.tween("_alpha", 0, 2, "easeOutBack");
    trace(targetMC + " loadComplete");
};
 
 
//onLoadInit - Function executed once the file is loaded and first frame is intialized
myListener.onLoadInit = function(targetMC) {
    trace(targetMC + " onLoadInit");
};
 
 
//--< LOAD CLIPS >-------------------------------------------------------------
 
myMCL.loadClip("bg.swf" , BG);
stop();

View Replies !    View Related
Moviecliploader: Preloader Issue W/absolute Path
I have several html pages located in several folders while master swf located in different folder with essential swfs: preloader, nav, trigger (that are to load into master via moviecliploader function). The master swf ueses the absolute paths instead of relatative paths to load swfs due to pages being located in different folders. It was able to load all essential swfs, bummer the preloader won't show the progress of preloading mc if path's absolute.

Frame 1:

Code:
stop();

// create new mc
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();

myMCL.addListener(myListener);

// preloader function to load mcs
myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
_level50._visible = true;
var preloadPercent:Number = Math.round((loadedBytes / totalBytes) * 100);
_level50.preloader.gotoAndStop(preloadPercent);
}

// hide preloader after load level5 mc
myListener.onLoadComplete = function(target_mc:MovieClip) {
_level50._visible = false;
}

// trigger level5 to load into stage
myMCL.loadClip("http://www.test/swfs/trigger.swf", 5);

// trigger preloader to load into stage
myMCL.loadClip("http://www.test/swfs/preloader.swf", 50);
Frame 5:

Code:
stop();
myMCL.loadClip("http://www.test/swfs/nav.swf", 5);
any suggestion or alternative to address ths issue?

Jace

View Replies !    View Related
Moviecliploader: Preloader Issue W/absolute Path
I have several html pages located in several folders while master swf located in different folder with essential swfs: preloader, nav, trigger (to be load into master via moviecliploader function). So I use the absolute paths instead of relatative paths to load swfs, but the preloader seem doesn't work by show the preloading progress with mc if path's absolute.

Frame 1:

Code:
stop();

// create new mc
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();

myMCL.addListener(myListener);

// preloader function to load mcs
myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
_level50._visible = true;
var preloadPercent:Number = Math.round((loadedBytes / totalBytes) * 100);
_level50.preloader.gotoAndStop(preloadPercent);
}

// hide preloader after load level5 mc
myListener.onLoadComplete = function(target_mc:MovieClip) {
_level50._visible = false;
}

// trigger level5 to load into stage
myMCL.loadClip("http://www.test/swfs/trigger.swf", 5);

// trigger preloader to load into stage
myMCL.loadClip("http://www.test/swfs/preloader.swf", 50);
Frame 5:

Code:
stop();
myMCL.loadClip("http://www.test/swfs/nav.swf", 5);
any suggestion?

Friggin' Mick

View Replies !    View Related
Full Window Width Preloader Using MovieclipLoader
Hi all,

Is it possible to create a full window width preloader using the MovieclipLoader class?

I've found posts on full screen preloaders (here) and have tried to adapt the code but it didn't work. So before I pursue it any further I just was wondering if it can be done in the first place?? And if so anyone have any ideas how?!?

Thanks

View Replies !    View Related
Preloader Not Showing When MovieClipLoader Is Loading Data?
Can someone please check my code, as i have a preloader that should be working but apparently isn't?

Frame 1 of the root timeline:
Code:

stop();

var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);

myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
   //_level50._visible = true;
   var preloadPercent:Number = Math.round((loadedBytes/totalBytes) * 100);
   _level50.preloader.gotoAndStop(preloadPercent);
   _level50.preloadInfo1.text = preloadPercent + " %";
   _level50.preloadInfo2.text = Math.round(loadedBytes / 1000) + " kb / " + Math.round(totalBytes / 1000) + " kb";
}

myListener.onLoadComplete = function(target_mc:MovieClip) {
   _level50._visible = false;
}
   

myMCL.loadClip("trigger.swf", 5);
myMCL.loadClip("preloader.swf", 50);
myMCL.loadClip("home.swf", 50);

Frame 10 of the root timeline:
Code:

stop();


Any advice?
thanks, JacoX

View Replies !    View Related
Loading Multiple Clips For One Preloader Animation With MovieClipLoader?
i was just wondering if its possible to load multiple external clips using one MovieClipLoader instance and object and one animation to accompany that. how could i write the code for this?

View Replies !    View Related
Preloading A MovieClipLoader() With A MovieClipLoader() Inside
Is it posible to make a preloader of a SWF that loads an external JPG?

Thanks

View Replies !    View Related
Preloading A MovieClipLoader() With A MovieClipLoader() Inside
Is it posible to make a preloader of a SWF that loads an external JPG?

Thanks

View Replies !    View Related
Reusable.FLA
I was wondering if it is at all possible to reuse a .FLA file?

I have created a preloader that has my company LOGO on it and It took me a very long time to design it. I was wondering if there is a way that I could just reuse it on all my movies without haveing to spend the time recreating it every movie I make?

If it is at all possible can anyone explain in detail?

View Replies !    View Related
Reusable Code
I'm a little bad at writing reusable code and I'd like some help. This example isn't exactly with reusable code, but it could easily be made that way. Say that varaiables path0 and path1 contain paths to movie clips. How do I set the _y value of path0 to the _y value of path1 other than this code?

PHP Code:




tellTarget(path0){
   _root.variable = _y;
};
tellTarget(path1){
   _y = _root.variable;
};






Any help is appreciated.

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