ActionScript 2.0 :: Loading A SWF And Storing For Later Use?
Jul 15, 2009
I'm building a website which is entirely in flash. There is a large main flash file and as you navigate through the site, many other external SWF's are loaded. The problem is that some of these are quite large and take a while to load. I was wondering if there is a way to load an SWF without showing the user that it is loading (no progress bars or anything) and then not doing anything with it once it is loaded, but having it ready for when I want to use itsee the site to understand: If you click on the "band" link, it will load a page with several other links. Most of them you click will simply say "Coming Soon", but the Media, Contact, and Tour links currently work and are good examples of what I am talking about. How would I load one of these before the user has clicked it so it is ready?
Currently working on a project where I have to load in a ton of images and store them in corresponding arrays. The images are listed in seperate xml files bus.xml, car.xml, train.xml. The structure of the 3 files is the same e.g. <images> <image>car01.gif</image> <image>car02.gif</image> <image>car03.gif</image> </images>
Now inside of the main class I have arrays for the images. var busArray:Array; var carArray:Array; var trainArray:Array;
How would I create a function to recursively read each XML file and load the images into the array. I only want to create one Loader class. The bit that confuses me is how do I do the loop to load each file and once its loaded one file move onto the next until all the files from that XML file are loaded.
I thought it might be something like this, var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, imageLoaded); for(i = 0; i < xmlFileLength; i++) { loader.load(new URLRequest("car01.gif")); } private function imageLoaded(e:Event) { //add image to its array //move onto next image }
What I am thinking I need is a Flag of some sort to say the previous image is loaded. Move onto the next, but not sure how to structure it.
I'm trying to setup a program that loads a set number of pictures (the exact number is stored in resources/data.txt). Pictures are labled picture# starting at 0 and increasing.
My problem is that I want to store the loaded pictures, which is giving me trouble. When I try to trace the bitArray length, it says it is zero..
My Code:
//Variable Initilizing //Loaders: var mLoader:URLLoader;[code]....
I am loading files (or rather, pictures) in my Flex application from a server, technically from a database. I display some of them at a time, think of it like an image preview, and quite often I display the same image again. But I don't want to re-download the same file time and time again, so I would like to store it locally, and load it from there if it is available (or download it if necessary). I'm quite happy if the files can be stored in some temporary folder in AppData/iDontCare and get deleted on application restart.
File.applicationStorageDirectory would fit the bill, but only exists in Air.
What is the best way to store data gathered from a flash file, and load it into another flash file? Would xml or php work? and could it be instantaneous? Here is a diagram of what i am trying to do...
I have multiple swf files for background . I have to load the entire swf's first and have to store it in array . Is it good to store swf in array or dictionary?
I need some help with my code please. I have a for loop that creates sprites and loads images into the sprites theough XML. I have additional nodes for each image and sprite that get created that I want to store and call when I roll over the thumbs. What would be the best way to do this? I had to "improvise" and have the for loop create text fields to hold the data and then call it when I roll over throught "evt.target.
i'm trying to make a shoutbox/guestbook for my site in flash but i'm running into this problem. I'd like to have some sort of ip check, and i've got flash loading a var from php, and when I assign a text field the variable the users ip shows up just fine. my question is this-
how do i save whats in said text field as a string or something to use?
In a project I am working on, I will have hundreds- no, thousands- of small (32x32 pixels) images that I need to store in some way. What I need to know is what the most effective way would be. By effective, I mean "How can I keep the file size as small as possible and still retain its speed?". I thought this would be something somebody has discussed (and I still believe so), but I can't find it via Kirupa's search feature or googling.
I am doing an AS3 application. In the beginning of my AS file, I need to embed different textures as the following: Code: [Embed (source = "./myImage1")] public var Image1:Class;
I have to embeed n bitmaps. Then I have to create an instance of each oh thease classes. I want to store the names of thease classes in an array so I will be able to create an instance of a class by accessing the array.
Something like this: Code: var arrayOfClasses : Array = new Array(); arrayOfClasses.push(Image1); arrayOfClasses.push(Image2); ...
Then I want to go through the array and do : Code: var variable : Object = new arrayOfClasses[0]; But this dosen't work! How Can I build an array of classes? Is it doable?
I want to have a TV screen and hundreds of (small) flash animations load up in the 'TV'. I'm assuming I'm going to have to use Actionscript, so I'm looking into that right now. However, what would be the best way to organise this? Each "TV" will have a different set of "Channels". Do I create each 'channel' and save them as seperate SWF files, or is it possible to have them all in one main file. I can then flick through each 'channel', which essentially unloads the current animation and loads the next one
When a key is pressed, data is sent to PHP to be stored in a MySQL database. For each key press, only one entry should be posted. it re-posts exponentially (e.g., 1st key press = one post, 2nd key press = two posts, 3rd key press = three posts; thus, totaling six posts).Initially, the event listener for key press existed alone on a single frame. When that was the case. This issue did not occur. I added an additional frame so that I could set to clear out all variables and start fresh.
so frame 4 will have :
KeyListener = new Object(); KeyListener.onKeyDown = function(){ if (Key.isDown(69)){ // if key pressed is "E"
This script from MC 1 loads an template from the library and then creates as many instances as the XML says.
It also creates a dynamic variable called ppp. This variable i want to store in each of the newly ceated instances and then use it in another movieclip to load the right path where i want to load another xml file in Flash....
This is what i want to accomplish:
xmlData.load("albums/album"+ppp+"/images.xml");
This code is in another movieclip (MC2) and gets loaded in frame 5 of MC1.
Another soltuions is if it is possible to read the value that is loaded in the dynamic textfield nummer_txt from the template: Actionscript Code:
There is a combo-box by the name "cbJobs" and it gets its value from the XML file named "data.xml".. I want to store the value transferred from this XML file into a variable.. so basically someone told me to use the code
on (change) { _root.subject = this.getValue(); }
the only problem with this code is that it gets activated only after I "change" the value in combobox by pulling it down.. I want to use this value obtained from _root.subject as a subject in the script
I have 1 buttons in my flash movie. and want to use this swf in some other projects. just this button link will change in each project, so will also the button text. I dont want to edit flash file for each project. Can I use a text file for URL of button and I change text file to edit link of buttons and text of button?
I have 15 sets of x and y values, that should be stored together. I was thinking I could have an array, holding 15 other arrays, each holding the x and y value? Is that a valid way to do this? Also, is there a way to create those arrays holding the x and y, dynamically, so they just get numbered?
MainArray[ subArray[x1, y1]; subArray[x2, y2];
[Code]...
Obviously, above is not correct AS. Is this even a way to do this? Are there other much better ways?
I know you can store instance names in an array and call on the array values to reference the instance names in it.I was wondering if there is any way I can take an instance name, feed it directly into a function and use the name of the function variable/array/whatever to affect the object instance of whatever I name.
if it's an array of instance names, what is it actually an array of? Also, is there any way to hold and reference an instance name in a single value? sidenote: this doesnt have much to do with my question, but can arrays be fed directly into the header of a function?
I am trying to create a navigation where a button is highlighted with a glowfilter when clicked and then unhighlighted when another is clicked. I have this code that I think should be working, but for some reason the variable lastClicked is never assigned and always returns null.[code]
I have randomly generated 6 numbers, I need to know how I can store these in an array, and from this array the numbers will be compared with 6 number of another array to see how many balls are matching!
i wonder if someone know i way to save different numbers to a new var everytime the enterframe is updating. and then be able get the number out of that war later when its needed.[code]when i traced(theX);in the first.i can se that it got my numbers. but they do not get stored. so i cant use them when i want to get the numbers back.
I'm planning out an app that will (amongst other things) let the user speak into his mic and replay his voiceclip. I don't really need to permanently store the sound, it's enough if I can record it, replay it and overwrite it again if the user records another sound clip.
So far I gather this is impossible in Flash without the use of a mediaserver. Then again if I'm right the only way a media server can help me is by actually streaming the microphone input to the mediaserver, actually storing the sound as an mp3 file or similar, and then serving the mp3 file back to the app. It seems a bit overkill for just replaying short soundclips while the app is up, soundclips which are going to be re-recorded over and over while the user is using the app and trashed when he stops using the app.
Anyway, I recently heard something about how the flash 10 player actually allows you to store an mp3 or dynamically generated sound in a bytearray. It doesn't seem like a great leap to me to assume that if you can generate a sound and stick it in a bytearray, you can store mic input in a bytearray. But I haven't been able to find any info on the latter.
Has anyon experimented with this or found out a nay or yay on (temporarily) storing mic input in bytearrays?
I'm now writting a little drawing tool, that will allow users to save their drawings and the redraw them. Now I'm only concerning myself with diferent colored lines with diferent thickness. So now I only need to store the values, that will be used later on when calling the canvas object's graphics.lineTo(....); method. I'm planning to save all of my drawings in XML, but I still need to load them up when I want to use them.
Given my situation, what's the best way to load up my data (after loading it in chunks): Arrays, Dictionaries, anonymous objects. We're talking about loading up, let's say ~ 1000 Point instances for a very simple shape, since I want the drawing to be pixel-perfect, since I will be modifying it to a more sophisticated tool later.
anyone know if it's possible to have arrays indexing a series of functions say something a bit like this as an example?
[AS]genelist[0] = Math.random()*10;[/AS]
I am currently trying to get some geneticsstuff i did in director to flash so it can be used in a game, gonna suck if i have to have a LOAD of variables with different names...er this is in mx btw
This is really holding me up, so I hope someone can help me fast. I need to store each value of my for loop in a separate instance of my movieclip, but the movieclip only seems to pick up the last value of the loop.
Why is this and can I do this any other way apart from storing the value in a textfield or creating a loop within the movieclip?
Is it possible to save more complex expressions in variables and use it later/in an other object?
For example:If i want to store the expression (not the value) of in a variable, for exampe type something in an input textfield and then use it during runtime.
Say i type "mc._x +100" (without "-marks) into the textfield myText on stage (while the movie is running)