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




Trouble Preloading External .swf Files



Hi all,

I have a problem with the preloader of the external .swfs loading into my main movie. I found no way to put a common preloader for all externally loading files, so I just gave each external movie a preloader.
But see what it does: www.air-tecm.com

The pictures and content have preloaders.
I used Flash 5 for it and IE 6.0. The code to load the preloader:
frame1
loadtxt = "0%";
frame2
loadtxt = (Math.floor (_root.getBytesLoaded() / _root.getBytesTotal() * 100) + "%");

if (_root.getBytesLoaded() == _root.getBytesTotal()){//Check for finished loading
//If loaded, final update to fields
loadtxt = "100%";
gotoAndStop ("main", 1);
}

I thank you in advance for your help.



FlashKit > Flash Help > Flash General Help
Posted on: 04-08-2003, 07:24 AM


View Complete Forum Thread with Replies

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

Trouble Preloading Multiple .swf Files
Hello-

I've been banging my head against a wall trying to get a preloader that preloads multiple .swf files into an empty clip while a preloading animation/counter runs, but it's not working properly and I'm just mangling the code. I could really use some help. Here's what I've got going:

stop();


mcLoader = new MovieClipLoader();
loadListener = new Object();
mcLoader.addListener(loadListener);
mcLoader.loadClip("GMWEB_NIKER.swf", loader_mc);
mcLoader.loadClip("GMWEB_E4.swf", loader_mc);
mcLoader.loadClip("GMWEB_MONO.swf", loader_mc);
mcLoader.loadClip("GMWEB_adiO.swf", loader_mc);
mcLoader.loadClip("GMWEB_ASIMBA.swf", loader_mc);
mcLoader.loadClip("GMWEB_SUGAR.swf", loader_mc);
mcLoader.loadClip("GMWEB_TS.swf", loader_mc);
loadListener.onLoadStart = function() {
loader_mc.stop();
};
loadListener.onLoadProgress = function(loadTarget, loadedBytes,
totalBytes) {
preloaded = Math.floor(loadedBytes/totalBytes*100);
loaderText_txt.text = preloaded+"% loaded into "+loadTarget;
bar_mc._yscale = preloaded;
};
loadListener.onLoadComplete = function() {
loaderText_txt._visible = false;
bar_mc._visible = false;
gotoAndPlay("meat",1);
};

//

I have this all running in a scene called "preloader", with my main content timeline in a second scene called "meat". It seems to run the preloader for just long enough for the byte count of the preloader
scene to load and then jumps to the next scene, and then the .swf files are not cached and take a while to show up. Help! TIA.

Trouble Preloading External SWF
On my main timeline, I have a movieclip called 'gallery'

on the first frame of gallery, there is a loadMovie to load an external SWF to level 3. it is in a conditional that only allows this to happen once.

on the second frame, I have the following code, which is supposed to preload the swf coming in on _level3. It is not working, however... any ideas? It seems to be failing in the if condition statement.

if (_level3.getBytesLoaded() < _level3.getBytesTotal()) {

// load gallery images
gallerybytesTotal1=int(_level3.getBytesLoaded()/_level3.getBytesTotal()*100)
galleryloadBar._xscale=gallerybytesTotal1;

//action
gotoAndPlay(1);
}

Preloading External Swf Files
I want to Preload an external swf File in another swf Movie, but i dont know how. Plz tell me...

Preloading External Files
I have a main file which loads various external swf's into an empty movieclip - is it possible to build the preloader into the main file (instead of each swf)and have it figure out when an external file is fully loaded in the movieclip?

Preloading External Swf Files
I am calling swf movies into a rectangule target on the main movie but, the "doors" are placed on those movies instead of the main movie.
How do I?
- Place a preloader on the main movie that says:
If "services" is loaded - show it = load services.swf
If "services" is not loaded - show the doors closed.
Thanks a million.
If you find anything else that needs changing on this site, also please let me know.
mags

http://www.webanddesigns.net/

Preloading External Swf Files
I created several external sound/audio files in .swf format. This makes very
small file size. However, when playing over the internet the animation
starts before the sounds kicks in. It's out of synch.

Question, how do I created a pre-loader (or edit Flash 5 preferences) that
will not play the movie until the external .swf sound file is completely
loaded?

Everything is synchronized perfectly once all the audio loads after about
ninety seconds.


Thanks


iaustin

Preloading External Swf Files
Someone has an example (easy for a newbie) showing how to
preload different external movies(swf) that will be used in the main movie in the meantime you're loading the main movie ?
This will optimize the site navigation.

