Load variables from XML into Flash

I was wondering how to load variables from an XML document to
a Flash file? I am familiar with the code to do it for a text file,
but was wondering how to do it for XML.
Many thanks in advance!
JJ

Thanks for the recommendation on the site. What I am trying
to do is load varaibles from an XML file into text boxes in my
flash movie.
Here is my loading:
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success){
if (success) {
gotoAndStop("slide01");
my_xml.load("narration.xml");
this is what I have on my frame with the text boxes (the text
boxes are also have the variable name in the variable area)
var narration = my_xml.picture01;
var my_title = my_xml.my_title;
var my_date = my_xml.my_date;
should I do my_date.text = my_xml.my_date; instead?
my xml doc looks like this
<?xml version="1.0" encoding="iso-8859-1"?>
<picture01>This is the text for picture
01</picture01>
<picture02>This is the text for picture
02</picture02>
<my_title>Las Vegas</my_title>
<my_date>October</my_date>
Any help on this would be GREATLY appreciated!
Text
my_date.text = my_xml.my_date;

Similar Messages

  • Loading Variables from ASP into Flash

    I can find plenty of tutorials detailing how to load
    variables from a defined asp page into Flash, but here's my
    dilemma...
    I have an asp page that is reading a URL with a unique
    identifier in it (www.sampleURL.com?id=123456), and then turns the
    id number from the URL into a variable. On the same page then, sits
    my swf where I need to use LoadVars to pull in that ASP variable
    via Actionscript. If I don't have a static asp page to pull the
    variables in from and I want to pass the variable within the same
    asp page the swf is located on, how do I do it? Many thanks in
    advance...

    "bonzomn65" <[email protected]> wrote in
    message
    news:ej0630$pjh$[email protected]..
    >I can find plenty of tutorials detailing how to load
    variables from a
    >defined
    > asp page into Flash, but here's my dilemma...
    >
    > I have an asp page that is reading a URL with a unique
    identifier in it
    > (www.sampleURL.com?id=123456), and then turns the id
    number from the URL
    > into a
    > variable. On the same page then, sits my swf where I
    need to use LoadVars
    > to
    > pull in that ASP variable via Actionscript. If I don't
    have a static asp
    > page
    > to pull the variables in from and I want to pass the
    variable within the
    > same
    > asp page the swf is located on, how do I do it? Many
    thanks in advance...
    >
    You don't need LoadVars for this at all. You can just pass
    the variable to
    your Flash movie by specifying a query string when you are
    calling the
    movie.
    If you are using the straight object, embed method then it
    would look
    something like this:
    <param name="movie" value="movie.swf?id=11111">
    <embed src="movie.swf?id=11111" ... >
    If you are using the ActiveContent JavaScript for your movie
    then you just
    leave off the .swf... so
    "name", "movie?id=11111"
    Then, in flash you can access the value of id from the _root,
    like
    var idInFlash:Number = _root.id;
    Of course in the above example you would replace 11111 with
    the proper
    syntax for printing a variable's value in ASP.

  • Passing variable from php into flash, help please

    Here are what I'm having:
    <?PHP
    $testVal = "This is a test";
    $test = urlencode($testVal);
    $out = "test=". $testVal;
    echo $out;
    ?>
    // and this is my flash file
    function getData() {
    // Prepare request
    var urlReq:URLRequest=new URLRequest("http://localhost/test.php");
    urlReq.method=URLRequestMethod.GET;
    var loader:URLLoader = new URLLoader();
    loader.dataFormat=URLLoaderDataFormat.VARIABLES;
    loader.addEventListener(Event.COMPLETE, completeHandler);
    loader.load(urlReq);
    function completeHandler(evt:Event) {
    var vars:URLVariables = URLVariables(evt.target.data);
    trace(" TEST = ", vars.test);
    trace(" TEST = ", unescape(vars.toString()));
    // and below is the ouput
    TEST = undefined
    TEST = test=This is a test
    I've tried with several different ways to get ONLY the value of the variable - that means I only want to have "This is a test" returned, but I either got "undefined" or the whole thing "test=This is a test", instead.
    I'm new to Flash and PHP. Please help.
    Thanks

    There's no need to write any fake variables out, Flash does not need that. OK, here's a simple PHP script like yours - I called it test.php
    <?PHP
         $testVal = "This is a test";
         $out = "test=". $testVal;
         echo $out;
    ?>
    And the AS to call it:
    var myLoader:URLLoader = new URLLoader();
    myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    myLoader.load(new URLRequest("http://www.mydomain.com/test.php"));
    myLoader.addEventListener(Event.COMPLETE, dataLoaded, false, 0, true);
    function dataLoaded(e:Event){  
        trace( e.target.data.test);
    You will see 'This is a test' traced to the output window.
    HTH

  • Flash does not load information from xml on DMM system

    I have flash file load information from xml file. flash file and xml file i push on IIS server. In presentation i add URL of flash file but flash file not show information.
    I try run URL direct from DMP is ok.
    Flash file write for Flash litte 3.1 and use action script 2.0. DMS system test with DMM version is 5.3 and DMP 4310G.
    Please point where the error and the notes on  flash file use with DMM for my programmer.
    Thanks!

    Hi guy's
    I think I maybe faced with a similar issue.
    I've been working on a flash build that pulls in xml feeds. Everything I have works great so far but I've only been able to test as standalone(Desktop) and in the browser.
    When I tested standalone(Desktop) I did get the flash security popup but once I granted access it worked fine.
    I've never used DMP 4310 before. At this point in time I dont have access to it either. All I know is that my swf will be put on it.
    Can anyone tell me how the DMP 4310 will handle the flash security popup?

  • Error editing task sequence: Failed to load dynamic properties for class "SMS_TaskSequence_ApplyWindowsSettingsAction" From XML into WMI

    I've started getting an intermittent error editing my Windows 7 OSD task sequence.  Sometimes I can open the TS to edit, but when I try to apply changes I get the error.  Other times I get the error when trying to open the TS.  If I try again
    right away, I still get the error, but if I wait a few minutes and try again sometimes it will open the TS. 
    The error reads:
    ConfigMgr Error Object:instance of SMS_Extended Status{Description = "Failed to load dynamic properties for class \"SMS_TaskSequence_ApplyWindowsSettingsAction\" from XML into WMI";Error Code = 2147943746;File = "e:\\qfe\\nts\\sms\\siteserver\\sdk_provider\\smsprov\\ssptspackage.cpp";Line = 3454;Operation = "ExecMethod";ParameterInfo = "SMS_TaskSequencePackage";ProviderName = "WinMgmt";StatusCode = 2147749889;}
    Coinciding with this error, I show the following entries in the TaskSequenceProvider.log file: 
    [PID: 7608] Invoking method SMS_TaskSequence.LoadFromXml
    TaskSequenceProvider
    Failed to protect memory buffer, hr=0x80070542
    TaskSequenceProvider
    Failed to load dynamic properties for class "SMS_TaskSequence_ApplyWindowsSettingsAction" from XML into WMI 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load node Apply Windows Settings from XML into WMI 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load children steps for node "PostInstall" from XML 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load children steps for node "Execute Task Sequence" from XML 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load children steps for node "" from XML 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load XML for the task sequence into WMI 0x80070542 (2147943746)
    TaskSequenceProvider
    [PID: 7608] Done with method SMS_TaskSequence.LoadFromXml
    TaskSequenceProvider
    Setting status complete:  status code = 0x80070542; Failed to load dynamic properties for class "SMS_TaskSequence_ApplyWindowsSettingsAction" from XML into WMI
    TaskSequenceProvider
    I exported the task sequence and checked in "object.xml" for the "ApplyWindowsSettingsAction", to see if there was something odd in the xml, but I don't find anything that jumps out as being wrong.  Here's the section of XML for
    that step.  I've removed identifying info, and replaced it with a generic term in bold.
    <step type="SMS_TaskSequence_ApplyWindowsSettingsAction" name="Apply Windows Settings" description="" runIn="WinPE" successCodeList="0" runFromNet="false"><action>osdwinsettings.exe /config</action><defaultVarList><variable name="OSDLocalAdminPassword" property="AdminPassword"></variable><variable name="OSDComputerName" property="ComputerName">%_SMSTSMachineName%</variable><variable name="OSDProductKey" property="ProductKey"></variable><variable name="OSDRandomAdminPassword" property="RandomAdminPassword">false</variable><variable name="OSDRegisteredOrgName" property="RegisteredOrgName">COMPANY NAME</variable><variable name="OSDRegisteredUserName" property="RegisteredUserName">COMPANY NAME</variable><variable name="OSDServerLicenseConnectionLimit" property="ServerLicenseConnectionLimit">5</variable><variable name="OSDTimeZone" property="TimeZone">Central Standard Time</variable></defaultVarList></step><step type="SMS_TaskSequence_ApplyNetworkSettingsAction" name="Apply Network Settings" description="" runIn="WinPEandFullOS" successCodeList="0" runFromNet="false"><action>osdnetsettings.exe configure</action><defaultVarList><variable name="OSDDomainName" property="DomainName">DOMAIN.COM</variable><variable name="OSDJoinPassword" property="DomainPassword"></variable><variable name="OSDJoinAccount" property="DomainUsername">DOMAIN ACCOUNT</variable><variable name="OSDEnableTCPIPFiltering" property="EnableTCPIPFiltering" hidden="true">false</variable><variable name="OSDNetworkJoinType" property="NetworkJoinType">0</variable><variable name="OSDAdapterCount" property="NumAdapters" hidden="true">0</variable></defaultVarList></step>
    Is there any other log I should check for a clue on this issue?  What could be causing this error?

    Thanks for sharing that!  I tend to save contacting MS support until after I've exhausted other options.  I'm always afraid that I'll spend the $500 to open a case and then it turns out to be something simple that I would have found if I had just
    kept working on it myself a little longer.
    It looks like that link is for an update released in February as KB3023562.  I downloaded and installed it. I'll try opening/editing/saving the task sequence a few times today to see if the issue is resolved.  
    After I had already installed it, I thought to look up that update in configmgr.  The update is listed as superseded by 2 other updates.  The newest of those is KB3046049, which just installed last night with the other March patches, so it's possible
    that I didn't need to install KB3023562 after all.  

  • Load data from XML files into BI

    Hi All,
    Can any one guide me through the steps which involve in loading data from XML files into BI?
    Thanks
    Santosh

    Hi James,
    I have followed upto step No: 12 .
    Please could you let me know how to link the XML file on my local drive to BI,
    I am not able to find figure out where to specify the path of the XML file to be loaded into BI.
    Thanks In Advance
    Regards,
    San
    1. Create a Infosource(ZIS), with transfer structure in accordance with the structure in the XML file. (You can open the XML file with MS Excel.This way you can get to know the structure).
    2. Activate the transfer rules.
    3. After activation ;from the Menu Bar , Select Extras>Create BW Datasource with SOAP connection.
    4.Now Activate the Infosurce again, this creates an XML based Datasource(6AXXX...)
    5.These steps would create two sub nodes under the Infosource(ZIS).
    6.Select Myself system and create a data package and execute it run in Init mode(without Data Transfer).
    7. This would create an entry in RSA7(BW delta Queue)
    8. Again create another Delta Infopackage under it, and run it. Now the Datasource(6AXXXXXX..) would turn green in RSA7.
    9.In Function builder(SE37) select your FM( do a search ,F4, on the datasource 6AXXX....) .
    10.Inside this RFC based FM , from the Menu Bar select Utilities>more Utilities>Create Web services>From Function module.
    11.A wizard will guide you through the next steps .
    12.once this is done a Web serrvice would be enabled in WSADMIN. Select your FM and execute it.
    13.From here you can upload the data from XML file into BW delta queue.
    Edited by: Santosh on Nov 30, 2008 2:22 PM

  • Movie refuses to load variables from text file

    Hi,
    I'm sure you can solve my newbie problem in less than 1
    minute...
    I'm pulling my hair out on a template I bought 2 days ago
    from templatemonster.com
    I am using Flash 8 Pro.
    All I want to do is change an existing textfield that is
    Static to Dynamic and load variables from a text file.
    The Action Script I use to do so comes directly from
    Macromedia documentation (see attached)
    It works fine when I create a brand new movie, but doesn't do
    anything when inserted into the template.
    It doesn't even complain about not finding the text file if I
    rename or delete it!
    Here are the FLA and text file:
    Edit : Link to source file removed
    The textfield I would like to change is in the txt2 symbol.
    Here is how I proceed:
    When I open HEADER.FLA, Flash tells me I'm missing a font,
    ok, so I click on Use Default, I'll deal with this later.
    I open up the Movie Explorer, go to Layer 30, go to Frame 75
    and click once on txt2
    I name the instance "myMovie_mc" and save (converts from
    Flash MX to Flash 8)
    I double-click on the Movie Clip, select the word
    "Automobile" on the Stage, change from Static to Dynamic and call
    that instance "myText_txt"
    Still in the Movie Clip, I create a new layer I call
    "actions", and in Frame 1 I copy the attached Action Script:
    This script works when I create a new flash file, but it does
    absolutely nothing in this template.
    I know I'm doing something wrong, but I wonder what?
    Many thanks to any helping soul!
    Ferris.

    try this:
    // Load text as variable and assign it to the
    // dynamic text field
    var features_lv:LoadVars = new LoadVars();
    features_lv.onLoad = onText();
    features_lv.load("safetyFeatures.txt");
    function onText(success:Boolean) {
    if (success) {
    myText_txt.text = features_lv.safetyfeatures;
    } else {
    myText_txt.text = "unable to load text file.";
    or this
    // Load text as variable and assign it to the
    // dynamic text field
    var features_lv:LoadVars = new LoadVars();
    features_lv.onLoad = function(success) {
    if (success) {
    myText_txt.text = features_lv.safetyfeatures;
    } else {
    myText_txt.text = "unable to load text file.";
    features_lv.load("safetyFeatures.txt");

  • Problem in load data from XML in Flex 4

    Hi Everyone,
    I tried all the possible ways which ever i know to load the data from XML to Flash Builder (Flex 4). Actually i want to load the data from XML to Datagrid. The project is executed without any error and warnings but the data is not loaded into datagrid. i will paste the coding below if anyone know the solution please let me know. Waiting for reply.
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="userRequest.send(); ">
    <fx:Declarations>
         <s:HTTPService id="userRequest" url="xdata.xml" useProxy="false" resultFormat="e4x" />
    </fx:Declarations>
    <mx:DataGrid id="dgUserRequest" x="20" y="160" dataProvider="{userRequest.lastResult.user}" >
         <mx:columns>
              <mx:DataGridColumn headerText="User ID" dataField="id"/>
              <mx:DataGridColumn headerText="User Name" dataField="name"/>
         </mx:columns>
    </mx:DataGrid> 
    </s:Application>

    It is better to add result handler to the HttpService and debug to see the actual structure of the xml.

  • How to load variables from a .txt file

    Hi.
    I usually make a flash aplication in colaboration with a php
    programmer. But i want to test my swfs without having to wait for
    him. So i want to do that through a text file. I know that flash
    can load variables from text files. The problem is i don't know how
    to format the text file ( example.txt).
    Thank you

    Here's a couple of ideas.
    First you probably want to change what you have...and put
    your 'if (pVar==1' etc inside a separate function and call it from
    the onLoad handler after you have assigned the value to pVar...
    because the onLoad will run at some unknown point in time after
    loading has finished (actually in the test environment this might
    work... but that wouldn't be the same as what happens in a
    production setting).
    To create test files for loadvars... simply create a new as2
    file and put this code on the first frame and test movie:

  • Read variables from XML

    Is it somehow possible to read variables and values from xml into an PowerShell script without specifying each of them separately?
    For example I've set the following variables:
    $arrPostcode @()
    $arrPostcode += ,@('1234AB', 'City1')
    $arrPostcode += ,@('4567CD', 'City2')
    $blnHome =$True
    $blnNld =$False
    $intNumbers =556
    $strText ='Something'
    And I have a xml file like (can be ajusted when required to get a better result):<?xml version="1.0"?>
    <Objects>
    <Object Type="System.Management.Automation.PSVariable">
    <Property Name="Name" Type="System.String">arrPostcode</Property>
    <Property Name="Value" Type="System.Object[]">
    <Property Type="System.Object[]">
    <Property Type="System.String">9874ZX</Property>
    <Property Type="System.String">City5</Property>
    </Property>
    <Property Type="System.Object[]">
    <Property Type="System.String">6541UH</Property>
    <Property Type="System.String">City3</Property>
    </Property>
    </Property>
    <Property Name="ModuleName" Type="System.String" />
    </Object>
    <Object Type="System.Management.Automation.PSVariable">
    <Property Name="Name" Type="System.String">blnHome</Property>
    <Property Name="Value" Type="System.Boolean">False</Property>
    </Object>
    <Object Type="System.Management.Automation.PSVariable">
    <Property Name="Name" Type="System.String">blnNld</Property>
    <Property Name="Value" Type="System.Boolean">True</Property>
    </Object>
    <Object Type="System.Management.Automation.PSVariable">
    <Property Name="Name" Type="System.String">intNumbers</Property>
    <Property Name="Value" Type="System.Int32">13</Property>
    </Object>
    <Object Type="System.Management.Automation.PSVariable">
    <Property Name="Name" Type="System.String">strText</Property>
    <Property Name="Value" Type="System.String">World</Property>
    </Object>
    </Objects>And say I want to use the 'default' values if the xml file was not
    found, but if the xml file is found I want to use (replace) the
    variables and values defined in that xml file.

    First of all your sample code I not PowerShell.  Second XML has no "variables".  It is a structured document.  When imported into PowerShell it shows up as an XMLDocument object.  If you want values from the document you have
    to extract them by direct reference or query.
    The simple answer to your question is "yes".  You can assign a default to a variable which will be updated only if the value exist in the document.  The rest cannot be determined from what you have asked.
    Start by learning some of the basics of PowerShell scripting and ask a new question when you can see what it is you want to do.
    Here is a good starting point:
    http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
    The XML you have posted is actually PowerShell object serialization format so it is already a PS object.  It is not just arbitrary XML.  It isnot clear howyou acquired this which is another reason to learn more of the PS basics. 
    It appears that you have used ConvertTo-XML to create an XML object.  This can be sued to dave values and state but may not bethe best method.  Export-CliXml can persist an object and restore it more directly.  We can wrap this in a function
    that can be used to default values.
    Look into Export.CliXml and Import-CliXml.
    Example:
    $ziptable=@()
    $myProps=@{
    Name='Detroit'
    ZipCode='20192'
    $ziptable+=New-Object PsObject -Property $myProps
    $myProps=@{
    Name='New York'
    ZipCode='90100'
    $ziptable+=New-Object PsObject -Property $myProps
    $ziptable | Export-CliXml myzips.clixml
    $savezips = Import-CliXml myzips.clixml
    Result demo:
    PS C:\scripts> $savezips
    ZipCode Name
    20192 Detroit
    90100 New York
    PS C:\scripts> $savezips[0]
    ZipCode Name
    20192 Detroit
    PS C:\scripts> $savezips[0].Zipcode
    20192
    PS C:\scripts>
    Of course a simple lookup table would be done with a pure hash and persisted.  For more comples things I would use a custom dataset which can also be persited and restored the same way.  Sort of a poor man's portable database.
    ¯\_(ツ)_/¯

  • How to speed up the loading of live data into flash file.

    How to speed up the loading of live data into flash file if the swf file size is 1.5 MB. Flash file is using 20 web service connections to load the live data.

    Hello,
    I am also facing a similar problem wherein the SWF file takes time to load the refreshed data in Infoview i.e. after exporting the xlf file to Business Objects platform. Currently I am using Xcelcius Engage/Enterprise 2008 SP3 Windows (file name: 51038212.ZIP) version 5.3.0.0 build number 12,3,0,670. Also the SWF file is approximately 2MB in size  and it uses 42 live office connections.
    Please suggest solution as to how to decrease the time it takes to refresh the live office connections.

  • Need help in automating text from xml into illustrator

    I have seen some examples of automation script for filling text from xml into illustrator, need some help in this matter.
    Need script (currently working in mac OS)

    Firefox doesn't do email, it's a web browser.
    If you are using Firefox to access your mail, you are using "web-mail". You need to seek support from your service provider or a forum for that service.
    If your problem is with Mozilla Thunderbird, see this forum for support.
    [http://www.mozillamessaging.com/en-US/support/] <br />
    or this one <br />
    [http://forums.mozillazine.org/viewforum.php?f=39]

  • How to load data from Quikbooks into PeopleSoft General Ledger module ?

    Folks,
    Hello.
    My client's data is currently stored in Quikbooks.
    After install PeopleSoft FSCM 9.0, I need to load the data from Quickbooks into PeopleSoft General Ledger module. But I don't know how to use PeopleSoft Integration Broker to integrate with Quikbooks.
    Can any folks tell me how to load data from Quikbooks into PeopleSoft General Ledger module ?

    Hi,
    If the data load is one time process, then you can use PL/SQL or datamover to load the data to PeopleSoft application.
    If you want to load the data in real time, then you need to create In-bound and out-bound nodes to perform the transaction.
    Thanks
    Soundappan

  • Going from Illustrator into Flash

    I tried asking in the Flash forum, though I received no response.
    When copying-and-pasting symbols from Illustrator into Flash CS5:
    1. Does it make a difference if you paste on the main stage in Flash or create
    a new symbol first and paste it there?
    2. After pasting on the stage two separate symbols, I get two separate
    folders called FlashAICB with a subfolder called Illustrator Symbols
    containing my copied symbol. Can I move the two symbols together into
    the same folder? Can I change the name of the FlashAICB folder?
    Will this cause any problems?
    Thanks!

    1)If you copy/paste an object from illustrator to flash as is, it will be an object in flash and certain operations require the object to be a symbol which can be done by hitting F8. This is the same thing as creating a symbol in illustrator first.
    2)Right clicking on the symbols will let you move the symbols to the root or another folder or even a new folder. Think of the folders as organizers.

  • Loading data from XML hosted on a site accepted by Apple?

    I'm about to start working on an App that holds the template and code to build the stuff. It gets its level design, variables and other things from an XML hosted on a website/server. The app will also load pictures from the website/server to be displayed in the app. So, what people download is the "shell". Would Apple allow this app into the app store? Considering I've read how they don't allow external code to be loaded into the app, or is this only limited to code inside external swfs?

    I did search before I posted and read only the threads that seemed to cover what I wanted to know. As replies here are rare I decided to read ALL threads I got from my search and actually found one with the answer, sort of, as he doesn't say if he loads variables, which to me is like code , but I hope Apple will be ok with my app loading external stuff through an external xml aswell, like they were for this guy:
    http://forums.adobe.com/message/3868894#3868894
    * I'm loading xml-data and pictures (like icons for other apps) from an external server into the app, to promote our other apps. Works like a charm and apple had no problem with this.

Maybe you are looking for

  • To show the "My Sharebox" on the homepage of Web UI

    Hi All, I have a requirement to configure the Central Sharing Tool for a client . I have configured it and i can see the SHARE button next to personalize on the homepage of the Sales rep role . But i am not able to find the "MY SHAREBOX" assignment b

  • Importing iWeb site to dreamweaver?

    Is it possible to import my iWeb site to dreamweaver? I want to do this because i find that iWeb is too simplistic and i find the options are limited. To be honest all i want to do is put the website on dreamweaver and fiddle around with the HTML cod

  • Flip4Mac/Quicktime Error

    Hello all, Please see the screenshot below, for some reason I was not able to post the message. Thanks.

  • PDF Reader Component problem

    I am building an application in C#. I was wondering if there is a way to use the component but not allow a user to save the pdf to their local system. Possibly even disabling the toolbar in the component?

  • I cant unlock my iphone  siri

    I cant unlock my screen but siri is on . Why ?