ActionScript 3.0 :: Creating If / Then Statement - Load An External XML File
Apr 6, 2011I'm using a movieclip to load an external XML file. In the XML I have a series of variables:
[Code]..
I'm using a movieclip to load an external XML file. In the XML I have a series of variables:
[Code]..
I have a main swf file that is loading multiple external SWF file when a menu button is clicked. Now I want to target a specific swf file to add an extra child from library or from another swf when that specific swf file is loaded. How should I do that? What should I put within the if statement?
var newswf:URLRequest= new URLRequest("./swfs/"+ event.target.name +".swf");
loader.load(newswf);
addChild(loader); //loading swfs dynamically
[Code].....
The Flash movie contains 2 Text files, one Component button, and 1 component checkbox.The purpose of the application is to load an XML file(works)Populate 2 text fields with information from the XML file(works)Compare the two text fields, if they contain the same information then the checkbox, via AS is told to be selected. (Heres the problem);
Heres the code:
Code:
runCode_btn.onPress = function() {
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = function(success) {
[code]....
The idea behind this app is that its an electronic form. The user fills it out, the information is then sent to a newly created XML file, months later the open the XML file in flash, and Flash fills out text fields and check and or unchecks Checkboxes based on the XML data.CheckBoxes are mandatory.But I don't see how I'll be able to use them if i can't create and condition statements based on the loaded Data.
I have a flash website that loads rather slowly, presumably because it is composed of a single .swf file, so I want to break that down into several. So how do I create a button that loads an external swf on top of the existing movie?
So far I have this which I pulled from {URL]
Code:
//This creates a new instance of the loader object.
var my_Loader:Loader = new Loader();
//This creates a new instance of the URLRequest object that contains the
//path to the external SWF.
[Code].....
I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?
View 15 RepliesI'm trying to create a slideshow that loads pics (jpg) from an external folder ("pics/") into dynamically created MCs.What I want is for the script to detect how many pics are in the folder (for future changes), create as many instances of the MC, and load the pics into each one. The MCs will need to take the W and H of the pics, and line up next to each other. This last part is not as important, I'm just wondering how to determine the number of pics in the folder. Do I need XML or will AS 1.0 or 2.0 do this?
View 1 RepliesI'm trying to create a slideshow that loads pics (jpg) from an external folder ("pics/") into dynamically created MCs.What I want is for the script to detect how many pics are in the folder (for future changes), create as many instances of the MC, and load the pics into each one. The MCs will need to take the W and H of the pics, and line up next to each other.This last part is not as important, I'm just wondering how to determine the number of pics in the folder. Do I need XML or will AS 1.0 or 2.0 do this?
View 1 RepliesStructure: 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 2004The 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.
View 4 RepliesI would like to create a dynamic menu in flash importing the text from an external file. I downloaded an fla from actionscript.org which makes the dynamic menu part (attached the fla & txt) and created a txt file. This is the point where I' m lost: How can I import the text for the menu from that txt file and store it in variable(s) than build the menu.
View 1 RepliesWhen i try to load an external swf file using Loader.Load(); The swf starts playing even before the init event is fired. Is there any way to stop the swf from playing atleast until the init event or complete event is fired?
View 1 RepliesHow I can make this script lo load mp3 files via an external xml file like music.xml and if is possible to load random
Code:
music = new Sound();
music.onSoundComplete = function() {
[code]....
1. How could I make it where some images/text in a flash file is taken from another outside file. For example lets say I have a image and text that would need to change constantly. The image could probably be done by using a url and changing the image set to that url, but I would rather have it search for a images file name on my computer. For the text is there a way I could use a text document, and have it set up to take the text in that document and display it.
2. How can I make it so when I click a link to an outside url it doesn't confirm that I want to visit it.
i have banner with 5 images fad in fade out effecti need to load images & test from external file " text file or xml file " with keeping fade effects on imagesall ways i know can't keep fading effect on images so
View 4 RepliesAll I'm trying to do is load an external .swf file into a precise location on the stage of my existing Flash file. I've spent an hour and a half on this site search and found nothing. What do I add to my loadMovie command to place the file at specific x,y coordinates?
View 3 Repliesi have a question. let say i have file1.swf , file2.swf, and file3.swf, how can i link this 3 files together,let say suppose file1.swf is the main content file, but as i load file2.swf, i want the file1.swf get replaced by file2.swf. How could i unload file1.swf at that time, so that my file2.swf will become the main content file?and again, when my current position at file2.swf, and i want it get replaced by file3.swf by clink on a button. so that the i can unload the file2.swf and let the file3.swf become the main content file.
View 13 Repliesi have a button that when it is pressed plays and loads an external flv file. this part works fine but directly after the flv video is finnished i want to load in an swf file. does some one have an idea how to do this? first show flv and then load swf?
this is the code as it looks now..
[Code]...
i'm building a website using flash. i have a external swf file that i want to import into my website. i thought this would be an easy task but for some reason when i load the movie, it flickers. my website (parent swf) was build using 1.0. The external form swf was build using 3.0. My approach:
1.create an empty movie clip called mcForm
2.go to the mc clip page i want to pull the external movie into
3. within my actions layer, I call the following function loadMovie("main.swf", mcForm);
If i write:
LoadMovieNum("main.swf",0);
then the my main.swf opens correctly but closes the parent swf file. I wan the main.swf file to be embeded within the parent file.
Creating a high score table in flash, using external file handling, can be achieved using server-side scripts, such as PHP. However, as this is not allowed for my game (school project), I need a way to write a few variables directly to a text file and read it back again. Is this possible? I am using AS 2.0. Any other ways in which a high score table, which is portable and can be saved and updated
View 3 RepliesThis shouldn't be too difficult. Heres my code:
for(i=0; i<30; i++){
var box[i]:Object = new Object()
box[i].id = [i]
box[i].name = "default"
box[i].location = "default"
box[i].type = "default"
But its not working. I keep getting error messages concerning the var box[i] statement.
I'm trying to load an external swf file into another with a loading that shows exactly the progression of the download. I tried to look at the loadClip and MovieClipLoader commands but I'm a newbie in AS, I don't really understand.
View 14 RepliesI've tried loading a .swf file externally into another .swf file on my local drive, and it works. Now, when I try to Simulate Download, the preloader in the 2nd file doesn't get played and the images in there take a while to get displayed. I need to load a .swf file from a server into the parent .swf file(I'm working on using a "thin flash file" for added security for the company I work for - blank file which loads the content from another file on their server).[code]...
View 2 RepliesI know how to load in a .swf from an external file. However, I don't know how to run one that's already in the library. Is it possible to have a .swf nested within a .swf? I want the final thing to be just one file.
View 3 RepliesI have a .css file and an .as file. I want to set the style name of a component in the .as file to a property defined in the .css file.Style name defined in Test.css
Code:
.imgRendererSkin {
stroke-color: #00ff00;
[code]......
I have my swf video, that load an other swf in a empty movie clip with the LoadMovie("...") function.And this work perfectly.But one of the video that I want to load refere to an external xml from were it takes the images (is a slide gallery). The swf work pefecty wen you play it "alone", but dosen't show anything when it is uploaded in the other video.
View 1 RepliesHow can I load an external SWF file? For example, I press the button "About", it will close the active window (where the button is located) and opens the file about.swf)
View 1 RepliesI'm new in this comunnity, and i try yo make some flash page based on xml, with a dynamic menubar.
I try to load a externel swf file but i can do it.[code]...
[code]...
in this code- is there anyway i can load the URL from an external file? Here: xmlData.load(myURL);can "myURL" be loaded from an external source.. may be from another XML file which i can keep locally and change the URL when needed.
I've used this AS to load an external .txt file
[AS]
loadText = new loadVars();
loadText.load("company.txt");
// creating the loadVarsText function
[Code]....
it works fine when the company.txt file is in the same folder as my swf file. (in my computer) the problem arise when i upload both of this files into my website. flash does not display the data in company.txt file.
I know how to load an external swf file with the following AS3[code]...
However, I want to load an external swf that is triggered by a mouse click. I have a button with an instance name if photogallery_btn and I want to apply AS3 to this so when this button is clicked, an external swf is loaded. Can some one please show me how to right this code?
Also, how do you unload a external swf? For example, say I get the code working for the photogallery_btn so when it's clicked, an external swf file is loaded. I would like to know how to unload another external swf file once the photogallery_btn is clicked.
I tried to load external swf file through .as..
Note: create "blue_box.swf" . I can't upload it.