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




PreLoad/Loader Components Or Self Code AS?



Hi guys,
Well, I've tried various ways to code a preloader without using the MX2004 components (actually I used them first but found, as all do, that the extra 30K sucks! -and yes, I went through Eyezberg's' thread above, didn't help my situation.). I did a google "flash preloader" search, went through all those. FlashKit tutes. Kirupa Tutes. Etc...

I CAN make a preloader that preloads the main swf and I can do it in a couple of ways thanks to all the tutes (using either loadMovie or the new MovieClipLoader class). BUT, I CAN'T get any of them to work with an on(release) for an externally loaded swf.

Eg:
1-Main movie loads.
2-Buttons appear.
3-User clicks on a button.
4-Main movie goes to server to retrieve another movie and places it into an empty mc within the main movie while displaying a progress bar showing progress of loading movie.
5-Loading movie arrives complete and progress bar disappears.

What I've been trying to do is modify this preloader:
http://www.kirupa.com/developer/mx/p...epreloader.htm

Here's my fla if anyone can help.
Click on the "mission" button and you'll notice that the attached swf does load but even "simulating download" doesn't produce the progress bar.

Thanks in advance for anyone who can help.



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 05-02-2004, 02:53 PM


View Complete Forum Thread with Replies

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

PreLoad/Loader Components Or Self Code AS?
Hi guys,
Well, I've tried various ways to code a preloader without using the MX2004 components (actually I used them first but found, as all do, that the extra 30K sucks! -and yes, I went through Eyezberg's' thread above, didn't help my situation.). I did a google "flash preloader" search, went through all those. FlashKit tutes. Kirupa Tutes. Etc...

I CAN make a preloader that preloads the main swf and I can do it in a couple of ways thanks to all the tutes (using either loadMovie or the new MovieClipLoader class). BUT, I CAN'T get any of them to work with an on(release) for an externally loaded swf.

Eg:
1-Main movie loads.
2-Buttons appear.
3-User clicks on a button.
4-Main movie goes to server to retrieve another movie and places it into an empty mc within the main movie while displaying a progress bar showing progress of loading movie.
5-Loading movie arrives complete and progress bar disappears.

What I've been trying to do is modify this preloader:
http://www.kirupa.com/developer/mx/p...epreloader.htm

Here's my fla if anyone can help.
Click on the "mission" button and you'll notice that the attached swf does load but even "simulating download" doesn't produce the progress bar.

Thanks in advance for anyone who can help.

Preload Code Help - Holding Content During Preload
First off, the current code works fine in terms of function but I want to see if someone has a code fix for me. When the preloader starts, I want the current image to "hold" inplace instead of being unloaded from the "container" MC. I want the bar to load, covering up the current image and then when the preload is complete, load the next image in and display it. Does anyone have an idea on how I might rearrange or change the code? I know I have seen this same technique on several web pages, I just havn't been able to figure out how to execute it.

click on btn1 or btn2 to load an image.

Here's the current SWF

http://josephryannasipak.com/test.html

Here's the code:

stop();

bar._visible = false;


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;

}

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

preload.onLoadComplete = function(targetMC) {
container._visible = true;
bar._visible = false;
trace(targetMC+" finished");
};

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

btn1.onPress = function () {
my_mc.loadClip("bluest.jpg", "container");
}

btn2.onPress = function () {
my_mc.loadClip("church.jpg", "container");
}

and the FLA file:

http://josephryannasipak.com/test.fla

How Do You Preload Components?
Hello All,
I have a movie with 2 scenes.
the first scene is simply a bar/percentage preloader, only about 6k for the first scene.

On the second scene, I am using a few Drop down menu components amongst other graphics and MC's which are about 200k and all placed on the first frame.

The problem is, flash seems to want to load the components first - before anything, so it preloads 60k for the damn dropdown menu, BEFORE it even shows the small 6k bar preloader! After loading the components, it then shows my preloader at 40% and continues to load like it should...

Is there any way to FORCE flash to load the components AFTER the preloader? So it actually loads from the first frame of the first scene?

Thanks,
FH

Movie Uses Components... How To Preload?
how do i do preloading if i do use components in my movies.. before the first frame can load, the downloading of the componenets started...

Preload Movie That Uses Components
I need help making a preloader for my main movie that uses components. Because components must be loaded in the first frame, if I use a standard preload approach the preloader won't show until 20% of the movie is loaded. So I found this work around here:
http://odin.prohosting.com/~oldnew/f...ng/preload.zip

