ActionScript 3.0 :: Loading Several Contents Inside One Single Loader
Feb 2, 2012I want to know: is it possible to load several images using a single loader?
View 2 RepliesI want to know: is it possible to load several images using a single loader?
View 2 RepliesI am trying to have one single loader for different buttons to load their specific target. lets say I have btnOne and btnTwo, each of them have their page to link to, btnOne to pageOne, btnTwo to pageTwo, page one and two are external swfs. so can I load them into stage by sharing one single loader?
this is simply my script:
ActionScript Code:
var swfURL:String = ("external.swf");
btnOne.addEventListener (MouseEvent.CLICK, startLoad);
btnTwo.addEventListener (MouseEvent.CLICK, startLoad);
[code]....
I am trying to have one single loader for different buttons to load their specific target.lets say I have btnOne and btnTwo, each of them have their page to link to, btnOne to pageOne, btnTwo to pageTwo, page one and two are external swfs. so can I load them into stage by sharing one single loader? this is simply my script:
[Code]...
Is there any way to load a multiple xml files in a single urlloader.
View 2 RepliesI'm loading some images with Loaders, cloning the BitmapData to a new Bitmap, and adding the Bitmap as a child of a Sprite. So far, so good. I want the Loaders I'm using to be removed by garbage collection, which they seem to be. The problem, or so it seems, is that when the Loaders are cleaned up, the Bitmaps I'm creating lose their data.
Edit: All this is happening when a class is instanced, and many copies of this class are being used as actors in a game. As the Actors are being created the older ones are losing their BitmapData to garbage cleanup. When all of them are finally loaded, only the last few are visible. I've rewritten my posted code as a class. If I prevent the Loaders from being cleaned up by somehow keeping a reference to them, the Bitmaps don't lose the data, but I don't want these Loaders hanging around.
[Code]..
I want to load some .swf files using the Loader class. I'm all set with that and got the image on screen but I wish to have multiple instances of it. Do I have to reload one for each that I intent on using?
For example say I'm attempting to load a power up's graphic from an .swf (i'll call it ex.swf). I load it and then put the image I loaded into the power up. But then I also want to have another power up of the same type somewhere else, and I want to use that same graphic. Neither adding the loaded ex.swf's contents or simply assigning the contents to a child of the power up will work obviously. So do I have to load a new copy every single time i want a new one, or can I just clone/duplicate the contents?
I mean I know it must be common for games to have 100's of copies of the same graphic being used by different things, yet If I try to preload the amount I'd need it's not exactly flexibly and if I load them as I need them it seems bad practice..
I am attempting to load multiple images in AS3 and I'm exploring different options on how this can be done.I would like to have to only use one Load() instance and handle the various image assignments in the onComplete handler...here is my first attempt:
var buttonLdr:Loader = new Loader();
buttonLdr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
buttonLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadCo
[code]....
Sorry for the complicated topic. I got a .swf that loads in other .swfs. Rather than figuring out how to make a loader for loading .swfs I thought I'd just use a simple loader in the .swf I'm loading.
However, it doesn't work. It starts fully loaded but doesn't finish. Heres the AS:[AS]_root.stop();
PercentLoaded = _root.getBytesLoaded()/_root.getBytesTotal()*100;
[code].....
I have just successfully displayed the contents of my 'gallery' xml in a grid layout to my stage. My issue is I have a fairly small area to work with and I need to put these inside a custom scroller. The custom scroller I have atm displays only text (via a TextField and URLLoader) from a txt file and I'm confused how to alter it to load my gallery images (from my xml) instead. Can I load images from the XML into the textfield? Is there an easier way of doing it.
View 0 RepliesI have used a gallery component from flashXML.net. The problem is that the component makes internal stage conflict between my project and the gallery component, witch is embedded in my flash. The gallery works perfect, but it makes the scaling of my site totally wrong when I go back from the gallery to the rest of the site. Now I have override the problem by putting this code:Code: Select allstage.scaleMode="showAll"; on the frame where the HOME-button in the gallery is jumping to. The only problem now is that the site is about 20% off center at the left side on some screen resolutions. How I can get all the content perfectly centered?
View 1 RepliesHow can I make a single wav file out of two .wav inside a swf?
View 3 Repliesi am having problem with loading external text or html content code works on main timeline it loads whole html contents with image but i move it in movieclip the only text just disappears.i tried to load it through external swf file but the text is still invisible
View 1 RepliesI will be making flash projector. How do I make windows pop up on flash projector when you click on buttons while exploring the contents inside?
View 7 RepliesI want to have an AS3 app load images from url supplied by the user. But I don't want a malicious user to be able to load an SWF file in place of the image, such as with an altered extension "maliciousSwf.png". Well, not sure how big a security threat that is above and beyond the ability of the hacker to decompile swf, but I think that ideally such behavior should not be allowed.
So, is there any way to prevent this? When people allow users to load images in their Flash apps, do they somehow guard against loading of SWF? Or is this really absolutely no big deal?
I want to gain knowledge outside of the class.I have 4 buttons that each load different external swf and load properly the probelm i have is i cant remove them. this is my trouble. I have tried the remove child but it cant be that easy and it doesnt work. i must be going wrong.when i go to remove one single child it remove the the latest child but wont remove every child that i want so the MC is clear and ready for the nest button to load the swf.heres my code so far.
Code:
import flash.events.MouseEvent;
import flash.media.SoundMixer;
[code].....
I have an array being generated with numbers from an XML file. Then I have the function 'maxF' that returns the maximum number inside that array. I need to get programaticaly other nodes inside the same XML file [where all these numbers are coming from] to print the date [which is a node on top of the number node]
var a:Array = []; for (var i = 1; i<=15; i++) { var RootNode = getXml.firstChild; eval("price"+i).htmlText = ""+RootNode.childNodes[i].childNodes[4].childNodes[2].firstChild+"
How would I blur the contents of the stage during loading?
View 1 RepliesHow it is done, when you enter to site [URL]. Preloader loading the content of site and when you re-enter to site you see the preloader once again and preloader loading from 1 to 100 fast. What script cause this effect?
I have 2 mc, mc1 with script :
onClipEvent (enterFrame) {
if (!loaded && this._url != _root._url) {
if (this.getBytesLoaded() == this.getBytesTotal()) {
loaded = true;
_root.mc2.gotoAndPlay("preloader");
}}}
And mc2 have preloader in 2 frames and then goes frame with label loadMovie("content") but its not working.
I know that the autoSize works fine for textfields (loading contents from a XML, for example), but and for movieclips? There's a way to set this?
View 6 Repliesim working on an image viewer and im loading an image to a loader and then add the loader to the stage.I want the user to be able to drag and drop the image but since it's a loader i dont know how to do it.
I tried
imageLoader.startDrag = true;
imageLoader.content.startDrag = true;
but im getting an error on both.
I am developing a paint board application using flash builder. User can draw some shapes objects(ellipse, circle, rectangle). I want to implement grouping/un grouping feature some like ms-word in my application. I group multiple objects by putting them inside a container(UIComponent). Now i apply resizing to container and it resize well. I am using a free object handler API to apply selection handle over the container. I want to resize and reposition all children with respect to container changed size. Every thing goes well until all children inside container are having rotation = 0. But if there is any child which is having rotation >0 and <0 things goes worse. The child resize but not in a proper manner. I stretch the parent container width and it increase the height of rotated child. Is there any way using Matrix class or something else to transform all children in same direction and same ratio respective to container?
View 1 RepliesI have a 400x300 area that needs to detect a rollover and animate several buttons, text fields, etc. sliding into it when the mouse rolls into the area so that they can be manipulated, and animate them sliding out when the mouse rolls out of the area to hide them from view. (example here: [URL])
What is the best way to do this? The only way I have got it to work so far is by using a listener to track mouse position, but it's not reliable since you can move the mouse quickly in some areas of the movie and the listener doesn't catch it.
[Code]...
I want a MovieClip to play as its loading the content in the background, I already have the MC animated, the "loader", how do I do this! I tried this way
frame1
ifFrameLoaded ("end") {
gotoAndPlay ("Start");
}
frame 2
gotoAndPlay(1);
layer 2
loader
Thats all it works the only problem is, that I realized is that its dependent of connection speed, what I mean is that if you have a 200KB/s connection it will load so fast that it doesnt play the complete animation and I set the simulate download speed to like 50KB/s and it does play completely. So my question is will this happen when it's online?
I'm trying to load the content of a .txt file dynamically... If I leave the .txt file in the same root with the .swf it works perfectly, but I tried moving the .txt files into another folder and it stopped working...
Code:
var path ="/info/myInfo.txt";
var my_lv = new LoadVars();
my_lv.onLoad = function(success) {
if (success) {
// actions go here...
} else {
trace("error load text files");
}};
my_lv.load(path);
"info" is the name of the folder the .txt file is in... I even tried upload it to my server and giving the absolute address like [URL] but nothing...
I've got a movieclip with a blank dynamic textbox inside. On frame 1 of this movieclip, I have the actionscript to load the contents of an external .txt file into the dynamic textbox. The problems are:
1. I have an <img> tag in the external .txt that doesn't work (actually, the text does wrap around where the img is supposed to be in the dynamic textbox, but the img itself is not appearing.
2. All <p> tags don't work, but <br> does.
3. I have an ampersand (&) in the .txt file and all text is cut off at that point when loaded into the dynamic textbox. I've tried escaping it (&) and using & to no avail.
I'm loading content from a text file into a text field in Flash. In that text file I have some simple html tags like <b>, <i>, and <img>. I'm setting the textfield as html text:
myTextField.htmlText = myContent
The img tags work fine, but for some reason the bold and italics are not displaying...the tags are being correctly stripped from the text, but there is no bold or italic text. I'm embedding all the characters I need, but do I need to somehow embed the bold/italics versions of those characters?
I have built a simple Flash application that will be presented using a projector, the application will show messages in the form of questions that will come from a simple flat-file text file or XML file.
In addition to this I would also like to be able to add my own messages using a simple HTML form.
I've been looking around the web for some resources, but have been struggling to find what I am looking for. The basic idea is that the flash application will loop through these different messages from the XML, but then when a user types in a message that will also appear within these messages. Think of it as a sort of dynamic tag cloud.
I am trying to load a single image on to the stage via an xml file.Here is my xml file<?xml version="1.0" encoding="utf-8"?><pictures><pic>image1. jpg</pic></pictures>I'm trying to figure out the actionscript 3 code but I don't know how to code it.
View 6 RepliesSo im trying to load in a single image using xml into Flash and i cant seem to find any information on how to load a single image into a movie clip. All the information i can find is on how to make a slide show.
What i would like it to do is to load in a single image per frame using XML and then animate the picture all with code.
I have a very simple xml file:
Quote:
<myImage>
<imagePath>Miscellaneous/#1.jpg</imagePath>
<imagePath>Miscellaneous/#2.jpg</imagePath>
</myImage>
I'm customizing an xml flash website and while I can handle all the html and xml well enough, but in Flash, I have no clue how to:
Now go on the stage, and delete the contents of the last layer(background & pattern). Here, add from the library, the square movieclip, and name it mcBackColor(see attached image).And then to add your swf background in the "background & pattern" layer from the main.fla file.
I can change the name, but don't know how to delete just the contents of the layer and then add the new clip.I've made a slideshow before and that's all I can do.