ActionScript 3.0 :: Load Several XML Files At Start Up?
Feb 5, 2010
I want to load several xml files at start up, so far I have managed to load one xml, but I'm getting puzzled how to load several xml files, heres my code on first keyframe:
ActionScript Code:
stop();
var xml1:XML;
// how to load this XML(one below) - with url "secondXML.xml" ??
var xml2:XML;
[Code]....
When XML has been succesfully loaded - it goes to Main keyframe, where the rest of the code is.
Im working on a site which incorperates several flash movies on one html page.
I realy want all these flash movies to start at the same time so they fade out in sync.
[URL]
I cant seem to find any command in flash to start a seperate flash movie playing but im sure that there is one.
I have thought about 2 ways of achieving this but am not sure which is the best way. The first is to have an extra movie that checks to see if the others have loaded then when all 4 have loaded it then starts them all at the same time.
The other way is to have each movie send a variable when it is loaded, then when all the variables are checked a start function is sent either via javascript or php.
I've got a swf which uses AS 3 to load separate audio (mp3) and video (flv) files. The reason they're separate is because the audio is just background music while the video is navigatable. The video kinda goes along with the audio, but it's not imperative that the two sync perfectly. However, the audio always starts playing before enough of the video has loaded to begin streaming.I'm at a loss as to how to get the two to at least START at the same time.
Ive just finished a flash web site that ive used a lot of XML for loading my images from thumbnails. Its works great.
Except it takes maybe 3-4 minutes to load. I think whats happening is its loading all the images in that XML file before it even shows the first thumbnail, so thats like 2MB its loading.
Is there a way to preload all of the xml files at the start on my Flash splash page?
My video is a bit jerky at the moment at the beginning. Can I somehow have my adobe swf player load up a generously sized buffer before it starts to play, or is that not the issue? Later on in the video, the jerkiness is not an issue.
Let's assume that I can't script the loaded swf, nor can the loaded one script the loader swf.
I was attempting to set frame rate to 0, and wait after all swfs are loaded, and set frame rate back. But I found when I set the frame rate to 0, I could not receive the complete event! And it's weird that i can still receive UI events...
Is there a way to load several swfs and start them together?
I have attached the file for reference but would like to know how to start the mc 1936 when the file is published and the swf is first opened. I can get this to do this HOWEVER I cannot get the 1936 to then respond correctly as per the actionscript IE close when 1938 is clicked? 1936 keeps opening and I cannot get this to ONLY do this ONCE when first opened.
I am making a big big big game, and I came across a huge problem. My game has over 60 unique units, which mean that the library of my .fla file is REALLY huge. Flash just can't handle it anymore, and crashes every 5 min. I can't optimize it(already did) and I can't cut through the content. I think I found a solution: I will load my units from external .swf. Sooo, the thing is, I want to load these swf only once, at the start of the game. Here is how it goes: I divided my units in many packets, and set every unit to be "exported for Actionscript" in the library. This way, ill load the .swf and its library at the beginning of the game and I will be able to attach the units MC over runtime.
We're trying to implement a load-balancing mechanism between FMS hosts in a virtual "farm". The mechanism we're using is to have the FMSs periodically send "load" data (along with a timestamp) to an application server. That server will then use that load information and timestamp to detect when an FMS server has gone down and to make stream assignments to FMSs. Right now, I've implemented this code via a setInterval() in live/main.asc.
I've added a "return false" to Application.onAppStop() to (according to the docs, I haven't tested this yet) keep the server from shutting down an idle instance. How do I get the interval running before the first request hits the application (and forces the load of the application)? I've tried putting the setInterval in onAppStart() and as a global. In both cases, it only gets executed after application is loaded. Any way to force an application to load (via a config file parameter or local command-line)?
I'm new to flash and action script 2, and I am trying to load an external movie and have it start at frame 3. It's the start at frame 3 that I'm having trouble with. The following code does not work:
what I'm trying to do is make a preloader that will preload about 20 external SWF files before it lets you get to my main file. I want to do this because my main file needs the SWFs to be ready to go once its done loading. I have looked around and i found a few ways to do this with the "if (loadedBytes>=totalBytes)" and the code loops back till the files are done loading... this would be just what i need but i cant seem to get it to work. the file just seems to start loading my files but does not loop and just runs the time-line even once i state what frames i want it to loop.
This one is tough to diagnose. I built an animated jigsaw app that pulls in a dynamic .swf that can be viewed here: [URL] It works perfect in Chrome. Works in FF 3.5.5 until I start reloading. Doesn't even work in IE7. Could be a embed problem in the HTML. Could be something I did in flash. [I can get more into the methods I used] [for those that only see it working or don't see it working] There should be an orange animation of a morphing shape cutout into jigsaw shaped pieces and a start button. When it doesn't load, the animation, nor start button display. And the menu is slightly messed up.
I have a question about loading external data. When I had all my actionscript export to frame one, it would slow down the preloader and not show up until it was far into the progress bar animation. So I moved everything to frame 2. The problem with that is now my menus which are populated from an xml file are not there when the site starts to play. How can I get my xml data to load on frame one, but leave the .as fils to load in frame 2?
i am making a quiz. My problem is that once the user completes the quiz and wants to start again the quiz is already on the last question. How do i make it so that once the user clicks start again the questions and answers arrays start from the beginning, sort of reset themselves.
I'm trying to broaden my horizons with it and so I'm trying to do an update of a quiz program my employer has. Everything has worked well, except for the timer. The button that starts the game has two options, "study" or "exam"; if the study is selected, there is no countdown, just the score keeper. If the exam option is selected, the timer is show (counting up). But, press "Start" and while the quiz begins, the timer, in either case, does not.
I'm going to post the actionscript for the timer that was already there, as well as the start button. I'm hoping someone can explain how this timer is supposed to work and why it's not; and where the disconnect lies in pressing the start button and making it run.The timer is embedded in a movie clip, with two dynamic text boxes, that are for some have no instance name; and actionscript spread out over several frames.Frame 1:
I'm trying to load a swf file within another swf file and then load different swf files from buttons.This is the code I'm using, but I can't get any of the swf files to load.
var Xpos:Number = 0; var Ypos:Number = 0; var swf:MovieClip;[code]...........
I am trying to load a jpg into a loader so I go into the properties then change the content path to input a URL. It works fine on the stage but when I put it inside a button it doesn't work....
I am trying to make a mp3 player with different channels of music. The player can load an xml file and then it does play on complete. My problem is loading a new xml file with different music and having it play the new playlist.
I load a page with JavaScript and CSS files included in it from multiple iframes embedded in my flex application, are these JavaScript and CSS files loaded multiple times in the browser for each iframe? If yes how can I avoid it or what are the best practices?
This is driving me nuts right now! I'm trying to load different swf files, but for some reason the first swf keeps reloading instead of new one. This is my structure: I have a main file main.swf where I can load in 1.swf, 2.swf or 3.swf. Lets say I load 1.swf, that works fine. But When I'm in 1.swf I have 3 buttons where I can load 1.swf over agian, or 2.swf or 3.swf. No matter which button I press I always load in 1.swf!!
I have different names on loaders and functions! So everything is separated correctly. Just don't now whats going on, spooky!
I used to merge the .swf files by a free software named Flash Package. It can merge the individual swf files into a single swf file or .exe file. It will allow you play this single file again and again.Currently I find if the total swf files size are more than 500mb, it will not allow me to merge them together. Therefore, I think if I can write an Actionscript code that loads individual swf files and play them one by one. When it played all the file, it is able to automatically play the first one.Unfortunately, I only know how to load one file. I wrote code as follow:[code]My question is how I can tell flash that the previous swf file has been played and reached to the end then loaded next one?
I got a buggy warning from my flash cs4 project, saying at the compiler errors; warning : unable to load SWC fls ther's no reference to the line/place having this error in location area of compiler errors!! i didn't kow how i got there cause it was working smooth befor this error! strange also,
and since, we are at the new year, you know, ther's the best film of the year, the best site of the year.. why not make a "the strangiest undocumented error of the year!".. anyway, if ther's such a competition, I vote for this error!
For some reason my slideshow gallery will not work with specific swf files. I can't find any correlation between the ones that work and the ones that don't work - stage size, length, as3 version, actions, ect don't seem to matter.
I'm tempted to chalk to up to a bug in CS4 and try to install CS3, but I was wondering if anyone has ran into this before.