Everthing works great but only one problem. My movie loads a sound swf into level 1 and then the movie starts at the same time. When i use the above preloader it can't load the sound. You can see it at http://www.upfieldmedia.com/2ndpreload.html and if you go here http://www.upfieldmedia.com you will see what it does with a standard preloader. The page apprears after about 20% loaded and the sound loads correctly. ( need to clear your cache before you check each page)

My problem is how do I combine this preloader with my current movie? my files are here http://www.upfieldmedia.com/files.htm

Components Again - Messing Up My Preload
Hi all - I know that streaming down components screws up your preloader because they are kb heavy and try to go out on the first KF. I've unchecked the 'Export on first KF' and have set my classes to load on frame 2.

I have three scenes, a preloader, a component scene (just a dumping ground for my components) and the main movie. This seperates them all out so that the components don't come down before the loader; the components scene is never called but still counts towards the getTotalBytes() amount and the main movie loads in some xml to make use of the components.

In flash, doing a streaming test at say 56k or at a DSL level, this works fine. The preloader works out everything fine and then the movie loads.

In a live server environment, the preloader loads and the main movie appears, but the components are not there - well sort of semi there, not activated properly. I'm pulling my hair out over this as it's doing my nut. How can it work in flash but not online, either they both do or both don't.

Has anyone come up with a way of loading components properly ie after the preloader? Please don't say, no, don't use components or something like that as I have to.

any help would be great

thanks

frank

Preload Problems With Components
What I have: A working .fla which displays thumbnails of content, allows users to scroll through the thumbnails and upon clicking enlarges the thumb to a full image.