Preloading External Files... HELP
Ok, the situation is this... I am trying to preload external .swf files via the main movie. What I would like to do is have the preloader reside on the main movie rather than the external .swf file. Every code scenerio that I have come up with does not seem to work. Let me give a basic code example for a loading bar and see if anyone can tell me as to how I could correct the code in order for it to work. To explain, the first frame on the main timeline of course would load the external .swf into the main movie (we will call it hostMC). In the external movie, I have placed a stop action on the first frame so when it loads into the main movie it doesnt just continue playing. Here is an example of the simple code placed on the preloader in the main movie...

onClipEvent (load) {
total = int(_root.hostMC.getBytesTotal());
}
onClipEvent (enterFrame) {
// load bar mover
loaded = int(_root.hostMC.getBytesLoaded());
percent = int(loaded/total*100);
this.loaderBar.gotoAndStop(percent);
if (percent>=100) {
_root.hostMC.gotoAndPlay("start");
}
}

Can anyone tell me as to how I could make this work in order to preload the external .swf? Any help would be much appriciated. Thanks.

Preloading External Files
I have a movie that calls an external SWF.

and in that external movie clip it calls up another external movie clip.

in the 3rd movie clip I added a preloader. Unfortunately it doesn't work. Due to the whole heirarchy stuff.

How can I get it to preload correctly?

Is there a way I can put in the main time line a preloader that will automatically preload external movie clips?

Thanks for your help in advance.

Help Preloading External Swf Files
Here's the poop:
I have no problem preloading external swf files into a blank MC on my stage. But, instead of having a preloader for each swf, I want to have one preloader that I can use to preload any of them that I want.

On the main stage, I have 3 buttons. I also have three blank MCs (one for each external swf to load into) called "mov1", "mov2", and "mov3". Let's say that I also have another MC on the stage called "loader". It will contain the preloader that will be used to preload the external swfs.

I want it so that when I click button1, it preloads my fisrt swf, then loads it into MC1. Then, when I click button2, it preloads the second swf (using the same preloader) and loads it into MC2.


Here's what I've got so far...

My preloader MC is two frames with a dynamic text box. This code is placed in the first frame of it:
code:
function preloadFiles(mc) {
framesloaded = mc.getBytesLoaded();
total = mc.getBytesTotal();
percent = int(100*framesloaded/total)+"% loaded";
if (framesloaded == total) {
mc.gotoAndStop(1);
delete framesloaded;
delete total;
delete percent;
}
}


Here's the code placed on button1:
code:
on (release) {
_root.mov1.loadMovie("swf1.swf");
_root.loader.preloadFiles(_root.mov1);
}



All of this does load the swf into the correct MC, but the preloader doesn't work.
Do you guys know what I might be doing wrong?

Thanks!
-Lee

Preloading External Files - Please Help
I have a main file that has a intro(preloader) and a Main scene.

I'm loading an external file, but want the external files to play immediately on the first frame of the Main scene. The problem is that the external file is too big in file size so it takes too long to load and play immediately

My questions is.. how or what is the best way to preload the external file (bgsound.swf) into the browsers cache before it plays the "main" scene? I've been on the Internet all morning looking at tutorials, but nothing has really seemd to work yet.... "HELP"

wmchisholm.com/essenza

Preloading External SWF Files
Hi,

