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




Flash 8: How Do I Load Consecutive Multiple External Swf Files?



Hello, all of you brilliant people! I have a question and hope that someone may be able to help. I have a container .fla movie and would like to load consecutive external .swf files. Right now I have a play button triggering the loading of the next movie, but what I would REALLY like is a smooth transition from .swf to .swf using a listener so that the next .swf will load once the previous one has finished. I have a counter which determines the next .swf in order. So far, my code is this: Counter: stop();//SETUP OUR COUNTERvar mcCounter:Number = 0;//THIS BLOCK IS ONLY TO HANDLE THE LOADER AND THE FIRST MOVIE, movie0.swfvar myMCL:MovieClipLoader = new MovieClipLoader();var loadListener:Object = new Object();myMCL.addListener(loadListener);myMCL.loadClip("movie" + mcCounter + ".swf", 6);loadListener.onLoadComplete = function():Void { _level0.play();} //-------------------------<CLIP LOADERS>------------------------------\function loadNextClip():Void { if(mcCounter < 6) { mcCounter++; var nextMCL:MovieClipLoader = new MovieClipLoader(); nextMCL.addListener(this); nextMCL.loadClip("movie" + mcCounter + ".swf",6); } }//LOADS PREVIOUS CLIP , WON"T GO PAST ZEROfunction loadPrevClip():Void { if(mcCounter > 0) { mcCounter--; var prevMCL:MovieClipLoader = new MovieClipLoader(); prevMCL.addListener(this); prevMCL.loadClip("movie" + mcCounter + ".swf",6); }}//-------------------------</CLIP LOADERS>------------------------------\ Any suggestions? I appreciate ANY help you can offer. I have been unsuccessfully looking for hours online, and can't find any examples, although it doesn't seem as if it should be the hardest thing in the world.



KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 04-17-2006, 03:40 PM


View Complete Forum Thread with Replies

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

Best Way To Load Multiple External Mp3 Files
I have several mp3 files I would like to load into an fla. What is the best way to do this with the least amount of code. Would I use the NetStream class and an Array? Using AS 3.0.

[CS3] Load Multiple External Swf Files
I built a loader with three buttons, each of which loads a different external swf. The code works, and all three buttons load the correct swf, but when I click the second button before the first swf is finished playing, the two movies overlap. If I click all three buttons in succession, all three swfs play, one over the other.

How do I code the buttons so they first stop the swf that is already playing, and then play the swf they are meant to load? Here is my code:

var imageRequest:URLRequest = new URLRequest("scene1.swf");

var imageLoader:Loader = new Loader();

welcomeBtn.addEventListener(MouseEvent.CLICK, loader);

function loader(event:MouseEvent){
imageLoader.load(imageRequest);
marker.addChild(imageLoader);
}

var imageRequest2:URLRequest = new URLRequest("scene2.swf");

var imageLoader2:Loader = new Loader();

designBtn.addEventListener(MouseEvent.CLICK, loader2);

function loader2(event:MouseEvent){
imageLoader2.load(imageRequest2);
marker.addChild(imageLoader2);
}

var imageRequest3:URLRequest = new URLRequest("scene3.swf");

var imageLoader3:Loader = new Loader();

sponsorBtn.addEventListener(MouseEvent.CLICK, loader3);

function loader3(event:MouseEvent){
imageLoader3.load(imageRequest3);
marker.addChild(imageLoader3);
}

Thanks!

Load Progress Of Multiple External Files
here's a brain twister.. at least for me:

how would one create ONE load progress bar for MULTIPLE external images? The idea is that the site would load multiple images at one time (or one after another) and the viewer would be able to see the progress via a load bar (but only one load bar.. not 50 if there were 50 images).


I know I've seen other sites do this before.

any ideas?

-Pez

How Can I Set Up Multiple Preloaders To Load External Files On Demand (AS3)?
I've been looking for AS3 preloader tutorials, but haven't found what I'm after.

I'm trying to make a Flash-based portfolio. Since there may be a lot of images, rather than having one progress bar for all of them I want to load the external image files for each category only when the user goes there: Paintings, Pastels, Drawings, Logos, etc.

I've seen examples of how to load an external file from an xml file, and various other tutorials about the Loader and LoaderInfo classes, but nothing that explicitly explains how to make multiple preloaders.

I have some thoughts but before possibly going down the wrong road, might someone be able to suggest some sample code for a simple preloader that would load the contents of one of three xml files based on what icon was clicked? I've made a progress bar preloader for the main swf file, so I understand how to make the progress bar itself; but I'm wondering if someone knows a (relatively) simple way to set up multiple progress bars. There seem to be so many parts, classes to import, etc., that a simple template would be a real help.

In lieu of actual code, any suggestions would also be appreciated.

Thanks a lot in advance for your time.

Darrell