What I want to do: Create a simple preloader to let people know that the content is on its way. (Now it just shows white)
I have already moved the content to load on frame 2, as to keep frame 1 free for the preloader. Where I run into trouble is that the .fla consists of only one frame, entirely made of AS (most of which I don't understand as I am a copy/paste noober). The code utilizes onEnterFrame to repeatedly check what the mouse is doing. What I need to do is to loop this code within itself (frame 2) as opposed to to it looping back to frame 1 and giving me the flicker. Does this make sense? Ideas? Thanks.

Preload Components = Feeling Suicidal
I've tried 3 ways to preload a flash document that has components in it.

1: preloaded built into doc, change linkage to frame 2 etc..
2: create a preloaded swf that loads the main swf using the loader control.
3: use the movieClipLoader to load the main swf.

None of these methods work!

I've a combo box that is populated from an xml file using the XML object and when the preload is complete the comboBox doesn't have any entries. I tried the same preload with a simple swf that has a comboBox populated by actionscript and this doesn't work either.

Any ideas, it's driving me nuts. :shock:

Components (Loader)
i have used 1 of the components (Loader) and i set it to load a swf and scale it to fit, all was fine but i decided to add a loaded progress to the swf but now it dosent scale it for me,
can an1 please help?

Loader Components
I had to take over a job that is a mess. It's in 2 parts and each part is over 2400 frames. I figured I would make a shell and import the large files as swf in a loader component. But the movies get cut off. They don't play all the way through. I don't have to make the shell 2400 frames do I?

Components - Loader
Hi
Being new here I just try my first question: I just started with flash mx2004. I want to make some webpages with little video-films. I understood that you should be able to place a preloader or progressbar to show people that something real interesting is coming. But... How??
I read the tutorial but that doesn t mean that I can handle that! I haven't been able to place the film in the right way. At least the tutorial doesn't explain where to put the swf... and I cannot think of any bright place...
so please give me some hints, someone there?
Suz

Help About Ui Components (loader)
Hello!

I use loader component to load dynamically photo into a flash project, and I publish It in html.

I am trying to use this photos as buttons, can this be done?
what i want is to use the "gotoAndPlay("Scene 3", 5);" command
Does anyone now how to do it?

Thanks a lot.

Preload Flash Video Using Media Components
Is there anyway to preload flash video(flv) when using the media components?

Loader And Progress Bar Components
Are there any simple tutorials for using the Loader and Progress Bar components?


Help!!!!!!!!!!!!!!!!!!!!!

Loader Components - Expanding?
Hey everyone,

Ok so Im using loader components to load some photos that are in a folder. Everything works fine as they load properly and show up in the swf file when executed.

However, on the *rare* occassion, sometimes the photos expand covering the page.

For example, the loader is 100x100, about the size of a thumbnail and should be so when the swf runs. But sometimes the swf expands the loader component causing the photo to be 500x500, covering the screen.

Any thoughts?

[F8] Progress Bar And Loader Components...
Hi there I'm having a little trouble with using the progress bar with the loader component.

I have them both in a movieclip and they work fine when you test just the movieclip, but as soon as I put the movieclip in a scene the progress bar doesn't work anymore.

Here's the code...

myProgressBarListener = new Object();
myProgressBarListener = function (eventObject) {
myProgressBar._visible = false;
};
myProgressBar.addEventListener("complete", myProgressBarListener);
myProgressBar.mode = "polled";
myProgressBar.source = "my_loader";
myProgressBar.conversion = "1";
myProgressBar.label = "LOADING %3%%";
myProgressBar.direction = "right";
myProgressBar.labelPlacement = "bottom";
my_loader.loadMovie("http://media.ft.com/cms/3a00e22e-8312-11dc-b042-0000779fd2ac.swf", true);

Like I said when I test the movieclip the progress bar work aas it's supposed to and disappears when loaded. However when I put the movieclip on the stage the progress bar bar stays at 0% and doesn't disappear when movie starts to load in.

Am I missing something?

Best
Steve

Preload External .swf With Initial Loader?
My site that im working on is http://www.piolthy.com/pyro/pyronav1_with_Preloader.swf
I have a preloader set up, however... i dont know how to get it to preload all the individual movies!?!? It is doing its job with the main movie, but if you click on any of the unfinished sites that load "construction.swf" you can tell it hasn't preloaded it. What do I gotta do to get all those external movies to load with preloader?

Preload From Components Making Huge File Size..
im having trouble making a simple preloader using the progress bar and loader component while keeping a small file size. i have one made using 2 layers: one with a loader and other with the progress bar, thats it nothing else. when i publish it the file size is 106k..something im doing must be wrong. here is my fla if anyone can help it will be appreciated.

http://www.exraze.com/files/preshane.fla

Preload From Components Making Huge File Size..
im having trouble making a simple preloader using the progress bar and loader component while keeping a small file size. i have one made using 2 layers: one with a loader and other with the progress bar, thats it nothing else. when i publish it the file size is 106k..something im doing must be wrong. here is my fla if anyone can help it will be appreciated.

http://www.exraze.com/files/preshane.fla

HOPELESS - Using Progress Bar/Loader Components
Hello everyone!

I'm about to start tearing my hair out, and I would be forever grateful for some expert advice.

I am using Flash 8, and want to use a single instance of the loader component with a single instance of the progress bar component to preload multiple external SWFs. I have it working fine for the first SWFs loading in, but when I try to preload in a different SWF further down the timeline using the same loader instance and progressbar instance it doesn't work.

If you can direct me to a tutorial of some kind or put me in the right direction I would be stoked.

Here is the code i'm using for the first external SWF:

PreloaderBar.setStyle("themeColor", 0xD51729)
PreloaderBarListener = new Object();
PreloaderBarListener = function (eventObject) {
PreloaderBar._visible = false;
};
ContentLoader.scaleContent = false;
ContentLoader.contentPath = "home.swf";
PreloaderBar.addEventListener("complete", PreloaderBarListener);
PreloaderBar.mode = "polled";
PreloaderBar.source = "ContentLoader";
PreloaderBar.direction = "right";
stop();

Then for the next SWF I want to load in I have added a keyframe in my actionscript layer further down on the timeline and inserted this code:

PreloaderBar.setStyle("themeColor", 0xD51729)
PreloaderBarProductsListener = new Object();
PreloaderBarProductsListener = function (eventObject) {
PreloaderBar._visible = false;
};
ContentLoader.scaleContent = false;
ContentLoader.contentPath = "products.swf";
PreloaderBar.addEventListener("complete", PreloaderBarProductsListener);
PreloaderBar.mode = "polled";
PreloaderBar.source = "ContentLoader";
PreloaderBar.direction = "right";
stop();

Just changing the contentPath to a different SWF

Please let me know if this is the right way to go about doing this, if there is an easier way, or if my code is completely wrong.

Thanks!
Quinn

Trouble With XMLConnector And Loader Components In CS3
Using AS2 in Flash CS3 on a PC.

The problem I'm having is with the loader component. I'm pretty sure I have the binding done correctly but I still can't get the image to display. I did the exact same thing with a combobox and it displayed the data properly, so I'm not sure what the problem is.

Here is the XML file I'm using:


Code:
<?xml version="1.0" encoding="UTF-8"?>
<asians>
<asian name="Addicted">
<description>When a race car driver dies in an accident, his brother strangely starts to take on his personality traits, and even his looks. Soon, a disturbing relationship develops between the brother and the dead man's widow.</description>
<image>"http://www.maverickentertainment.cc/images/products/asians.jpg"</image>
</asian>
<asian name="Ardor">
<description>"Ardor" depicts the life of an average woman overcoming her dull life through a captivating love affair. We witness the moment to moment changes the main characters must face in response to her actions.</description>
<image>"http://www.maverickentertainment.cc/images/products/asians2.jpg"</image>
</asian>

</asians>
When I imported the xml schema it read the file perfectly. Here is a link to my fla file. Can someone please look at it and tell me what is wrong?

http://www.maverickentertainment.cc/ftp/index_ex.zip

Trouble With XMLConnector And Loader Components In CS3
Using AS2 in Flash CS3 on a PC.

The problem I'm having is with the loader component. I'm pretty sure I have the binding done correctly but I still can't get the image to display. I did the exact same thing with a combobox and it displayed the data properly, so I'm not sure what the problem is.

When I imported the xml schema it read the file perfectly. I have the "image" string bound to the Loader (instance name: asian_load) and the URL of the image is specified in the xml file. However, the image is still not showing up in the Loader when I test the movie.

Here is a link to my fla file. Can someone please look at it and tell me what is wrong?

http://www.maverickentertainment.cc/ftp/index_ex.zip

Here is the XML file I'm using:







Attach Code

<?xml version="1.0" encoding="UTF-8"?>
<asians>
<asian name="Addicted">
<description>When a race car driver dies in an accident, his brother strangely starts to take on his personality traits, and even his looks. Soon, a disturbing relationship develops between the brother and the dead man's widow.</description>
<image>"http://www.maverickentertainment.cc/images/products/asians.jpg"</image>
</asian>
<asian name="Ardor">
<description>"Ardor" depicts the life of an average woman overcoming her dull life through a captivating love affair. We witness the moment to moment changes the main characters must face in response to her actions.</description>
<image>"http://www.maverickentertainment.cc/images/products/asians2.jpg"</image>
</asian>

</asians>

[MX2004] Progressbar And Loader Components
This is wierd.
My AS for frame 1:


ActionScript Code:
loader.autoLoad = false;loader.contentPath = "anmalning.swf";pBar.source = _root.loader;loader.load();pBar.complete = function() {    this._visible = false;};


now, it works when I run it on my computer, but when I upload it to my webserver, the progressbar doesn't move and it doesn't disapper after the swf is loaded either.
The two swf's is in the same catalog, both on my computer and on the webserver...

What is wrong?
Help appreciated...

[MX2004] Progressbar And Loader Components
This is wierd.
My AS for frame 1:


ActionScript Code:
loader.autoLoad = false;loader.contentPath = "anmalning.swf";pBar.source = _root.loader;loader.load();pBar.complete = function() {    this._visible = false;};


now, it works when I run it on my computer, but when I upload it to my webserver, the progressbar doesn't move and it doesn't disapper after the swf is loaded either.
The two swf's is in the same catalog, both on my computer and on the webserver...

What is wrong?
Help appreciated...

How To Preload Multiple Files At Once Using The Loader Class?
I have to load external files, and include a preloader. Usually it's simple:

ActionScript Code:
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadprogress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadcomplete);

