simple variable problem and question preloader

I am new to AS3 and have a problem with the following code:

Stop();
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
var homeText:URLLoader = new URLLoader();
var slideLoader:Loader = new Loader();
var sprContainer1:Sprite;
var projectPath:String;

LOADING XML

xmlLoader.addEventListener (Event.COMPLETE, LoadXML);

xmlLoader.load (new URLRequest("XML/main.xml"));

function LoadXML(e:Event):void {}
xmlData = new XML (e.target.data);
ParseCategories (xmlData);
}

PARSE XML
function ParseCategories(projectInput:XML):void {}
This. Title.Text = projectInput.category.project[0].@name;
projectPath = "projects / ' + projectInput.category[0].@path + ' / ';.
trace (projectPath);

}

LOAD THE TEXT FILE

homeText.addEventListener (Event.COMPLETE, onLoaded);
homeText.load (new URLRequest (projectPath + "/ text.txt"));

function onLoaded(e:Event):void {}
this.homeTxt.text = e.target.data;
}

IMAGES LOAD - LOAD FROM XML MULTIPLE IMAGES - COMPLETE

sprContainer1 = new Sprite();
homeImg.addChild (slideLoader);
slideLoader.load (new URLRequest (projectPath + "/ image2.jpg")); < < CURENTLY LOADING AN IMAGE

The above code shows how to load an XML file that contains the path to the text and image files, I am able to trace the path correctly in the service of ANALYSIS above, but I'm not able to recover the variable (or he also traces) in the TEXT section of the LOAD, please help.

As I continue to code, I would also like to dynamically load images multiples (in the section LOAD IMAGES) using the projectPath and iterate through each image appearing in an XML file. I'm still not at this time, but my question is how to create a preloader/progressbar that overall progress is displayed for all URL requests (the text file and several images contained in the XML file). Thank you immensely.

:

Stop();
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
var homeText:URLLoader = new URLLoader();
var slideLoader:Loader = new Loader();
var sprContainer1:Sprite;
var projectPath:String;

LOADING XML

xmlLoader.addEventListener (Event.COMPLETE, LoadXML);
 
xmlLoader.load (new URLRequest("XML/main.xml"));
 
function LoadXML(e:Event):void {}
xmlData = new XML (e.target.data);
ParseCategories (xmlData);
}

PARSE XML
function ParseCategories(projectInput:XML):void {}
This. Title.Text = projectInput.category.project[0].@name;
projectPath = "projects / ' + projectInput.category[0].@path + ' / ';.
trace (ProjectPath);

useProjectPathF();

}

LOAD THE TEXT FILE

function useProjectPathF() {}

homeText.addEventListener (Event.COMPLETE, onLoaded);
homeText.load (new URLRequest (projectPath + "/ text.txt"));

}

function onLoaded(e:Event):void {}
this.homeTxt.text = e.target.data;
}

IMAGES LOAD - LOAD FROM XML MULTIPLE IMAGES - COMPLETE

sprContainer1 = new Sprite();
homeImg.addChild (slideLoader);
slideLoader.load (new URLRequest (projectPath + "/ image2.jpg"));

Tags: Adobe Animate