I am having difficulties with preloading an external swf file into level o of an existing file (yes I have read all the posts and haven't found what I was looking for(and i am not very good at scripting)).

The attached fla shows a closing door and then loads an external swf through the next code that is just placed in the last keyframe.

loadMovieNum("flash/gevoel.swf",0);

What I am looking for is a preloader in the closing door movie that stops when the doors are closed. Then I need the preloader to start preloading the next swf. After the entire external swf is loaded it should go there.

See "http://www.no-tec.com/not_quite_there.html" for an example.

Can any of you guys help me!!

Preloading External Swf Files
OK

So you've all seen it. A main movie that looks kewl, then you navigate to a different part of the movie, like an "about us" or "profile" link. A preloader appears for this external swf file, and then loads the swf file without any further glitches/delays.

How, prey tell, is this achieved?

Additionaly, I have a "totalbytes" preloader to load my main swf. The problem is that the load bar only appears after loading 63k of data (file is currently 203k).

Any ideas?

Thanks a mill
Fabman

Preloading External Swf Files
I have a 3 mb flash file that calls to external swf files throughout different times. If I would import these swf files into the flash file itself, it would add another 3-4 mb to the file size. so I guess I have 3 options of how to do this but I don't know which would make for the fastest loading times on the web. should i...

1. leave the files external so the flash file is smaller? but everytime the file plays one of these external swf files its going to have to load it and it will probably make the file stop for a second while it loads.

2. put everything in one big file and use a preloader? this way everything will be loaded in the beginning and when the swf files play it will already be loaded.

3. (if this is possible) preload the external swf files while the main file preloads so then when they are called to in the main file they are ready to go. If this is possible and hte best choice, how would I do this?

Preloading External Files
i would like to preload me external jpeg and txt files so there is no delay when they are called for. ive check around and im afraid i dont understand how to do it. help would be appreciated

Preloading External .swf Files
Hey gang,
I've built a site for a client that loads each section as an external .swf. I'm having troubles finding an example of a preloader that will work inside the external .swf file.

I'm loading all my content movies into layer 1.

Can anyone hook me up with an example of a preloader that can be used in a preloader scene in my external .swf files that will actually preload the external .swf??

Any help is GREATLY appreciated.

Preloading External Files
What is the best way to load variables from an external .txt file in the preloader of a flash movie? These variables would be used in a movie clip on the next frame.
Thanks in advance!

Preloading External Files
What is the best way to load variables from an external .txt file in the preloader of a flash movie? These variables would be used in a movie clip on the next frame.
Thanks in advance!

Preloading External Files.
I really need help with this, I dont know much about listeners/classes and cant find any good tutoirals on them. Could someone either explain or post some tutorials?

Preloading External SWF And FLV Files (how To?)
Hello,

Would any of you know how to preload SWF and FLV files?

I have a preloader already:

onClipEvent (load) {
if (_parent.getBytesTotal() == _parent.getBytesLoaded()) {
quickPlay = true;
} else {
preLoad = (_parent.getBytesTotal() * 0.99); //percent to preload
}
_parent.stop();
}

onClipEvent (enterFrame) {
gotoAndStop(loadedIndicatorFrame());
if (quickPlay == true) { //quickly play the anim
if (_currentframe == _totalframes) {
_parent.play();
}
} else { //wait for the preload
if (_parent.getBytesLoaded() >= preLoad) {
_parent.play();
}
}
}


What would I need to do to preload say audio1.swf into this?

Thanks!

Please Help - Preloading External Swf Files
Flash 8 -

I am currently working on a site and need help with preloading. Here is a link to the work in progress: http://www.jessicakarp.com/houston/main.html

What I need is an easy way to preload the swf's in the "what we do" section. Is there a way I can put some code in the frame that targets the movie clip to tell it to preload it before it loads it?

In other words, can I do all the preloading from the main movie?? If not, what are my options?

I would really appreciate any help. Thanks!

Preloading External SWF Files
I'm sorry guyes, I know that this issue is coming over and over again, but I read every post on the forum concerning this and it still don't work.

I have 5 SWF files that are loading on a loader component. As simple as that. I want to preload this files because one of them is very heavy and it take a while to show on screen.

I tryed all the action script all the trics and nothing happened. I try to create a preloader scene on each swf, I tryed to create a second layer on the main timeline with a preloader on frame 1 in each of them, I tryed to put the preloader on the main movie that would show when something is loading on the loader component...

The problem is always the same...the preloader doen't show on the loading of the movie...I tryed to simulate the download and nothing....it simply don't show...it jumps to the main content of the SWF without passing trough the preloader...what's happening here?????

I have my head exploding now of trying so hard to solve this...

Anyone could see if anything is wrong? Does the loader component have this problem? I've tryed with a regular empty movie clip and although I put a preloading scene on each SWF, it shows on the preview of that single SWF but when I call it from the main SWF into the loader component it doesn't show at all, and jumps to the normal content of the file without preloading...

Can anybody see what's wrong here???

Thank you very much

WebTomar

Preloading External SWF.files..help Plz
I have a layer code and some butons of the timeline of my main movie like telling a specif button to load an external SWF into target dynamically with Flash MX. I can load the external.SFW´s and it works (actually) without preload and i cannot let it like that !!.. So now just want to Know how a precent preload ActionScript looks like loading that external swf. See the precent preload and its AS i wrote on the main timreline of my MainMovie(base one) works really fine , but if i put it on the main timeline of the external.swf it does not work. I tried to do change something; Instead of _root.getBytesLoaded() I would use.... _root.container.getBytesLoade()..Well I tested online and.. nops it steel not working..
what´s wrong ??

plz help ..? i will apreciate, thx in advance

Preloading External .swf Files...
Ok...I have to have a good understanding of the full flash site tutorial. Now I wanna know how to make a preloader when u load external .swf files. I know its a tutorial on the page for doing this, but it doesnt seem to work for me. Im having problems in the transition section. Its a few things in there I dont understand. Like for one, what are the flags on the "labels" layer? Two, how was the words opening and closing put on the "labels" layer and how imporatnt is it to have those words on there? Plus, I want to know how to do it from scratch. Can anyone break this down for me?

Preloading External Files
Is there a way to force external SWFs to Preload

my situation ....

I have a main movie that uses a transition to load the external SWFs - You click the nav button it sets a variable and triggers the tranny to play. While the screen is completly covered loadMovie puts the propper SWF into place

I have a few SWFs that are just over one meg which is enough to keep them from showing up untill just after the screen is uncovered.

I'd like to preload all of the external files before the user gets to click and ruin the illusion - Is there any way to include them in the initial preload sequence or something?

(Note ... this is not for the web)

Preloading External .swf Files...
Ok...I have to have a good understanding of the full flash site tutorial. Now I wanna know how to make a preloader when u load external .swf files. I know its a tutorial on the page for doing this, but it doesnt seem to work for me. Im having problems in the transition section. Its a few things in there I dont understand. Like for one, what are the flags on the "labels" layer? Two, how was the words opening and closing put on the "labels" layer and how imporatnt is it to have those words on there? Plus, I want to know how to do it from scratch. Can anyone break this down for me?

Preloading External Files.
Well, it almost works...

I made a preloader to load external images I can see the images preloading in Firebug, but it doesn't look like its having the desired effect.

Does anyone have any advice on how/where to use the preloader to make it do what its supposed to do?

http://s181455844.onlinehome.us/iavi...oadeder-8.html

Here are sections of my script:

Actionscript Code:
function loadXML(loaded) { 
if (loaded) { 
this.firstChild.childNodes[0].childNodes[5].firstChild.nodeValue; 
..._root.img1 = this.firstChild.childNodes[0].childNodes[6].childNodes[1].firstChild.nodeValue;_root.banner1 = this.firstChild.childNodes[0].childNodes[6].childNodes[0].firstChild.nodeValue;... 
} else {  trace("file not loaded!");} 

xmlData = new XML();xmlData.ignoreWhite = true;xmlData.onLoad = loadXML;xmlData.load("IAVI.xml"); 
/* mouse events */hs1.onRollOver = function () { 
 fade_in(_root.banner1); 
 description_text_loader(_root.largeTitle,_root.largeText,_root.largeLinkURL ,_root.largeLinkText ); 

/* fade in loader */ 
function fade_in(my_movie){        _global.current_banner=my_movie;    fade_in_mc.fade_in_image_mc.loadMovie(my_movie, 1);    fade_in_mc.gotoAndPlay(2);    } 
/* preloader */ 
_global.preload=true; 
 this.onEnterFrame=function(){ 
     //trace ();         if (_global.preload==true && _root._currentframe==1 ){        stop();    }else if (_global.preload==false && _root._currentframe==1){        play();    }     
    if (_global.preload==true){     var counter=0;    var image_loader:Array=new Array();    image_loader[0]=_root.banner1;    image_loader[1]=_root.banner2;    image_loader[2]=_root.banner3;    image_loader[3]=_root.banner4;    image_loader[4]=_root.img1;    image_loader[5]=_root.img2;    image_loader[6]=_root.img3;    image_loader[7]=_root.img4; 
        if(_root.banner1!=null){        while (counter < 7){          if(loader_mc.getBytesLoaded()< loader_mc.getBytesTotal()){             alert.text="loader_mc.getBytesLoaded():"+loader_mc.getBytesLoaded();                } else {                    alert.text=alert.text+image_loader[counter]+", ";            counter++;            loadnewmovie(image_loader[counter]);        }                if(counter<7){                        _global.preload=false;                    }              }    }    }    }//end on enter frame 
 
function loadnewmovie(myimage){        loader_mc.loadMovie(myimage,1); 
}

Preloading External Files
Currently I am loading swf files into the main swf only when they need to be loaded by using this code
loadMovieNum("portfolioSWF/17.swf", 1);

Is there a way I can preload these files with not displaying them to the screen ?

Preloading External Swf Files?
I have a site where all it's content (home, about, etc...) is in seperate external swf files and i load it in container using load movie function into index.swf. Mi idea is to make a preloader which will preload all of my external swf and then play index.swf so when a user click on home for example there won't be a delay if i am right? Can this be done by using movie clip loader class in first frame of my index.swf and simply loading all of my external swf's sequentially into a container (and using bar to display loading progress) which i can put outside of stage and have them stay there and after preloading is finished just use gotoAndPlay to play my next frame where my content is? Is that enough for preloading my content, does that mean that i won't get any delay when i click on HOME option in my index.swf which will load again index.swf into my main container? Can that effect be seen by simply exporting my index.swf file in Flash and viewing it in Flash player or you have to view it with browser to see preloading effect? How does this thing with cache and memory work in flash anyway?

thanks

Preloading External Swf Files In Flash 5
Hello flash people, i am pulling my hair out trying to solve this problem and I hope to find some help from more experienced flash users.

I have created a flash site for a club (main movie), the site contains a few different pages (ie news, gallery, events,etc) but I would like to load these pages externally into the main movie as separate swf's and have a preloader to show that the pages are loading.

I am working in Flash 5 on a Macintosh (no boo's please) OS 9

could anybody help me to load these external swf's into my main movie displaying a preloader

Your help will be appreciated
KAINCJ

Problem With Preloading External Swf Files
I am trying to build a website using external .swf files through a preloader into my main website. This project is specifically for my MMA fighter information webpage.

I viewed a tutorial on preload external .swf files on www.gotoandlearn.com and the tutorial relinquished this actionscript with details on creating a holder and preloader which I have already done.

var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object ();
mclL.onLoadProgress = function(target,loaded,total) {
loader.percent.text = (Loaded/total) * 100 + "%";
}
mclL.onLoadInit = function() {
Loader._visible = false;
Loader.percent.text = "";
}
mcl.addListener(mclL);
mcl.loadClip("Home.swf",Holder);
Home.onRelease = function() {
loader._visible = true;
mcl.loadClip("Home.swf",Holder);
}

I placed the .swf files I wanted to load into the movie in the same folder as my main movie and its just not working. Is there a special place other than recycle bin these .swf files are supposed to be? Please help

Preloading Multiple External Swf Files
Hi Guys,

I'm working in Flash MX

I made a site completly in flash.

But to lower file size I made the each section a different swf file

when you click a link you will have to wait for that section to load, it would be good if peoples can see the loading progress while they r waiting.

And i hav added a preloader in each of the external swf file.. and then i realise that if i wanna change or modify the preloader, i will have to change all the preloader too.. this is really kicking axx..


is there a way where on the main page there is only 1 preloader needed to show all the external swf files loading progress? i am using an empty mc as container to load thoose external swf files..

hope you guys can give any ideals or show me some similiar tutorials,

Thanks

Preloading External Files, Confused.
Hey guys,

I hope you guys can help me with this.
I'm an audiovisual interactive design student on a school that's screwed up. We work projectbased and this particular project requires a lot of flashstuff. But, we don't get taught anything by our teachers and we're supposed to find out ourselves once we need something with google and the likes. I wonder what I'm paying my schoolfunds for..

Anyway! I'm working on my last project this year and it's an interactive DVD for our yearbook. On this dvd, several projects of students is displayed.

I've made a root.exe projector file that's small on size and only displays a picture, some audio and a button that activates another .swf with an animation to the next screen. I load this one with the loadMovieNum command.

After this animation, it will load a new .swf (again loadMovieNum, and in the new one unloading the layer below it) with many active buttons and animations.. it's the biggest .swf I have and I don't think I can split it up.

Locally.. everything works just fine with hardly any pauses between the files loading. When I test it on a dvd though, the wait time is about 5 seconds and flash seems to be freezing. This is because of the lack of a preloader and reading speeds of a dvdr drive

I've been looking around for preloading external files and I've read alot about them.. and tried alot too, but I can't seem to get it to work. I believe it's because I'm using loadMovieNum instead of loadMovie. I tried changing the way it's reading containers to levels, but that doesn't seem to work.

My deadline is tomorrow and I need to get it done today. What I want essentially is:
When clicking the button on the first screen, a preloader appears, loading the content for the next two .swf's thats going to be loaded. And this working with loadMovieNum. This, so that the users aren't disoriented by not seeing it's loading, thinking it's freezing.

I've learned a lot from this site and I'd like to thank you guys for that. I'm sure with a lot of reading and research I can do this myself.. but there just isn't much time.

I'm hoping you guys can help me, thanks for reading,
Curb

Preloading External Swf Files Invisibly Help
Hi friends,

i have 4 swf

1.main.swf
2.content1.swf
3.content2.swf
4.content3.swf


on main.swf , i am using the following scripts to load external swf ( content1.swf, content2.swf & content3.swf ) dynamically with a transitions .


PHP Code:



stop();   //initialise a variablenextMovie="content1.swf";//load the starting movie into level 1loadMovieNum(nextMovie,1);   //button1 actionsbutton1.onRelease=function(){    //this makes sure that content 1 isn't already loaded    if(nextMovie!="content1.swf"){    //set the variable that holds the name of the movie to be loaded    nextMovie="content1.swf";    //tell the currently loaded content movie to play it's outro animation    _level1.gotoAndPlay("outro");}}     //button2 actionsbutton2.onRelease=function(){    //this makes sure that content 1 isn't already loaded    if(nextMovie!="content2.swf"){    //set the variable that holds the name of the movie to be loaded    nextMovie="content2.swf";    //tell the currently loaded content movie to play it's outro animation    _level1.gotoAndPlay("outro");}}   //button3 actionsbutton3.onRelease=function(){    //this makes sure that content 3 isn't already loaded    if(nextMovie!="content3.swf"){    //set the variable that holds the name of the movie to be loaded    nextMovie="content3.swf";    //tell the currently loaded content movie to play it's outro animation    _level1.gotoAndPlay("outro");}} 




everything seems to working fine.

Is it possible to load the all the external swf files invisibly while browsing the website? something like multi swf preloader.

my intention is load content1.swf , content2.swf & content3.swf invisibly in the cache in advance so that it doesn't load again & again once i click button1, button2 & button3.

any idea friends??

I have also attached the files for further reference.

Preloading Multiple External SWF Files
hello-

this is how im trying to preload external swf files:


Code:

var Count = 5;
for (var i = 1; i<Count; i++) {
var fileLoad= this.createEmptyMovieClip("fileLoad"+i, this.getNextHighestDepth());
fileLoad.loadMovie("swf/page"+i+".swf");
}
i am loading first four swf files from swf directory (page1.swf, page2.swf, page3.swf, page4.swf) - However, I WOULD LIKE THEM TO BE INVISIBLE WHEN THEY ARE PRELOADED TO THE STAGE.. how should i do that.. "fileLoad._visible = false;" does not work- please help!!!!!!!!!!!

Having Trouble With Loading External Fla Files
I have a site where I have created an empty movie clip called "contents". I am loading new fla files into this clip by using the following...

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

This is working fine, but I am having trouble with the loaded movie. An example is that I want to go to a different scene within the loaded movie, and I am using the following code...

on (release) {
{gotoAndStop("scene name", 1);
}
}

The buttons are within the loaded file. Any ideas what is going on?

Thanks!
Van

Trouble With Loading External Mp3 Files
I apologize for the length of the post. I hope this is clear of what I am trying to explain.

My problem deals with getting "undefined" when I press a button to load an external mp3 files. The following is what my XML childNode looks like:

<option phonetic="Soundless, or A" name="aleph" cursive="alephCursive.swf" block="alephBlock.swf" audio="char1.mp3"/>

Every attribute loads the way I've programmed them, except for the last one "audio".

The following is what my actionscript looks like loading in these attributes:
Everything is happening inside the onLoad event for my XML file.

var xmlContent = this.firstChild.firstChild;
audioContent = new Array();
for (var i = 0; i<this.firstChild.firstChild.childNodes.length; i++) {
nextEntry = xmlContent.childNodes;
audioContent = [nextEntry.attributes.phonetic, nextEntry.attributes.name, nextEntry.attributes.cursive, extEntry.attributes.block, nextEntry.attributes.audio];
}

The code above simply adds each attribute to the audioContent array. Each element traces out correctly.

The following code is how I am using these attributes:

for (var i = 0; i<audioLength; i++) {
audioContainer.attachMovie("container4", "audioItem"+i, i);
// Create a shortcut reference to the present movie clip
thisClip = audioContainer["audioItem"+i];

thisClip.myTxt1.htmlText = audioContent[0];
thisClip.myTxt2.htmlText = audioContent[1];

thisClip.cursive_mc = loadThis(assetPath+audioContent[2], thisClip.cursive_mc);
thisClip.block_mc = loadThis(assetPath+audioContent[3], thisClip.block_mc);

thisClip.speaker_mc.attachMovie("speaker", "speaker_mc", this.getNextHighestDepth());
thisClip.speaker_mc.speaker_mc.onRollOver = function() {
this.nextFrame();
};
thisClip.speaker_mc.speaker_mc.onRollOut = function() {
this.prevFrame();
};
thisClip.speaker_mc.speaker_mc.onRelease = function() {
mySnd.loadSound(audioPath+audioContent[4],true);
};
}

Loading the text works inside the htmlText. Using a function loadThis to load external swf files works corerctly and even attaching a linked movieclip from my library called "speaker" works correctly.

The problem comes from pressing the speaker movieclip that the output traces "undefined" instead of the external mp3 file.

I appreciate any help. Thanks.

Loading External Image Files And Preloading Them.
I fairly new to flash 8 actionscript. I've searched other posts for the same problem that I'm facing.

I want when clicking on a button that it loads a jpg file and that shows the precentage of load of that same file. I also want to be able to close that image so that I can return to the main site and choose from the thumbnails another image and do the same thing to that image etc etc etc.

Thank you for the attention.

Preloading External .swf Files Into Browser Cache...
Hello,

I'm working on a hybrid site that uses multiple .swf files throughout and was wondering if there was a way I can have all the .swf files load to browser cache on the first page, either with actionscript, or javascript, or some other alternative…

Basically, I want certain .swf files to be cached to the users browser when the main page loads, so the files are ready when the user starts to navigate the rest of the site.

~pricky

Preloading External Files, Level Over Current Sec
basically i have a site that i'm working on that I want the preloader to show up first when i click a button and then when its done loading, load the new external swf over the current layer.

http://www.eccentris.com/splash.htm

click through the inner gallery sections

prolly the best example i can think of off the top of my head. its not exactly what i'm looking for visually but the concept and programming are the same.

it does a preloader over the current content then transitions into the next external swf all while the previous one is still underneath.

i'm assuming when a user clicks the button they load the preloader mc on a level above the current content, then when the loader is finished it loads the desired movie into itself and then unloads the previous swf? I could be all wrong in this, jus wondering if there's some huge concept that i'm missing or an easy way of dealing with this problem

Trouble With Uploading External Text Files
I want to update text in a Flash movie from an external text file. I have tried to set up a load variable script in a dynamic text box as stated in the site tutorials but nothing happens. I want the site to find the the text when the page is loaded. What am I doing wrong? Should I be putting the code into the text box or the frame?

This is the code that I am using:

loadVariable ("text.txt", "_root.textbox")

I hope you can help. If this is to vague then let me know and I'll give more information.

Thanks

Steve

(P.S. I didn't write all the threads straight away, I had already written then elsewhere!)

Preloading External Sound Files B4 The Demo Starts..... PLEASE
Hi, there Flash gurus...

I am time stressed and quite desperate with the following problem. I
hope that'll be a snack for you to lead me out of this.

HERE IS WHAT I HAVE:

I am to create a product demo, I decided to have one movie with
series of scenes which are to play in order.

For individual scene there is a corresponding sound ( voice ),
let's say I will handle 8 sounds.

I decided to preload them
before the first scene starts and then call them one-by-one
at beginning of each next scene.

PLEASE, how can I achieve this so that when a first scene ends
the relevant sound stops too and second scene starts with second
sound....and so on...???????


Thanks a lot

ROBERT

Pause(not Stop) And UnPause Preloading External Files
Is it possible to start loading e.g. 10 external Moviclips into my Main Movie Clip at once, BUT when e.g MC 5 is needed first, because the user once to see the content auf MC 5 (Clicked Button 5 on my Mainnav.....) to pause the preloading auf all 10 external Movieclips, but Number 5 and when Number 5 has been finished loading, to tell the other MCs (1,2,3,4,6,7,8,9,10) go on loading preloading.

I don't know how to explain it more simple, but i hope i made it clear. I don't know if anyone ever has tried to do something like this, or if it is actually possible, because it would mean some talking between the server and the users computer....


so i am open for all your commands.
(i need this because each movieclip is 4-5 mb big)

Thanks too all

Error#1009 While Preloading External Swf Files In The Main Swf
HI everyone,

I hope you all have a nice day and there is someone out there who could help me :-)

I am loading external swf files into my main swf with this code:


ActionScript Code:
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;
stop();


    var myLoader= new Loader();
    myLoader.x = 230;
    myLoader.y = 110;
    myLoader.name = "containerSwf"
   
    stage.addChild(myLoader);
    myLoader.load(new URLRequest("PFP GROUP web.swf"));

   
CladtekIntro_btn.addEventListener( MouseEvent.CLICK, loadCladtek);
function loadCladtek(Event:MouseEvent): void
{

      myLoader.load(new URLRequest ("CladTek.swf")); 
       
}

and so on I have made a few more buttons load different swf's.
The external swf files, in this case "PFP GROUP web.swf" and the rest of my swfs have their own preloaders in their own timeline with the following code:



ActionScript Code:
import flash.display.*;
this.stop();

this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, PL_LOADING);

function PL_LOADING(event:ProgressEvent):void {
var pcent:Number=event.bytesLoaded/event.bytesTotal*100;

lbar.scaleX=pcent/100;
lpc.text=int(pcent)+"%";
if(pcent==100){
this.gotoAndStop(2);
}
}

Then I export the movie PFP GROUP web.swf with simulate download and everything works fine, loading bar progresses OK. When I export my main swf and come to clicking on the button that loads PFP GROUP web.swf it gives me hundreds of Error messages WHILE the loading of this file is happening.This is what the Error says:


Quote:




TypeError: Error #1009: Cannot access a property or method of a null object reference.
at PFPGroupweb_fla::MainTimeline/PL_LOADING(




I guess the Error is in the comunication between the swf's somehow because I don't get any Errors when exported on its own, and it does say that is in the PFPGroupweb_fla::MainTimeline/PL_LOADING(. I also can't figure out why is in the _fla file!?

If you know what the problem is can you please tell me, any help will be greatly appreciated. Thank you

Ananda

Help With Preloading HTML Formatted External Text Files...
I'm making a dynamic web site all in flash, and I need all the content to be dynamic, so it's all being loaded from external text files with HTML formatted text.

The problem is: I want to make a preloader that caches the files before we enter the site, and what it does currently, is it caches the text part of the files, but not the pictures.

for example:
Code:
<b>hello world</b><img src="photo.jpg">
would just cache the hello world part and not the photo. and let's say the photo is 2 MBs, we miss the point right...

does anyone have an idea of how to cache the photos inside the html formatted text?

Preloading Trouble ?
Hi there..

I'm having trouble with my preloadong movie !
When I view the 'main' movie in flash using the 'show streaming' option the external file loads into the holder without preloading ??
I can't figure out why ??

Any help with solving this one would be great !

I've had to attach the main movie here and the second part below part below...

Preloading Trouble
Hi there..

I'm having trouble with my preloadong movie !
When I view the 'main' movie in flash using the 'show streaming' option the external file loads into the holder without preloading ??
I can't figure out why ??

Any help with solving this one would be great !

I've had to attach the main movie here and the second part below part below...

[F8] Trouble Preloading A Flv
Having trouble preloading a flv file with a preloader. Here's the following code, I have the main page main.swf and a home.swf that loads up in a loader once main.swf is finished loading. I've preloaded the home.swf file but cannot seem to preload the flv file as well. I am absolutely stumped, I'll paypal anyone however much if can help me with the problem. PM me...

-----

import mx.transitions.Tween;
import mx.transitions.easing.*;
stop();
var nc:NetConnection = new NetConnection();
nc.connect(null);
theVideo = vid.theVideo;
var ns:NetStream = new NetStream(nc);

theVideo.attachVideo(ns);
theVideo.smoothing = true;
ns.setBufferTime(100);


playButton._visible = false

playButton.onRelease = function() {
ns.pause();
this._visible = false;
home.pause._visible = true
}

pause.onRelease = function() {
ns.pause();
this._visible = false;
playButton._visible = true
}

rewindButton.onRelease = function() {
ns.seek(0);
ns.stop();

}

this.createEmptyMovieClip("vFrame",this.getNextHig hestDepth());
vFrame.onEnterFrame = videoStatus;

var amountLoaded:Number;
var duration:Number;

ns["onMetaData"] = function(obj) {
duration = obj.duration;
}

function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 465;
loader.scrub._x = ns.time / duration * 465;
}

var scrubInterval;

loader.scrub.onPress = function() {
vFrame.onEnterFrame = scrubit;
this.startDrag(false,0,this._y,465,this._y);
}

loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
vFrame.onEnterFrame = videoStatus;
this.stopDrag();
}

function scrubit() {
ns.seek(Math.floor((loader.scrub._x/465)*duration));
}

var theMenu:ContextMenu = new ContextMenu();
theMenu.hideBuiltInItems();
_root.menu = theMenu;



function pauseIt() {
ns.pause();
}

function stopIt() {
ns.seek(0);
ns.pause();
}

function restartIt() {
ns.seek(0);
}

_root.createEmptyMovieClip("vSound",_root.getNextH ighestDepth());
vSound.attachAudio(ns);

var so:Sound = new Sound(vSound);

so.setVolume(100);

mute.onRollOver = function() {
if(so.getVolume()== 100) {
this.gotoAndStop("onOver");
}
else {
this.gotoAndStop("muteOver");
}
}

mute.onRollOut = function() {
if(so.getVolume()== 100) {
this.gotoAndStop("on");
}
else {
this.gotoAndStop("mute");
}
}

mute.onRelease = function() {
if(so.getVolume()== 100) {
so.setVolume(0);
this.gotoAndStop("muteOver");
}
else {
so.setVolume(100);
this.gotoAndStop("onOver");
}
}

ns.play("justwow_VP6_1Mbps.flv")
ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
driveIn.bufferClip._visible = false;
}
if(info.code == "NetStream.Buffer.Empty") {
driveIn.bufferClip._visible = true;
}
if(info.code == "NetStream.Play.Stop") {

ns.seek(0);
ns.pause();
var tw:Tween = new Tween(vid,"_alpha",Strong.easeOut,vid._alpha,0,1,t rue);
tw.onMotionFinished = function(){
vid._visible = false;
iLoader.loadClip("home.swf",myLoader);

}


}
}

Preloading Swf Trouble 2
can you have a look at this...

http://www.adriemooi.nl/downloads/bambooinn_fla.rar

The problem is that when you hit "menu" the .swf loads in fine, but the pictures won't load. I don't understand why...

Thanks.

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