function loadprogress(event:ProgressEvent) {
    var ratio = event.bytesLoaded/event.bytesTotal;
    loadbar.width = ratio;
}
function loadcomplete(event:Event) {
    trace("loading complete!");
}

loader.load(new URLRequest("http://blahblah..."));

But that's just for one file. Now I have to load several different files at once. The loading bar has to account for ALL of the files, which means the overall ratio should be [sum of bytes loaded]/[sum of bytes total].

The most convient way to start would be for me to put all their URLs into an array. But what do I do from there?

Preload Problems - Loader Class & External SWF's
My movie was working perfectly on Ctrl+Enter. When I added a preloader to frame 1, and content to frame 2, things went haywire.

My movie consists of a number of images that are brought in via Loader and some external swfs are imported. I assume that these loaded images and external swfs are separate from the preloader on frame 1, and I need to figure out a way to preload these elements before anything starts.

This is the preload code on frame 1:


Code:
stop();

this.addEventListener(Event.ENTER_FRAME, loading);

function loading(evt:Event):void {
var total:Number = this.stage.loaderInfo.bytesTotal;
var loaded:Number = this.stage.loaderInfo.bytesLoaded;

pl.bar_mc.scaleX = loaded/total;
pl.loader_txt.text = Math.floor((loaded/total) * 100) + "%";

if (total == loaded) {
gotoAndStop(2);
this.removeEventListener(Event.ENTER_FRAME, loading);
}
}
Any help is very much appreciated.

Multiple Loader Components And Assign Functions
Hi Folks,

What I am trying to achieve is to create loader components dynamically and assign seperate funcitons to each.

What I have written is ......