Similar Questions

  • Have problems and questions with Time Capsule were addressed in any significant way. Reluctant to buy according to your comments.

    Have problems and questions with Time Capsule was dealt with in a meaningful way? Reluctant to buy according to your comments.

    Apple did not have any material changes to the time Capsule to nearly 3 years. The only change that has occurred in the last 18 months or so is a firmware update to address security issues.

  • Simple variable problem

    It is a really simple problem and I'll probably be a little dim but as I do not code things very often simple things tends to leave my brain.

    Summed up quite simply I have an if statement which, instead of using the current value of a variable appears to be implemented.

    More detailed description:

    I have 2 symbols, 'Olive', which is a three marked positions timeline animation, ' open, 'enabled' and 'closed' who defined the value of the variable 'positionO' as a result. I tested this little with alerts and is very well.

    When I mouse over the second symbol I want to retrieve the variable and play different parts of the animation depending on its value, well?

    I have this piece of code on the mouseover element:

    var myVariable = sym.getComposition().getStage().getSymbol("Olive").getVariable("positionO");
    if (positionO = 'open'){
    alert (positionO);
    }
    

    Now to me, this should trigger the alert if the variable is set to 'open' and do nothing if the value is something else, but what he is doing is setting the variable 'open' and shooting alert anyway.

    Thanks in advance,

    Alex.

    Try this (equal) 2 for comparison:

    if (positionO is 'open') {alert (positionO) ;}

  • Memory problems and questions related to the process

    Does this look just for you, because the modified memory does little until after I had computer problems and had to do a factory reset

    The operating system is Windows 7 64-bit edition SP1

    I disabled SuperFetch is told by the way, if this help anyone on this issue.

    Resource monitor

    Windows process

    Services

    Performance

    Hello

    When your computer doesn't have enough memory for all the actions it is trying to perform, Windows and your programs can stop working. To help prevent information loss, Windows will inform you when your computer is low on memory. You can also learn to recognize the signs of low memory and take measures to prevent the problem. Insufficient memory problems occur when your computer is running out of RAM and becomes virtual memory. This can happen when you run more programs that the RAM memory installed on the computer is designed to support. Low-memory problems can also occur when a program free up memory that it needs more. This problem is called memory overuse or a memory leak.

    You can consult the following Microsoft articles and check if it helps.

    Diagnosing memory problems on your computer

    http://Windows.Microsoft.com/en-AU/Windows7/diagnosing-memory-problems-on-your-computer

    Prevention of problems of memory

    http://Windows.Microsoft.com/en-AU/Windows/preventing-low-memory-problems#1TC=Windows-7

    You may receive an "Out of Memory" error message because of the limitation of in Windows Vista or Windows 7 desktop heap

    http://support.Microsoft.com/kb/947246

    Note: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base: http://windows.microsoft.com/en-US/windows7/Back-up-the-registry

    I hope this helps.

    Please post back with the State of the question and we will be happy to help you further.

  • Problem and question version of LabVIEW

    Hello world

    I want to install Labview 2012, I have Labview 2011 now and all of my programs, built in 2011, don't you think it is a problem when I install Labview 2012? all my programs are ex file. (I have licnese labview).

    I have another question regarding Ex file, I'm using PXie4330, 4353 and 6363, is possible to generate the executable file for them? as they run into the target?

    Thank you

    Hello

    As crossrulz said, you can install LabVIEW versions side by side. View 2011 and 2012 with is no problem (I have 2010, 2011 and 2012 all on the same machine). You mentioned that your programs are PMExport. I assume you mean that you have LabVIEW executable (.exe) written in LabVIEW 2011?

    Executables do not require the development environment to run, but they do not require LabVIEW runtime engine. For executables built in LabVIEW 2011, you will need the runtime LabVIEW 2011 (or the 2011 SP1 one). For screw written in 2011, you can open directly into the development environment 2012 and run them. Note that if you save the they will be now 2012 screws and Save for the previous Version , you will need to reopen them in 2011.

    Hope that helps,

    Jeff P

    Product Support Engineer

    LabVIEW R & D

    National Instruments

  • Some problems and questions about StorE TV

    Hello! I bought stor.e tv a week ago and there are a number of issues, in order of personal importance:

    1. it slows down audio playback. It happens when the standard reading mp.3s on my stereo via the analog output - my music sounds weird, slow and with a reduced frequency. I have to go back change, the exit HDMI (normal speed part, no problem), then change new analog, navigate through folders to find the song I want to play and replay - voila, it works normally. Altogether in a complex way to play a song correctly, you do not?
    2. when there are ID tags (especially album covers) to the songs it takes forever to go from one song to the next.
    3 audio settings are often forgotten after the device has been stopped normally remote control only - you turn it on again and is not how I left it, but back to HDMI. So, I recall at any time check the settings before playing a song? Even if, in a tortuous path, that ^ s have useful to the problem of the mind 1.
    4. do not display correctly Cyrillic subtitles.
    5 pretty hot.
    There are other things, too (no playlists, not slow, slow to develop, etc.). I'm actually writing than just before you go back to the shop and ask for my money back.

    Bravo, guys!

    Hello

    > 4. Does not display correctly Cyrillic subtitles.
    Yes, has been mentioned in other threads seems that not all the subtitles are supported.
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?threadID=51945

    With regard to other issues.
    I think that you should try to reset the store default TV E again and should check how it works.
    In many cases, it helps to solve these annoying problems.

    Welcome them

  • Example of simple background thread and question - please help

    I have finally updated a list via a web services call field without blocking the loading of a screen.

    I want to the loading screen, put a "Please wait" in a field, and then replace the listfield by the vector of calling web services.

    I wrote the simple example below just to see if I have the basics, and I guess that I don't have.

    My label never changes to 'done '.

    I'm sure it's something Liberty fabrics I have left.

    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.container.MainScreen;
    
    public class HomeScreen extends MainScreen
    {
        LabelField lf;
        private Runnable runnable;
    
        public HomeScreen()
        {
            lf = new LabelField("Begin");
    
            runnable = new Runnable() {
                public void run()
                {
                    lf.setText(test());
                }
            };
    
            this.add(lf);
            UiApplication.getApplication().invokeLater(runnable);
        }
    
        String test()
        {
            try {
                UiApplication.getUiApplication().wait(1000);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return "Finished";
        }
    }
    

    No, an executable is retired after his execution.

  • Simple Variable question...

    Hello guys, I came across a strange problem and do not know if I have missed something. I created a simple code below for my AC, but it gave me an error that says

    Access of undefined property 'test '. I know it's maybe just, but I can not find the answer at this time. I appreciate if anyone here can help me...

    Thank you!

    < fx:Script >

    <! [CDATA]

    private var test: number;   declare the variable to test

    test = 25;  Give it the value

    ]]>

    < / fx:Script >

    You can initialize and judge at the same time (private var test: N = 25), but you can't just have a floating expression like that in the Script block. You can also assign a value inside a function (e.g. private var test: Number; function init (): void {test = 25 ;}), if you won't call from a location (for example, as a Manager for your component of creationComplete event).

  • Dear Sir I have toshiba l300 notebook now, I had some problems at the start that a time window is error and posted massage window stopped work go on line chek problem and restart when I restart then run ok that's my question ok

    Dear Sir I have toshiba l300 notebook now, I had some problems at the start that a time window is error and posted massage window stopped work go on line chek problem and restart when I restart then run ok that's my question ok

    Hello

    display the appropriate error message.

    the error codes?

    Try the clean boot procedure to find the application or program causing the problem.

    http://support.Microsoft.com/kb/929135

    all the best!

    Addison

  • can you please help I am running windows vista Home premium and letters on the keyboard are in french is my question mark key e, what is the problem and how to fix it thanks Dan

    can you please help I am running windows vista Home premium and letters on the keyboard are in french is my question mark key e, what is the problem and how to fix it thanks Dan

    Your keyboard is set to french. To resolve this problem, look at the right hand of the bar at the bottom and you will see a keyboard. Click on it and press U.S..
    I hope this helps.

  • I want to ask a question about my mobile mouse memory. I googled my problem and arrived at a forum. He has not answered my question, so I want to ask a question, but I couldn't find how to ask.

    I want to ask a question about my mobile mouse memory.  I googled my problem and arrived at a forum.  He has not answered my question, so I want to ask a question, but I couldn't find how to ask.

    You can ask your question here.

  • Simple form (text input variables problem) GET

    I'm trying to move some info to flash to another page, it should be very simple.

    All I have is an input text field and a button, the input text has the instance name search_txt

    I have this code on the button

    on (click) {;}
    searchText = search_txt
    searchON = 'OK '.
    getURL ("search.php", "_self", "GET");
    }

    the searchON is just a variable I need for the php - and that works very well
    but for searchText I get searchText = undefined

    so I think I should do something as defined as a variable, where and how do I do this?

    what I'm after is search.php? searchText = everything that was in the text entry field& theRestOfTheStuff

    Thanks for any help

    You shouldn't have VARs with the same name as an instances of the object, guess that's the reason for the strange things in your last post.
    I deleted the var assigned to the textfield and allows
    searchText = _root.search_txt.text;
    He gets the text in the TextField. You can check this with a trace:

    on {(click)
    trace (_root.search_txt. (Text);
    searchText = _root.search_txt.text;
    searchON = 'OK '.
    getURL ("search.php", "_self", "GET");
    }

    However, he has not opened a new site during the test... Another reason why I never use components, their just strange behavior too often. I recommend using the standard buttons or MCs with the onRelease event, if you do not need special visual style that provide the components button.

    see you soon,
    blemmo

  • the application has encountered a problem and needs to close

    I build the LV, a request using the tabs, the FPGA dll and DLLs that communicate with devices CAN, GPIB, and PCI.

    The apears program to work properly, but sometimes and I can't see the patern, it crashes with the error "the application has encountered a problem and needs to close...". »

    Sometimes the error apears when I'm trying to exit the program, other times it hangs before that.

    I can't find the error because the program can work well for several hours and then crash or it hangs after 5 minutes of work with it.

    Clues about what goes wrong?

    Kind regards

    Daniel Coelho

    I'm still going through the example, but since the error ocours sporadicaly this could take some time to identify the error.

    I was browsing the code and I was wondering about simple things, like:

    -J' have many local variables, could it be the cause protected by some kind of error?

    -Since I use dll on my code, is there a way to make sure that all DLLs are loaded and unloaded properly?

    My program has a TAB with a simple UI of TestStand and when I change the tabs I close the user interface for teststand. When I use this UI I have load and unload DLLs of same that I use on other tabs, i. e., when you use the UI I load all DLLs that communicate with devices and when I change the tabs I unload all DLLs because on each separate TAB I can control these indicidually devices.

    It's a little hard to explain, but I think I managed

    Is there a grain of truth on my questions? If so, what could I do?

  • Satellite SM30-604: 4.25 SpeedFan and question about the right temperature?

    SpeedFan 4.25 is on my Toshiba Satellite SM30 604.
    Until recently, the CPU usage shown was variable.
    Compared to a low percentage (green dots) to somewhere around maximum, according to what I was doing (I have never game, but use purely professional things like Word, Excel, PowerPoint and many websites).

    Temperatures in most of the green time, the high 40-links, the low 50-links (I then scroll to the top of the Speed01 of the fan from 0 to 50% and 50%, it starts to run). I sometimes add an external fan, I work sometimes in very hot climates).
    I have the readings of the time 4.
    Local temperature: 49 c (with this temp color varies between a Green V and a red arrow pointing upwards).
    Temp distance: 85 (with a flame)
    HC0: 26 c (with a green (V)
    Temp1: 86 (with a red flame).

    WHAT ARE THE TEMPERATURES IMPORTANT? WHAT IS LOCAL TIME? TEMP DISTANCE AND TEMP1?

    These very high temperatures, I've had for a day. The fan is working (I hear it, I can feel. "I can see, because I partly dismantled the laptop.) But the Speed01 is 0%, and there is no reaction on the adjustment upward. Or playback is 100% without reaction to setting down. And rotating or disable "auto fan speed has no effect.
    And without any other program running, the CPU usage increased a few seconds after switching on to 100%. I do not notice a significant slow down in the speed of my applications when I start using them. And a virus today scan did not reveal all the important things.
    I can't activate my taskbar more.

    Who has some answers for me. Green in this area?

    Thank you

    Hello Han

    Your ad is very nice and very interesting, but you'll be very happy if someone can explain all this because you are using a non-Toshiba software. It is always recommended to use the original software because software Toshiba designed has been tested and it can just to protect the hardware components.

    Use of software from third party is always at your own risk, and if you have any problems or questions, please contact their own support. They have much more experience with your applications.

    I can just tell you that you should be careful where your laptop is placed and make sure that the device can take a deep breath and cool down properly.

    Good luck!

  • High Score Table: writing a Simple with Flash and PHP text file

    I'm having a problem getting Flash to work with PHP that I need Flash to read and write to a text file on a server to store data simple name partition for a games Hi score table. I can read the text file in Flash fairly easily, but I also have to write to the file when a new high score is reached, so I need to use PHP to do that. Can I send data from flash to php by POST file, but so far it does not. The PHP file is confirmed that the work that I added an echo in the file that displays a message to verify that the server is running PHP - files were also uploaded to a remote server so I could test them correctly. Flash code is as follows:

    FileWriter php

    var myLV = new LoadVars();

    sendData() {} function

    //sets variable 'hsdata' to send to php

    myLV.hsdata = myText;

    myLV.send ("hiscores.php");

    }

    I believe that it sends the variable "myText" in the php file in a variable called 'hsdata' I want the php file to write to a text file. The mytext variable is just a long chain that has all of the partitions and the names in the scores. OK, XML would be best way to do it, but for the speed, I want to just get the basic features of work, so store a shot of simple text is sufficient for now. The PHP code that reads the Flash variable "hsdata" and wrote for the "scores.txt" text file is due to:

    <? PHP

    sets the variable to the data posted from flash

    $flashdata = $_POST ['hsdata'];

    File Manager opens the file and clears all content with arg w

    $fh = fopen ("scores.txt", "w");

    Adds data to the file

    fwrite ($fh, $flashdata);

    closes the file

    fclose ($fh);

    echo "php file works;

    ? >

    Any help with this would be greatly appreciated - once I get php to write text files simple I should be ok. Thank you.

    var outLV = new LoadVars();

    var inLV = new LoadVars();

    sendData() {} function

    outLV.hsdata = 'Hello from Flash';

    outLV.sendAndLoad ("http://www.mysite.com/hiscores/test23.php", inLV,"POST");

    }

    inLV.onLoad = {function (success)}

    If (success) {}

    sets the dynamic text box to show the variable sent by php

    statusTxt.text = this.phpmess;

    } else {}

    statusTxt.text = 'No Data Received';

    }

    };

    It works well and function of inLV.onLoad of the reports it receives data, but does not display the variable received from PHP. The PHP file is like this:

    <>

    $mytxt = $_POST ['hsdata'];

    $myfile = "test23.txt";

    $fh = fopen ($myfile, 'w');

    Adds data to the file

    fwrite ($fh, $mytxt);

    closes the file

    fclose ($fh);

    $mess = "Hello there php ';

    echo "phpmess =". "." $mess;

    ?>

Maybe you are looking for

  • Firefox, asking to update Java and Java saying is already updated see full explanation below.

    1 I noticed Firefox telling that Java Deployment Toolkit script library 7.0.510.13NPRuntime plugin Java (TM) deploy vulnerable update now Java (TM) Platform SE 7 U51Next generation Java plug-in 10.51.2 for Mozilla browsers 2. I tried to update. Recei

  • 10 Firefox does not prompt for passwords recording

    Even if the Save password option is checked, and I'm not in private browsing mode prompt "pop-up" to save passwords doesn't seem anymore. Some sites do not allow this function, however, it does not appear on all sites (sites that work with a 10 Firef

  • start screen for Windows 10

    I'm on Windows 10. When I click on the Windows box in the lower left of my laptop, nothing happens. He used to show me the square, e.g.: weather, shopping, games and tons of others. ow I get nothing. Sorry, but I'm not very computer. Thank you

  • Signature in Mail will not work

    I have a copy of my signature in my email but I can't see on my emails. What could be my problem?

  • 2000-2106TU HP: startup problem

    Hello When I turn on my laptop, my laptop takes longer than usual to enter the word of welcome. The symbol for windows is here for a long time that flashes for three or four times and then sinks into the welcome note. What is the solution for this? S