Multiple Flash Files Upon Page Load
i have a flash button on my home page. however, i'd like create different flash buttons with the same dimensions that would load randomly upon page load. is this possible?

i'd like to do this to add some variety to my home page. does this make sense? any help would be great.

thanks

Best Structure For Your Flash Site - How Do I Load Multiple XML Files?
I'm trying to use Mark Angeletti's excellent structure (http://www.sitepoint.com/article/structure-flash-site)
to solve my preloading problems. However, I'm having trouble loading an array of separate XML files. Here is his code for Frame 2:

var xmlData:XML = new XML();
xmlData.ignoreWhite = true;
xmlData.load( xmlFile );
xmlData.onLoad = loadXML;

BTW I don't understand what "loaded" is doing here. What is this importing? Nothing that I can find... from the above code. How does it know if loaded is TRUE? Please explain.

function loadXML(loaded) {

if (loaded) {
trace (xmlData)
var xnRootNode:XMLNode = this;
//add firstChild.childNodes stuff here...

}

I don't want to use his system of firstChild.childNodes in the function because my XML files are very simple - just heading and plain text. All I need to do is import all 43 of them. So I tried creating an array in the Global Variables import Frame (1) and going through them like this:

var counter:Number = allText.length, ii:Number = 0;
for (var i:Number = 0; i<counter; i++) {
var xmlData:XML = new XML();
xmlData.ignoreWhite = true
var loadText = this["eachText"+i]
xmlData.load(loadText);
xmlData.onLoad = loadXML;
}

Works so far - I can do a trace and see each one. However I can't get them into the loadXML function - one at a time. Do I need to create another loop in the function or can I put the function inside the above loop? Then how do I create another array of objects? Whatever syntax I try - ie - var xmlData[i]:XML = new XML(); comes up with an error.

Thanks for your help.
Charles

Multiple Consecutive FLVs
I have been asked to look in to a video based flash interface. The basic idea is that four figures walk on to the stage and then settle in to loops until the user clicks one. The selected figure then steps forward and delivers a short speech to camera while the other figures step back out of the frame.
The figures will all be against a plane white background and has been suggested that we could shoot this as four separate clips to make the looping part easier (we will have fairly limited time with each subject and they will not be actors).

My question is this:
Is it possible to load four individual FLVs, make them start playing at the same time and then play through together?

My gut feeling is that there are gonna be syncing issues due to variable download speeds and bandwidths and other unknowns but I have little experience of using video this way and would appreciate any comments or advice on the subject.

Cheers everyone

Load External WAV Or MP3 Files From Within Flash
Is it possible to load external .wav or .mp3 files from within flash? like with .jpgs and .swfs?

-Dave

How To Load External AVI Files With Flash
My external AVI files is much big ,I want use FScommand load mplayer to play my avi in swf files,who can help me to finished it ?(sorry !my english is bad!)

Playing Consecutive Mp3 Files
Hi
How do I play 3 sound objects one after the other?
If I write:

s1.play();
s2.play();
s3.play();

they all play at the same time. Is there an event that tells me s1 finished playing?
thanks
joe

Seamless Consecutive Files To Make One
So I'm looking at http://www.nosepilot.com, and I'm noticing that it's not really one big flash file but rather a whole bunch of smaller flash files that play end-to-end in simulated stream-ness.

How did he get the next file to load while the current one played, I wonder... and to do it so seamlessly. It's rather convincing that it's all one big file when it's really just a whole bunch of little ones.

Anyone got any leads? I'd like to know how to do this.

kyle t.

Problem Playing Consecutive Flv Files...
Hi everyone, I've been trying to figure this out for a while now and I'm beggining to get quite frustrated with it... I can't find anything when I search...
I've build an flv player and what I'm trying to do is play a second flv file immediately after the first one ends... ideally it would begin buffering before the first one ended so as to reduce the delay between the two flv files, but if I could just get the second one to play at all I'd be happy.
I've tried attaching and playing the new flv to the netStream inside a info.code == "NetStream.Play.Stop" conditional, but it doesn't seem to want to work... I may be approaching this the wrong way as I've only been writing actionScript for about 2 days now...
Thanks in advance for the help!

How Do I Load External Mp3 Files Intop My Flash Movie
Ok

Well i am a bit embarrassed as I ave made some movies so far that are not that simple but as yet I have not found out how to load in mp3's

I want to be able to load a mp3 file dynamically from outside the flash movie in the sense that it doesnt have to be in the library. It can be loaded dynamically like a text file.

So I click a button and the mp3 is loaded in dynamically and streamed.

Can someonme show me how to do this. Would love if someone could send an example .fla to my email address so i could see how they did.

have tried loadSound etc so if someone does have a working example where mp3's are loaded I would be most grateful.

please only send to my email as i cant download attachments from flashkit for some reason.

any idae of how to control the volume of the track with a slider and using sound.setVolume

my email is
pixelmagikau@yahoo.com.au

cheers
Pixelmagik

[F8] Dynamically Load External Sound Files In To Flash
I know how to Dynamically load external JPEG and SWF files in to flash but i need to know a way to load and play external sound files like wav's and MP3's. I need to be able to have a script that loads a sound thats in the same folder as the swf and be able to load it by name only. And when it's loaded i need to be able to control it with start and stop commands. I hope this is not to much to ask.

thanks

How Do I Load External SWF Video Files Into Main Flash?
Hello,

I need to know how to be able to load external SWF video files into a main flash movie via buttons on the main flash. What I am trying to do is to show video clips in a window on the main flash movie. I know I need to convert the video clips to flash first. Could someone tell me how should I convert them in flash professional 8, then have on the main flash movie different play buttons which can each bring a certain clip to play in a window. I'd like to be able to also allow the viewer to control the audio of each clip, as well as pause the clips, start them over again, etc. I'm just trying to allow my viewers the choice of which clip they want to play into a window on the main flash movie and be able to control them as well. I'd really appreciate it if someone would help me. It's really hard to find a solution anywhere else.

Thanks!

Rob

Unable To Load External Files Using Loadvars In Flash 8
Hi, i am unable to load external files from the flash authoring environment. Anyone know why this is or any possible fixes??

When ever I try and load a file, i get the error: (I changed the url of my site for this example of error)

Error opening URL "http://www.mysite.com/contact.php"

Any ideas??

Regards,

Martin

Computing Help And Info:
http://www.webrevolt.biz

Multiple External Text .txt Files In Different Swf Files
I'm trying to have several external files (txt or html) attached to a several swf flash files, loading in different levels of one main movie, for easy updating.

Example is: loadVariablesNum("ext-track.txt", 0);
This I can do, partly working.

Say you click the button for "about" that loads that flash file (in a layer), it fails to load in the relevant external file (the movie loads just not the external text file).

When you open up the "about.swf" on its own, it loads up the external file no problem. It just fails to do it when I am loading it from the main swf movie file that then loads this in a layer.

I can get all the text files working by putting in all the loadVariable parts in the main movie but I need them put into their relevant swf movies.

Does that make sense?

How do you correct, something to do with layers or targetting? I'm sure it'll be easy for you guys, Actionscript ain't my thing.

Thanks.

Load Consecutive Movies
I have 3, 500 frame external mc's. I want to load the first one in ( I can do that, works fine) and then when the first is done the second is loaded in automatically and plays and then the third. One right after another. so it looks seamless like it was one movie.
I am using a loader mc to load them into

any ideas?

Load And Keep Playing Consecutive Mcs At Intervals
Hi all -
I expect once again to be hitting my forehead and saying "d'oh"... this seems like something that should be easy to do but I'm having no luck... I have this feeling I could do this all with ActionScript but I don't know how...and now I'm stuck.

I'm trying to create an animation that will become part of an intro for a website.  I want 1,092 slanted ovals (1 slanted oval instance in 28 lines of 39 each) to enter two lines at a time from either side of the screen (starting at top & bottom and ending in the middle), and end up as a parallelogram made up of these ovals.
I created 14 mc's with two lines each starting from the top and bottom and with the two in the 14th meeting at the center. These work great.
I tried placing them at 20-frame intervals on the main stage, and this produced some really funky results! (Neat, but not what I wanted.) I tried to nest them in another mc and use "gotoAndPlay" and frame labels; that didn't work (or maybe it would if I knew what I was doing!!!). I'm starting to get very depressed... I've spent a heck of a lot of time on this and still have a whole site to do!
Can anyone suggest a better way to do this?  I'm even willing to start from scratch... And apologies if someone's already answered this... I tried searching for a solution but I don't seem to be using the right key words...


Load And Play Consecutive Swf's After Pressing A Button
I am definitely missing something here...

I have a button that when click, I would like it to play one swf, then another right after. Not sure if I have to use an array but here is what I have so far. I know it is probably VERY wrong so be kind.

Thank you!


ActionScript Code:
// External SWF Containter
var imageLoader:Loader = new Loader();

// URL Requests
var imageRequestmain:URLRequest = new URLRequest("intro_main_out.swf");
var imageRequestsecond:URLRequest = new URLRequest("holyguac.swf");

// Button Functions
but_about.buttonMode = true;
but_about.addEventListener(MouseEvent.CLICK,playabout);

function playabout(e:MouseEvent):void
{
   imageLoader.load(imageRequestmai)
   addChild(imageLoader)
   imageLoader.load(imageRequestsecond)
   addChild(imageLoader
}

Loading And Unloading Consecutive External .swf's
I've read through the forums as much as I can and I think I'm at wits end on trying to understand this (a lot of other things going on right now - hard to concentrate). I have an fla that I'm creating called "ordinal." I've got a main_mc on the front, and in that mc, I have three small, external .swf's I want to load, one leading right into the next one. I've read a lot of forums and links (especially senocular's) on the loading and unloading of .jpg's - and I guess I'm not getting the correlation. I would like it where:

movie1 automatically plays (I have it in frame 1-layer 2, with a stop command in frame 1 at the base layer)
movie 2 begins playing when movie 1 ends (the movie is in frame 2-layer3, I have a stop at the base layer)
and movie 3 begins when movie 1 ends.(the movie's in frame 3 - layer4, stop command at base layer)

So, I created a movie clip object named movieone, placed it into frame one (layer 2) and added the following code to the frame:

Code:
//load Movie Behavior
if(this.movieone == Number(this.movieone)){
loadMovieNum("ordinal.swf",this.movieone);
} else {
this.movieone.loadMovie("ordinal.swf");
}
//End Behavior
then created another movieclip, named movietwo, placed it into frame 2 (layer3) and added the code:

Code:
//load Movie Behavior
if(this.movietwo == Number(this.movietwo)){
loadMovieNum("ordinal2.swf",this.movietwo);
} else {
this.movietwo.loadMovie("ordinal2.swf");
}
//End Behavior
and the same for the third. Obviously I am not talented with the actionscripting (and scripting/programming is my biggest weakness), but I need to be able to have something that tells the movie to gotoAndPlay (nextFrame); at the end of each movie - that next frame being on the main timeline with only 3 frames for 3 external .swf's (unless I can reference it within the external swf). I have tried to load them into an empty movie clip, but I am getting very lost with understanding what levels to load movies into, unloading a movie, and so on. I haven't seen just a basic how to on - load movie, unload movie, then load movie, unload movie.. that wasn't specifically referring to .jpg's, and again - for whatever reason (beyond being tired), I can't seem to correlate back to .swf's when a jpg is a single picture versus a movie clip. Any suggestions / information would be greatly appreciated. I do own the FlashMX Bible, but for a non-programmer-oriented mind (a simpleton like me - it didn't explain much. Thanks in advance.

Load Multiple Xml Files?
In my movie is a slideshow with pictures. On opening it loads xml txt. What I want is when you click to the next picture, another txt file opens. How can I do that? Here's the example: http://www.tantesteef.nl/trein.html

Here's the code:
var xmlText = new XML();
xmlText.tf = textBox;
xmlText.onData = function(data) {
this.tf.html = true;
this.tf.htmlText = data;
};
xmlText.load("trein.txt");
next.onPress = function() {
if (myPic<7 && !fadein && !fadeout) {
fadeOut = true;
myPic++;
input = myPic;
}
};
back.onPress = function() {
if (myPic>1 && !fadein && !fadeout) {
fadeOut = true;
myPic--;
input = myPic;
}
};
container._alpha = 0;
myPic = 1;
// initiate change to new image when buttons are clicked
this.onEnterFrame = function() {
// when a new Photo is selected, fade out, load new image, and fade in
if (container._alpha>10 && fadeout) {
container._alpha -= 100;
}
if (container._alpha<10) {
loadMovie("images/trein/trein"+myPic+".jpg", "container");
fadeOut = false;
fadeIn = true;
}
if (container._alpha<100 && fadein && !fadeout) {
container._alpha += 10;
} else {
fadeIn = false;
}
};

regards

Load Multiple XML Files
Hello,

I need to load a large amount of datas into an XML object.
My files are like this:
XML CODE of file1.xml

Code:
<collection1>
<item_1>data_1</item_1>
<item_2>data_2</item_2>
...
<item_x>data_3</item_x>
</collection1>

XML CODE of file2.xml

Code:
<collection2>
<item_1>data_1</item_1>
<item_2>data_2</item_2>
...
<item_x>data_3</item_x>
</collection1>etc...

I first tried to merge all my files (file1.xml, file2.xml, etc.) into 1 big XML file but when I use this method:

Code:
myXML = new XML();
myXML.load("myBigFile.xml");

I get an error because of the SWF taking more than 15 seconds to load the fileThen, I tried to load 1 file after the other:

Code:
myXML.load("file1.xml");
myXML.load("file2.xml");
etc...

but of course, only the last one is loaded

Thanks to help me doing this using the separated files (file1.xml, file2.xml, etc.) and load the datas into ONE XML OBJECT (myXML)

Thanks

Marc

Load Multiple Xml Files
Hi,

I have an array filled with xml files locations.

I want to load each one in and then attach the result to a variable, which describes its content, e.g. contact, home, support etc.

Is there a wau of doing this with a loop?

Also I would like to know the total size of all the files and how much is loaded whilst loading, for the preloader.

thanks in advance.

ash

Possible To Load Multiple Files As One?
hey!
im making a little flash game and im wondering if this is possible..
I want to (just because) create one file which contains all the data that i want to load into my flash movie.

say i place all the files/sounds/external swf's in one folder and sort them how i like..
Then i zip that folder and place it on my webbserver.

is it now possible to load in that zip file and retrieve the contents of it using only flash?


it offcourse does not have to be zip format.. i just want that general concept.

Thanks
//VoS

Load Multiple Xml Files?
var myObjArray = new Array;
myXML = new XML();
myXML.load("test.xml");
myXML.ignoreWhite = true;
myXML.onLoad=displayText;
function displayText(){
map = myXML.firstChild;
us = area.firstChild;
items = us.childNodes

for (var i = 0; i<items.length; i++) {
myObjArray.push( { names: items[i].firstChild.firstChild,
color: items[i].firstChild.attributes.color,
xmllink: items[i].firstChild.nextSibling.nextSibling.firstChild}
);
}
for (var t = 0; t<61; t++) {
displayFormatName(t);
}
}

function displayFormatName(num){
pointerXMLfiles = myObjArray[num].xmllink;
additionalXML = new XML();
additionalXML.load(pointerXMLfiles);
additionalXML.ignoreWhite = true;
additionalXML.onLoad=function(success){
if (success) {
trace(myObjArray[num].name + " " + pointerXMLfiles); /*HERE IS TRACE IN QUESTION*/
if (additionalXML.firstChild.nodeName == "Timestamp"){
trace(additionalXML.firstChild.firstChild.nodeName ); /*DESIRED POINT*/
}
}
}
}


I have a question about multiple xml files being loaded into actonscripts. So I have an xml file in flash that has additional xml files with values in them. So the nodeValues are just links to other xml files

<item>
<aXML>test2.xml</aXML>
</item>

I first load the main xml file then create an object array and pour in some values (mainly links to more xml files). Once I have all that info in the object, then I loop through the object and load each xml file. But here is where the problem is essentially there are 60 xml files and when I trace in the onLoad function what comes out is not in order that it should be. The index values of the object array are out of wack, it should be 0,1,2,3,4.... but whats coming out is 1,4, 3,5, 0, 7, 14, 22, 2.... not only that but I am never getting to my disired point. Basically is there a way to load 60 different xml files so I can print out information thats in them in one motion???? Is there something obvious that I'm doing wrong????? Anyone see another way to this???

thanks, all you help is much appreciated!!

Load Multiple Swf Files
Hi,

I have a flash animation, and a certain movieclip has to load multiple swf
files. I know how to load one, but what to do if the first one has ended?

Also how do I refer with a button to load instantly e.g. the 3th movie?

Can anyone help me?

Thanks in advance!

Load Multiple Text Files Into A .swf?
Hi..

I want to create a news feeder with dynamic text.

So what I would like to happen is:
A news (dynamic text) is fading in.. Holds back for couple of seconds. It then fades out and another news fades in..

I manage to load ONE text file.. But how do I load the next one?

Im a complete newbie so Im not sure if there is a code in flash, or if I should make a code within the textfile..

(Im using MX)

Thanks!

Need To Dynamically Load Multiple XML Files
A vendor has offered a data stream for elections coverage that is driving me nuts.

It's a county-by-county data stream for a given state's races. Each race has upwards of 250 XML files -- depending on the state -- one for each county's election returns. Thankfully, the XML files for the counties in a race are numberically ordered alphabetically.

Here's the problem -- I need to dynamically read the each county's candidate vote count from, say, 90 XML files. On the fly. The vote counts will then be used to color individual county movieclips based on the results (e.g. GOP = red, Dem = blue, etc.).

I have a script that I call when everything in the movie loads -- it starts looping to call the XML files (90 or so) and begins to read the data to color the county clips. Problem is, I can't switch to a different race (restarting the loop) without screwing up the XML calls and getting a bunch of undefined values which determine county clip colors.

Here's the function I'm using to dynamically color the county clips (imagine 100+ XML files being pulled in using this looping function):


Code:
var loadLeadersCount:Number = 1;
var loadLeadersTotal:Number = countyList.length;
var loadLeadersData:Function = function() {
tempCountyID = loadLeadersCount;
// prepend zeros and other prefixes for countyIDs
if (tempCountyID < 100 && tempCountyID >= 10) {
tempCountyID = "110" + tempCountyID;
} else if (tempCountyID < 10 && tempCountyID >= 1) {
tempCountyID = "1100" + tempCountyID;
} else {
tempCountyID = "11" + tempCountyID;
}

xmlInitLeaders = function() {
var xPathTemp:String = "/Vote/Race/ReportingUnit/Candidate";
leadersCandidates = new Array();
leadersCandidates = XPathAPI.selectNodeList(xmlDataLeaders.firstChild, xPathTemp);

tempLeaderXMLNode = leadersCandidates;

tempCandidateArray = new Array();
for (var i:Number = 0; i < leadersCandidates.length; i++) {
tempCandidateArray.push({tempParty:leadersCandidates[i].attributes.Party,tempVotes:leadersCandidates[i].attributes.VoteCount});
}
tempCandidateArray.sortOn("tempVotes", Array.DESCENDING | Array.NUMERIC);
tempLeader = tempCandidateArray[0].tempParty;
trace(tempLeader);
switch (tempLeader) {
case "Dem" :
tempColor = new Color(this[countyList[(loadLeadersCount - 1)]]);
tempColor.setRGB(0x0000ff);
break;
case "Lib" :
tempColor = new Color(this[countyList[(loadLeadersCount - 1)]]);
tempColor.setRGB(0x00ff00);
break;
case "GOP" :
tempColor = new Color(this[countyList[(loadLeadersCount - 1)]]);
tempColor.setRGB(0xff0000);
break;
default :
tempColor = new Color(this[countyList[(loadLeadersCount - 1)]]);
tempColor.setRGB(0x87676d);
break;
}
loadLeadersCount++
if (loadLeadersCount <= loadLeadersTotal) {
loadLeadersData();
} else {
trace("No more counties to process!");
}
}

xmlDataLeaders = new XML();
xmlDataLeaders.ignoreWhite = true;
xmlDataLeaders.onLoad = function(success:Boolean) {
if(success) {
xmlInitLeaders();
trace("XML loaded!");
} else {
trace("XML did not load!");
}
}
xmlDataLeaders.load(currentRaceXMLPath + tempCountyID + ".xml");
trace(currentRaceXMLPath + tempCountyID + ".xml");
}
Here's the combobox init code that sets up a listener for when someone would switch to a different set of XML files (for a different race):


Code:
// function to initialize race selection combobox
var initSelectRaceCombo:Function = function() {
this.comboSelectRace.dataProvider = raceList;
comboSelectRaceListener = new Object();
comboSelectRaceListener.change = function(event_obj:Object) {
currentRaceXMLPath = event_obj.target.selectedItem.data;
loadState();
loadLeadersCount = 1;
loadLeadersData();
}
comboSelectRace.addEventListener("change", comboSelectRaceListener);
currentRaceXMLPath = this.comboSelectRace.selectedItem.data;
selectRaceClip._visible = true;
comboSelectRace._visible = true;
creditsAltClip._visible = true;
loadState();
initCounties();
loadLeadersData();
}
Any thoughts? There's gotta be a better way to do this, but I can't lock down the combo box and prevent someone from switching to another race while they wait 30 - 90 seconds for the XML load loop to finish.

Thanks,
IronChefMorimoto

Load Multiple XML Files At Startup
The ActionScript 3 XML Basics tutorial at gotoandlearn.com has convinced me to get into AS3. The new XML loading process is so much better in AS3

What I want to do however, is load in more than one XML (each with different structures) at startup. This tutorial is just dealing with one standard RSS feed. I can probably work something out, but i was wondering if anyone can suggest a good way to go about it? I would probably duplicate the code below for every XML file i need to open, but i feel like theres a better way..


This is the AS from the tutorial (ive taken out the listbox and textarea parts):


ActionScript Code:
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onLoaded);

var xml:XML;

function onLoaded(e:Event):void
{
   
    xml = new XML(e.target.data);
    var il:XMLList = xml.channel.item;
    for(var i:uint=0; i<il.length(); i++)
    {
        trace(il.title.text()[i]);
    }
}

loader.load(new URLRequest("http://theflashblog.com/?feed=rss"));

Trying To Load Multiple Txt Files Into Slideshow
Im trying to load multiple txt files into a scroller "dynamic" text field. I am able to load my jpgs but not my text files. I am new to flash and have no clue as to what i am doing wrong. I havent been able to find any examples of loading the files the way I am tring to. I have over 50 txt files that I am using this is why im tring to load them this way. Sorry if I am not clear but here is my code.


ActionScript Code:
//initialize variables and properties
square._alpha = 0;
whichPic = 1;
whichtext = 1;
//initiate change to new image when buttons are clicked
next.onPress = function() {
    if (whichPic<10 && !fadeIn && !fadeOut) {
        fadeOut = true;
        whichpic++;
        input = whichPic;
    For (whichtext<10)
        whichtext++;
        input = whichtext;
    }
};
back.onPress = function() {
    if (whichPic>1 && !fadeIn && !fadeOut) {
        fadeOut = true;
        whichpic--;
        input = whichPic;
    For (whichtext>1)
        whichtext--;
        input = whichtext;
    }
};
_root.onEnterFrame = function() {
    // when a new Photo is selected, fade out, load new image, and fade in
    if (square._alpha>10 && fadeOut) {
        square._alpha -= 10;
    }
    if (square._alpha<10) {
        loadMovie("../images/"+whichPic+".jpg", "square");
        fadeOut = false;
        fadeIn = true;
    }
    if (square._alpha<100 && fadeIn && !fadeOut) {
        square._alpha += 10;
    } else {
        fadeIn = false;
    }
    // limit input field
    if (input>10) {
        input = 10;
    }
    // initiate change to new image when Enter key is pressed
    if (Key.isDown(Key.ENTER)) {
        fadeOut = true;
        whichpic = input;
    }
};
// if a number is entered in the input field but Enter is not pressed, change
// back to current Photo number when clicking anywhere else
inputField.onKillFocus = function() {
    input = whichPic;
};

//loadVarsText = new loadVars();
loadVarsText.load("../text/" +whichtext+".txt");
//assign a function which fires when the data is loaded:
loadVarsText.onLoad = function(success) {
    if (success) {
        trace("done loading");
        //Now that we know the data is loaded,
        //set the text content of the Text Field
        //with the instance name "scroller" equal to the
        //contents of the variable
        scroller.txt = this.var1;
    } else {
        trace("not loaded");
    }
}

Load Multiple Files With One ProgressBar
Hey Guys,
first of all, greetings from Munich.

Well, i'd really!! appreciate you to help me with my problem cause i cant figure out how to manage that.

Okay, basically im puttin Loaders into an Array, after i loop the array and add a ProgressListener to each Loader, just have a look:

Code:

var totalBytes:int;
var progressOpened:Array = new Array()
private function addEventListeners():void {
         
         for (var i:int = 0; i < GlobalVarContainer.vars.pics.length; i++) {
            
            progressOpened[i] = false;
            GlobalVarContainer.vars.pics[i].contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
                                             function (event:ProgressEvent){progressing(event,i)});
            //GlobalVarContainer.vars.pics[i].contentLoaderInfo.addEventListener(Event.COMPLETE, picL);
            
         }
         
      }
      private function progressing(event:ProgressEvent,i:int):void {
         
         if (event.target.bytesTotal != 0 && progressOpened[i] == false) {
            
            totalBytes += event.target.bytesTotal;
            progressOpened[i] = true;
            trace("aha");
            
            
         }
         if (i == GlobalVarContainer.vars.pics.length-2) {
            
            trace("totalbytes"+totalBytes);
            
         }
         
      }

Well, it traces absolutely nothing, do you have any advice?
Thanks a lot!

[F8] External Text Files Wont Load Into External Swf File...
Hi,

I'm making a Flash website in Flash 8 (mac).

Structure: There is 1 main file that loads external SWF files depending on what is clicked on.

One of the external SWF files loads its text from external text files. This works fine when viewing the SWF applet on its own. But when viewing as a whole site, the text doesnt appear. Very annoying.

I made that particular SWF on my mums computer running Flash MX 2004. The flash file itself uses the Scrollbar component from MX.

Could someone tell me why the text doesnt load in this scenario? It runs fine on its own, just not as an external SWF.

I've attached the files in question. Its a 200kb ZIP download. Do tell me if you need to know more.

Thanks

Can I Load Multiple Text Files Into Scroller?
Hi...is it possible to load multiple text files into a single text scroller?

I am using MX and I have a main swf movie that I am loading my link swf's into. On all my link swf's I have buttons that will control the info on those swf's. For each button (3 on each link swf's) I want to have a scrolling text box for the info. Which means I need 3 scrolling text boxes for each of my link swf's.

Is there a way to use 1 scrolling text box and just load the text for each as each button on my link swf's is pressed?

Load Multiple Files Into Single Array
hi, I have two ordinary .txt files with several lines of text in both of them. What I want to do is to load the text of both files into a single array, is that possible?
note: the number of text-files will vary depending on user input.

at the moment I have:


PHP Code:



fileNames = ["text1.txt", "text2.txt"];




and I know you can use loadVariablesNum if you have only one file to load, but as soon as I've got two or more it just overwrites the old loaded text instead of adding it to the array.

any solutions?
thanks

External Swf Preloader (multiple Files)
I need to create an action script that at the insertion of the CD-ROM im creating it loads all needed external swf files.
However, I do not want this to be evident to the user.

For instance. while distracted with other crap the CD-ROM is preloading:
a.swf to level 1 when finished it preloads
b.swf to level 2 and so on.

kind of an when load (a.swf) complete (play)


let me know if anybody understands this.

Multiple External Files Not Loading On First Try
I need some help, I have 2 swfs being loaded. One is the sound player with a music playlist. The second is the homepage with some text. Each swf loads two separate external text files through LoadVariables. When a user first hits the page, the playlist always loads. But the text for the homepage screen doesn't. If they refresh, both load fine. I'm assuming it's because the playlist is already cached, and now the homepage screen text can load ok.

Can we not load 2 LoadVariables external files to the same Parent timeline at the same time?

I've tried using onClipEvent(load) & onClipEvent(data), and I've tried using the new MX Load component. The behavior repeats under everything I've tried.

Please help!!!

Multiple External Files Not Loading On First Try
I need some help, I have 2 swfs being loaded. One is the sound player with a music playlist. The second is the homepage with some text. Each swf loads two separate external text files through LoadVariables. When a user first hits the page, the playlist always loads. But the text for the homepage screen doesn't. If they refresh, both load fine. I'm assuming it's because the playlist is already cached, and now the homepage screen text can load ok.

Can we not load 2 LoadVariables external files to the same Parent timeline at the same time?

I've tried using onClipEvent(load) & onClipEvent(data), and I've tried using the new MX Load component. The behavior repeats under everything I've tried.

Please help!!!

Loading Multiple External Txt Files
Here is the problem I'm having. I have a page that has multiple txt files loaded into a dynamic box. When I load a file, I can scroll down and read the entire thing. Problem is, when I load the next file, it doesn't load it at the top of the file but rather 1/2 way down. Is there any way to fix this? The example can be seen here:

http://www.thegoheens.com/flash/main.html

It is the "buyers" page. Links on the left, text on the right.

Thanks for the help.

Multiple External Video Files
Ok so here is my question. I would like to create a flash movie player that calls FLVs from an external location (mainly a streaming server), secondly I want it to be able to select from any of the videos (in no specific order).

For instance if I had:

Flash Movie 1
Flash Movie 2
Flash Movie 3

I would want to be able to lets say watch Flash Movie 1 and then Watch Flash Movie 3 and then Flash Movie 2, or whatever other orders there may be.


Thirdly I would like to be able to change the playlist (add/delete) videos from the web page without changing the Flash.

I understand that I may have to go into the Flash file and add one line of Actionscript to call on that file, but I want to try and not do that at all.

Does anyone have any idea how to do this or know of a link or a tutorial where I can find something of this nature.
So I guess I would need a little bit of a skin and be given the ability to to customize a bit.

Preload External Multiple 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!!!!!!!!!!!

Multiple Preloaders For External Files
I have designed this site with few external swf. I was wondering how can I preload all the externals swf's file in the same preloader of my first frame and scene. I have this code :
onClipEvent (load)
{
total = _root.getBytesTotal();
}
onClipEvent (enterFrame)
{
loaded = _root.getBytesLoaded();
percent = int(loaded / total * 100);
text = percent + "%";
gotoAndStop(percent);
if (loaded == total)
{
_root.gotoAndPlay(2);
} // end if
}

and I wanna have the name of the swf that is been loaded showing up on the text box with the bar of progress moving especifically for the progress of that external.

Thanks guys....

Loading Multiple External Files
I have a timeline where I have external swf files that play in sequence. I need to know how to preload a few of these files at a time so that there is no break between them.

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

Print Multiple External Files
I am trying to find a way that I can print a range of jpgs that aren't currently loaded in my movie.

I have a list of thumbnails of photos (with correlating larger version residing externally)each with a number. I want the user to be able to specify a range they would like to print. I think I've gotten close by trying to create a new cast member and load the jpg into it for each one in the range. However my movie keeps hanging and not responding why I try that method.

Any help would be greatly appreciated.

Also, the movie is currently using AS2.

Navigation On Multiple External Swf Files.
Hello everyone,

I have a file (main.fla) which loads external movieclips on it,using an empty movieclip as loader (loader_mc).Now,I want to create a navigation,with two buttons (previous / next) which will allow me to navigate through the external movieclips.
So,I have created these two buttons.For the "next" button I am using this code,to load the first external swf file (example1.swf):

Code:
on (release) {
if(this._parent.loader == Number(this._parent.loader_mc)){
loadMovieNum("example1.swf",this._parent.loader_mc);
} else {
this._parent.loader_mc.loadMovie("example1.swf");
}
}
This is a simple code,taken from the behavior.
So,everything is fine till now.The first ext.swf loads correctly.
Now,what code do I need to use,in order to be able to load the second ext.swf file (example2.swf) when the "next" button is clicked?

Thanks in advance

Loading Multiple External .jpg Files
Hi All

I want to load multiple external jpg images in one frame.
This works for one image, i want to load at least 6 images.

_root.createEmptyMovieClip("container",1);
container.loadMovie("photo.jpg");
container._x = 50; container._y = 350 ;

I have created 6 layers and changed the x & Y fot each layer, still i only see the last one.

How to do this right ?

Thanks for any input.

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!!!!!!!!!!!

[mp3] Loading Multiple External Mp3 Files . . .
Last edited by KenNiles : 2003-12-05 at 10:47.
























ADMIN ---> I'm trying to delete this post. Problem solved.
Sorry!!

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