-------------------------------------------------------------------
total = 15;
for (i=1; i<total; i++) {
createClassObject(mx.controls.Loader, "thumbnail"+i, i+10);
eval("thumbnail"+i)._x = ((i-1)*100);
eval("thumbnail"+i)._y = 0;
eval("thumbnail"+i).autoLoad = false;
eval("thumbnail"+i).scaleContent = false;
eval("thumbnail"+i).contentPath = "http://www.koraybirand.com/edit/upload/thumb/" + i + "_sml_a.jpg";
eval("thumbnail"+i)._alpha = 50;

eval("thumbnail"+i).onRollOver = function() {
this._alpha = 100;
};
eval("thumbnail"+i).onRollOut = function() {
this._alpha = 50;
};
eval("thumbnail"+i).onPress = function() {
trace("Thumbnail -" + i + "- is Pressed!!");
};
}
for (l=1; l<total; l++) {
eval("thumbnail"+l).load();
}-------------------------------------------------------------------

What happens is that I get the thumbnails but when I click to trace the onPress funcions and always get the same response (dynamic "i" value) from

eval("thumbnail"+i).onPress = function() {
trace("Thumbnail -" + i + "- is Pressed!!");
};

I can not figure out why "i" works flawlessy but why doesnt it always get "15" ??

You can copy and paste the code to frame1 and see...

Folks I really need help...
Thanks..
Koray Birand
kbirand@projegrup.com

Problem With Loader Components, Can Not Display My Forms Properly
Here is the problem (my God, my customer waiting for his web site:( ... ) I have a form made in CoffeeCup Flash Form Builder (Nice one...).Now this form with fields like name, sec name age, etc I want it to apear into my main screen when I press the button "Reservation" and then the customer could fill the fields and sent it to my mail. I tryed with the Loader Component, I mean when I press the button then starts "playing" the form.swf. BUT the Loader can not display the form properly specialy thinks like drop down menus in the form, or check boxes....It just show me the form....The Flash Form Builder gives me 4 files like: form.swf, form.html, form.php and form.xml. Any solution on how my customers complete this form with no problems?
THANK YOU A LOT!

Need Some Preload Code
Hello out there...

here's what i want to do: preload the second scene of a movie while a "loading" movie is going on in scene one. when the second scene is done loading, it starts playing. i have my "loading" grafic set up as a movie clip. Is that the problem?

im using flash 4. im not totally dumb, i just have tried eveything i can think of. can someone help w/ some script?

Help With Jpg Preload Code
Howdy all,

I tried this on the Kirupa board but they've been getting a lot of traffic lately so my question just keeps getting buried. Thought I'd try it out here . . .

I have a container clip on my main stage. The container clip is divided into two parts - on one side there is a dynamic text box that gets loaded with external txt files. The other side is for pictures. I have little iddy biddy pics, <15k that I am trying to load, one for each button on my menu. Everythign works fine when tested on my machine but of course fails to appear when loaded up on the server. So I thought I would use a preloader. I got help on this from Kirupa's Lost In Beta and Ilyas de Pom but I can't seem to get it to work. The LoadBar and LoadText bits are within a movie clip called 'plod' that is in 'container'

Here is my code. It is on the main timeline:


PHP Code:



MovieClip.prototype.preload = function (p_img) {
        this.createEmptyMovieClip("pload", 1000);
        this.createEmptyMovieClip("imagecon", 1001);
        this.imagecon.loadMovie(p_img);
        this.imagecon._x = 24.3;
        this.imagecon._y = 49.5;
        this.imagecon._visible = false;
        this.pload.onEnterFrame = function() {
           var l = this._parent.imagecon.getBytesLoaded();
           var t = this._parent.imagecon.getBytesTotal();
           var getPercent = l/t;
           _root.container.plod.loadText = Math.round(getPercent*100)+"%";
           _root.container.plod.loadBar._width = getPercent*200;
           if (l>0 && l>=t) {
                        this._parent.imagecon._visible = 1;
                        delete this.onEnterFrame;
                        this.removeMovieClip();
                }
        };
}




and on the button I have:

PHP Code:



on(release){
        //some other stuff
        _root.container.preload("pics/mst_s2.jpg");
}




Can someone please tell me why this doesn't work?

The site I am workign on can be found
here
There should be pics for the top 3 links. Any help?

Preload Code
I created a simple preload and it isn't working. Here is the code: for the first frame:

bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay("Scene 1",480);
}


And for the second frame:

this.gotoAndPlay("preloader",1);


I made the preloader movie as a separate scene called "preloader".
Does anyone out there know if this code is correct? I tried to test it, and it I can't see the preload movie. I selected under the "view" menu - simulate download, so as to be able to see the preloader, but no luck! Thanks in advance.

-F

Preload Code
can someone tell me if this code looks accurate.
I am trying to preload three different types of files:

function loadData()
{
var myLoadVars = new LoadVars();
myLoadVars.load("http://www.digitalmixmaster.com/Assets/text/NEWCD.txt","http://www.digitalmixmaster.com/mixedcd_nav.swf","http://www.digitalmixmaster.com/Assets/images/newcd.jpg");
myLoadVars.onLoad = function (success)
{
if (success)
{
loading_mc._visible = false;
cdnametext.htmlText = this.cdname;
cdinfotext.htmlText = this.cdinfo;
cdtrackstext.htmlText = this.cdtracks;
scrollBar();
loadMovie("http://www.digitalmixmaster.com/Assets/images/newcd.jpg", "imageContainer");
loadMovie("http://www.digitalmixmaster.com/mixedcd_nav.swf", "navContainer");
}
else
{
loading_mc._visible = false;
} // End of the function
} // end if
} // End of the function
loadData();

FMS Components Code Help?
Hi all,



Code:
FCChatClass.prototype.sendMessage = function(mesg) {
this.nc.call( "FCChat." + this.name + ".sendMessage", null, this.message_txt.text );
this.message_txt.text = "";
};
the above code is from chat component.
In side that sendMessage method, their is a call to following server function

this.nc.call( "FCChat." + this.name + ".sendMessage", null, this.message_txt.text );

I want to know where this code is written, is it redirecting to same sendMessage, if so then where the html formating is done.

since what ever message we receive will be html format.

My main problem is i want to know where actually html formatting is done.

anyone please help me how to do get this.

Thanks in advance

Regards
advika

How To Code Components In AS3?
Hi guys

I'm struggling on getting a hang on how I should code Components in Flash CS3 with AS3. I haven't any kind of experience with coding components (neither in AS2 or AS3).

So, I started looking on the internet for some kind of tutorial that ends up in a working component example but I can't seem to find any. Am I using the wrong keywords or are there few resources?

If you got a good resource, please let me (and others :p) know because I'm pretty stuck at the moment.

Ps: I know OO, so you don't have to ask me what my skills are :p I just want to know what things like: bounding box, componentShim, ... are and how I have to use them.


Thanks in advance
Arcko Drazen

Look At This Code...attachsound Preload
This is what I got. Loading an external sound .swf so that the user doesn't see that blank screen for 30 seconds.


Code:
onClipEvent (load) {
// load external swf
loadMovieNum ("sound.swf", 1);
trigger = false;
_root.msg = "Loading Sounds... Please wait...";
}
onClipEvent (enterFrame) {
// external swf music preloader
total = _level1.getBytesTotal();
loaded = _level1.getBytesLoaded();
percent = (int((loaded/total)*100));
_root.pro = "Sounds "+percent+"% Loaded";
if (percent == 100 && trigger == false) {
_level1.mysound();
trigger = true;
_root.msg = "Sound Loaded, now playing.";
}
if (percent<100) {
_root.msg = "Loading Sounds... Please wait...";
}
}
I got this from someone here at the board (thanks) and it SEEMS to work great, BUT, it gets to about 10-15% and moves on to the next scene which is my main movie preload. And invariably, it will not not even load the first sound. Hope you understand. It does seem to want to work, but it advances to the next scene too quickly. Is there some way I can tell it NOT to go to the next scene until the full external sound .swf is loaded (about 65K)? Any help here would be much appreciated!!

Why Won't This Code Preload An Image?
i've got a image loading fucntion that's called by a button and then scales the mc. The image loads fine, but i want the image to be fully loaded before the mc scales up. So here is my code, but the preload doesn't seem to work (i don't need any text to show what the preloader is doing, i just need the image loaded first before proceeding with the function):


Code:
function pressHolder(picName) {
this.createEmptyMovieClip("picHolder", 1);
this.picHolder.loadMovie(picName);
this.picHolder._xscale = 1;
this.picHolder._yscale = 1;
this.picHolder._x = 8;
this.picHolder._y = -145.5;
trace("is running");
this.createEmptyMovieClip("loader", 3);
this.loader.onEnterFrame = function() {
var kLoaded = Math.round(this.picHolder.getBytesLoaded()/1024);
var kTotal = Math.round(this.picHolder.getBytesTotal()/1024);
if (kLoaded == kTotal) {
this._parent.picHolder.scaleTo(101, .5);
this.removeMovieClip();
trace("is not running");
}
};
}
anybody know what i'm doing wrong?

Preload OnLoad Code?
Hey everyone

Still trying to figure this one out. I have this code in a movie:


Code:
// Setup XML
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{

// Put all childnodes inside root into array
var newsArray:Array = xml.firstChild.childNodes;

// loop through all the news
for(i=0; i<newsArray.length; i++)
{

// create empty movieclip with textfields
// put text from array into movieclip
// position the clip below the previous

}
}

// Create loadvars
var sender = new LoadVars();

// call php page and catch xml with xml-object
sender.sendAndLoad("xmlfeed_forside.php", xml, "POST");
I have no problems preloading the loadvars... But if I preload the loadvars call , as I see it, all the text inside the onLoad method will still have to be run through - and the movie will show a couple of seconds (depending on the internet connection) before all the movieclip shows up.

I have this code in an external SWF, that is loaded into a main movie using the moviecliploader. I thought that the moviecliploader preloads all items in the external movie + actions in the first frame.

But the moviecliploader doesn't know what the answer from the loadvars is? It doesn't know how many movieclips to create....

So my question is: Is there anyway, that I can make a preloader that does this:

1) preloads loadvars call
2) preloads code inside onload that uses xml from loadvars
3) plays the movie from first frame?

Thanks - Rune

Your Opinions On Re-using Code/components, Please?
I have a button that I am using multiple places in multiple swfs. It has a graphic that means "Copy to clipboard", and for my users means "from whatever textbox it is near." I am going to convert it to a movieclip so that I can have a tooltip pop up after a hover of a settable duration. I want to expose:

1--the tooltip contents,
2--the target textbox whose contents get copied, and
3--the duration of the hover needed to pop the tooltip

as read/write properties of the mc at design time.

Please, let me have your opinions -- what's the best way of making this re-usable across fla's? Make it a component, or make a class to set the behaviors and attach a copy of the mc from each fla's library, or just what? I am pretty sure I can do the coding for any of the approaches, but I could sure use some help in choosing an approach.

Why Doesn't This Preload Code Work?
I want to preload only 50% of the totalframes but I want the preload bar to go all the way to 100% so the user thinks everything downloaded.

Here's my code...and the loader bar stretches all the way to 200% and then doesn't even start the movie.


Code:
framesloaded = _framesloaded;
totalframes = _totalframes/2;
percentloaded = Math.floor(framesloaded/totalframes)*100;
pload = percentloaded+"% completed";
loadbar._width = percentloaded*wscale;
if (percentloaded == 100) {
gotoAndPlay("Scene 1", 1);
}


Any ideas??

Preload Code Doesn't Work Why?
I am using thise code to load 15 images but its not working. Maybe someone can spot whats wrong. Here is the code in action: http://s91931107.onlinehome.us/preloader/
The orange light turns on too fast to have preloaded all 15 images and when i go directly to the path of the image it still has to load (so the preload didnt work). The fifteenth image is the only one that appears instantly when i link directly to it...
http://s91931107.onlinehome.us/prelo...ingsintro4.jpg
http://s91931107.onlinehome.us/prelo...ngsintro15.jpg
I put on a trace on the getbytestotal for emptyMC and it said 0, so that may be the problem


Anyway, here ya go:


this.onLoad = function() {
for (i=1; i<16; i++) {
allimages.createEmptyMovieClip("holder"+i, 1+i);
emptyMC = "holder"+i;
section = "weddingsintro";
image = section+i+".jpg";
allimages.loadMovie(image, emptyMC);
allimages._alpha = 0;
trace (i + "loaded");

allimages[emptyMC].onEnterFrame = function() {
if (this.getBytesLoaded() == this.getBytesTotal()) {
this.loaded = true;
}
}

}
}

this.onEnterFrame = function() {
var completed = 0;
for (i=0; i<16; i++) {
if (allimages["holder" + i].loaded == true) {
completed++;
trace (i + "completed");
}
}
if (completed == 15) {
DONE.play();
}
}

Loader Code Help
Hi there,

I need a lil help with a loader code I have... It all works fine, counts from 0-100% and when all the data it loads my main swf page...

My only problem is that once it loads the main page it doesnt start from the beginning of the movie.. Its as if its been playing in the background while the load screen is up and then when the load screen disappears it plays from the position its got too, this can also be seen as the music from the main page is playing even while the load page is being displayed...

This is my loader.swf code:


PHP Code:



preloader_mc.stop();
preloader_mc.visible=false;

var swf:String='main.swf';
var swfrequest:URLRequest=new URLRequest(swf);
var loader:Loader=new Loader();

loader.load(swfrequest);
loader.contentLoaderInfo.addEventListener(Event.OPEN,initialize);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,inProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completed);

function initialize(e:Event):void
{
    preloader_mc.visible=true;
    preloader_mc.play();
}

function inProgress(e:ProgressEvent):void
{
    var percentage:uint=(e.bytesLoaded/e.bytesTotal)*100;
    preloader_mc.loader_txt.text=percentage.toString()+' %';
}

function completed(e:Event):void
{
    preloader_mc.stop();
    preloader_mc.visible=false;
    addChild(loader);    
}




The site can be viewed at http://www.thebillionaireboysclub.co.uk/test.html if you dont understand what im saying.

Many thanks for any help

Great Preload Code: Missing Running %
Great code from Jesse at Actionscript.org. Does anyone know why my percentage sign is missing when I use this code?

total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
bar.gotoAndStop(percent_done);
ifFrameLoaded ("Scene 2", 30) {
gotoAndPlay ("Scene 2", 1);
}


Thanks,
S27

Preload, Same Code---but Doesnt Work On Other Movie
Hi all,

This attached file is one of the external movie that I will be using with my main movie. I?m having two problems:

1.) I can?t seem to get the preloading thing to work with this particular movie and other similar external movie (similar in size). I used the exact same code for my other movie (bigger in file size), and the preloading seems to work fine. However, once I implement the code into this movie, once I start testing the movie (using 28.8k simulation), the preload never shows, instead, it stays blank until the whole movie loaded then jump to next scene.

2.) The second problem is also related to preload, however this time the same code messed up my ?_root? movie. It seemed like once user trigger the external movie, the external one preloads the _root movie instead of itself. From what I read in this forum, I should change every ?_root? to ?_parent? , but it never seemed to work either.

I have been dealing with this for 4 consecutive days, and it?s becoming very frustrating, can anyone provide any suggestion or help?! Any help will be appreciated, thank you!

David

LoadMovie Loading External Swf, Need Preload Code?
http://www.cstreiter.com/portfolio.fla

^^source is available here. (1.61 mb)

Hey there,

I'm using the script:

createEmptyMovieClip("targetMovieClip", 1);
loadMovie("portfolio.swf", targetMovieClip);
targetMovieClip._x = 45;
targetMovieClip._y = 175;

Although, you can't notice it on a broadband connection, the file is around 1.08 mb and loads with no issues (it appears almost instantly) however if a user on a phone line were to visit my website, it takes so long to load, any way to put a preloading script on my portfolio'a SWF so i can use the loadMovie script and it will appear and say Loading..??

Thanks,

Chris

Simple Preload Code...but It Starts Late?
The below code is in frame 1
Starting at about frame 5 or so graphics placed on the timeline come in.
There are NO items in the library with linkage - so no export on frame 1 problems - but yet the preloader still does not start until about 30%.

what gives??

the code:

stop();

onEnterFrame = function(){


var percent_loaded = getBytesLoaded()/getBytesTotal();


preloader_mc.value = percent_loaded;
if (value) loaded_txt.text = Math.round(100*value) + "%";

if (percent_loaded == 1){


delete onEnterFrame;

// tell the main timeline to play
play();
}
}

MovieClip Loader Code
Hi everbody,

I created a simple loader and converted it to a component.
I can place it in a timeline, and in the actions layer write this code:


Code:
this.onMouseUp=function(){
loader_mc.the_mcl.loadClip("image.jpg", loader_mc._parent.holder_mc);
}
But if I try to do the same without the onMouseUp, as below, it does not work:


Code:
loader_mc.the_mcl.loadClip("image.jpg", loader_mc._parent.holder_mc);
I am using a MovieClipLoader object inside the loader.

Could anyone please help me figuring out what I amsoing wrong?
Thanks

Loader Code Problem.. :(
hey guys

im trying to make something... but for some reason, when i test play it, it doesnt move.

i think there's a problem with the code ... or something.. well, if you guys would just be so kind enough to check it out [ and fix it for me too hehe ], here's the .fla

Loader And ProgressBar Code?
I took this off the macromedia live docs.

basically importing the loader and progressbar components onto the stage and the swf being loaded is a fat swf (voice.swf)
At the moment i'm using this off my hard drive so I'm not expecting the progress bar to visibly move. But I was expecting it to show as 100% full when I test the movie (as the voice.swf is being loaded played almost instantly). what happening?


ActionScript Code:
createClassObject(mx.controls.ProgressBar, "pBar", 0);
createClassObject(mx.controls.Loader, "loader", 1);
loadListener = new Object();
loadListener.progress = function(eventObj){
   // eventObj.target is the component that generated the progress event,
   // that is, the loader
   howMuch_txt.text=loader.bytesLoaded;
   pBar.setProgress(loader.bytesLoaded, loader.bytesTotal); // show progress
}
loader.addEventListener("progress", loadListener);
loader.contentPath = "voice.swf";
//loader.content = "voice.swf";
loader.load();

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