Loading content from XML help needed, please.

Hey All,
So here's my deal- I have a custom-built FLV Playback
component (with captions) and need to load the following items from
an XML file named "xml_doc.xml":
<?xml version="1.0" encoding="UTF-8"?>
<playlist id="Here's The Video" >
<vid desc="Introduction to Biological Terrorism Agents"
src="Intro.flv"
thumb="Intro.jpg"
caption="Intro.xml"
</playlist>
On the stage, here's what things are named:
-my FLVPlayback Component is named myVideo
-my thumbnail/preview image (empty movie clip) is named
myPoster
-my FLVPlaybackCaptioning Component is named captioning
So how do I get these things to all get read from the XML
document? It's easy to do it all through the FLA and hard-code the
paths, but I can't seem to figure out how to pull from the external
XML doc.
Any help would be greatly appreciated.
Joe

You'll need to instantiate a few classes to help with this.
The first is URLRequest:
--var myXMLRequest:URLRequest = new
URLRequest("xml_doc.xml");
The URLRequest gets loaded by a URLLoader:
--var myXMLLoader:URLLoader = new URLLoader();
Then use the .load() method of the URLLoader:
--myXMLLoader.load(myXMLRequest)
Then add an event listener to your URLLoader
--myXMLLoader.addEventListener(Event.COMPLETE, dataLoaded);
Finally create the function to work with your data
--function dataLoaded(e:Event):void {
--var myXML:XML = new XML(e.target.data);
--trace(myXML);
Looks like:
--var myXMLRequest:URLRequest = new
URLRequest("xml_doc.xml");
--var myXMLLoader:URLLoader = new URLLoader();
--myXMLLoader.load(myXMLRequest)
--myXMLLoader.addEventListener(Event.COMPLETE, dataLoaded);
--function dataLoaded(e:Event):void {
--var myXML:XML = new XML(e.target.data);
--trace(myXML);
(remove dashses, they're for readability)

Similar Messages

  • Finder (Snow Leopard 10.6.8) taking long time to load contents of any directory. Please help?

    In my macbook pro 5,2 snow leopard (10.6.8), Finder taking long time to load contents of any directory. Please help?
    I have already tried to spotlight re-indexing but it did not help. I am hardly able to work on it, almost for each directory I browse its keeps on spinning for 1min.

    Download iTunes from Apple's web site and install it.  Don't use Software Update.

  • Help needed please.. how do I remove my credit card from itunes? just discovered over $450 of charges when I looked at my email... Kids had no clue they were using our money and not their gift cards

    Help needed please.... I just discovered over $450 charges to my credit card from Itunes. The kids had no idea they were using our credit card and not their itunes gift cards and 4 year old just clicks on anything! I didnt save my credit card details so am a bit miffed at this... I cant find anywhere in itunes to remove it. Edit.. but not remove. Editing does not remove it.. HELP

    To Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact
    Accepted forms of payment  >  http://support.apple.com/kb/HT5552
    Changing Account Information  >  http://support.apple.com/kb/HT1918

  • I recently had to restore my Iphone 4s and ever since I cannot double click the home button whilst the phone is locked and change my music. The controls come up and I can adjust the volume but I cannot change the songs. Help needed please!!

    I recently had to restore my Iphone 4s and ever since I cannot double click the home button whilst the phone is locked and change my music. The controls come up and I can adjust the volume but I cannot change the songs. Help needed please!!

    Have you guys been able to activate your iphone yet? I bought an iphone 4s from eBay and it worked fine, but the previous user had left some data on it, so last night I used the "erased all content and settings" to restore it to factory setting so I can start fresh and restore my backup. But now I'm stuck at the activation screen (I get the same "the activation server is temporarily unavailable")  and can't get it to activate, even if I use my old deactivated AT&T sim card (I'm on straighttalk now).
    I might try activating it with an active AT&T sim card from my fiancee's phone when she gets home, so I'll let you know how that works outs.
    If it's true that the server is down; anyone know when it will be back up again? Thanks in advance.
    iPhone 4s iOS 5.1.1 (9B206)
    Carrier AT&T 12.0
    Modem Firmware 2.0.12

  • 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

  • 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?

  • Help needed please, with Iphone stuck with apple picture and progress bar after software update attempted

    Help needed please, everytime I try to update the software version on my iphone it comes up with a message saying it could not be completed and is now frozen with the apple picture and progress bar on it. Do I unplug it and hope the macbook pro sees it again, I also stupidly did not back up before starting the download which I realise I will have to go back to the previous back up. This keeps happening, everytime I do this type of update, I'm starting to think I should just give up on updating my software on the Iphone. I thought it was happening because I was using a window based computer to do the updates, this time I used my Macbook Pro. Please somebody help

    ljm17 wrote:
    ...This keeps happening, everytime I do this type of update, I...
    Then you should know what you need to do... If you don't remember...
    See Here  >  http://support.apple.com/kb/HT1808

  • How to parse contents from XML file in Java

    Hi All,
    I have a scenario like this . I have one xml file with key value pairs of ( name , URL ) . I have retrieved contents from XML file , now I want to parse these contents and store in a bean object.
    How to parse Contents of XML file??
    Thanks in advance,
    Rajendra.

    Hi All,
    I have a scenario like this . I have one xml file with key value pairs of ( name , URL ) . I have retrieved contents from XML file , now I want to parse these contents and store in a bean object.
    How to parse Contents of XML file??
    Thanks in advance,
    Rajendra.

  • How do i load content from an existing ipod to a new computer and installation of itunes?

    how do i load content from an existing ipod to a new computer and installation of itunes?

    Recover media from iPod
    See this post from forum regular Zevoneer for options on moving your iPod data back to your computer.
    tt2

  • Need help scrolling dynamic content from XML

    I am trying to make a photo gallery and I have succeed in
    importing the pictures from XML into Flash. There are still two
    problems:
    1. The content is loading into a movieclip and I tried to
    place a scroll pane on the stage to adding scrolling capabilities.
    I set the parameters to control the movieclip that holds the
    thumbnails but it is not making a scroll bar. I can see the
    pictures inside of the scroll pane but it will not scroll to show
    the rest of the pictures.
    2. I can not figure out how to space the thumbnails evenly. I
    made a variable and multiplied the x position of each picture by it
    but there are large differences between landscape and portrait
    pictures.
    Thanks for the help

    You need to switch from using loadMovie to using the
    MovieClipLoader object. This object has a listener called
    "onLoadInit" that allows you to get the size of your photo when it
    comes in, but before it appears on stage, so that you can adjust
    its placement. Check out the help docs for info on usage.
    WL

  • How to create Inbound Idoc from XML file-Need help urgently

    Hi,
    can any one tell how to create inbound Idoc from XML file.
    we have xml file in application server Ex. /usr/INT/SMS/PAYTEXT.xml'  we want to generate inbound idoc from this file.we are successfully able to generate outbound XML file from outbound Idoc by using the XML port. But not able to generate idoc from XML file by using we19 or we16.
    Please let me know the process to trigger inbound Idoc with out using  XI and any other components.
    Thanks in advance
    Dora Reddy

    Hi .. Did either of you get a result on this?
    My question is the same really .. I am testing with WE19 and it seems SAP cannot accept an XML inbound file as standard.
    I see lots of mention of using a Function Module.
    Am I correct in saying therefore that ABAP development is required to create a program to run the FM and process the idoc?
    Or is there something tht can be done with Standard SAP?
    Thanks
    Lee

  • Loading URL from XML?

    I have a movie clip in rectangle shape and need add link to that from XML.
    How can I do that?
    this my code
    AS Code:var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(new URLRequest("linkNewD2.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, displayHTML);
    function displayHTML(e:Event):void {
                    var xmlData:XML = new XML(e.target.data);
                    var tURL:String = xmlData.Header1.option;
                    targetURL(tURL);
    function targetURL(event:String):void
    var valURL:String = event;
    myMc1.addEventListener(MouseEvent.CLICK, gotoHome);
    function gotoHome(evt:MouseEvent):void
                    var myURL:URLRequest = new URLRequest(URL(valURL));
                    navigateToURL(myURL);
    XML Code:
    <data>
    <Header1>
    <option> http://www.google.com </option>
    </Header1>
    </data>
    Please help me!
    Thanks,
    jafy

    First, never use nested functions - they bring in a lot of troubles.
    Try this code (there are better ways but just to follow your initial approach). This code assumes that myMC1 is MovieClip:
    var xmlLoader:URLLoader = new URLLoader();
    // listeners should be added BEFORE load() is called
    xmlLoader.addEventListener(Event.COMPLETE, displayHTML);
    xmlLoader.load(new URLRequest("linkNewD2.xml"));
    function displayHTML(e:Event):void {
         var xmlData:XML = new XML(e.target.data);
         targetURL(xmlData.Header1.option);
    function targetURL(url:String):void
         myMc1.url = url;
         myMc1.addEventListener(MouseEvent.CLICK, gotoHome);
    function gotoHome(e:MouseEvent):void
         navigateToURL(new URLRequest(MovieClip(e.currentTarget).url));

  • Loading settings from xml and applying

    Hi,
    I've got an xml where im writing certain settings of a application. This is what the xml looks like;
    <?xml version="1.0" encoding="UTF-8" ?>
    - <PTMViewProfile>
    - <viewProfile>
      <testSequences />
      <projectName tag="default" />
    - <tsFrames>
      <tsFrame tag="bvcbvc" maximised="true" />
      <tsFrame tag="bvbv" maximised="true" />
      </tsFrames><projectName tag="default" /> - This is the project name
    - <tsFrames> - These are the JInternalFrames (Instance of tsFrames) for that specific project.
    <tsFrame tag="bvcbvc" maximised="true" />
    <tsFrame tag="bvbv" maximised="true" />
    </tsFrames>
    The project is stored in a directory containing all the tsFrames.
    From the xml i have the code to read and write. But, i want to apply those settings so that when the application is reopened it looks at the xml and opens project and the tsFrames by looking at the xml.
    Can someone please help me with wrting a method that applies those settings and loads the application.

    Hi,
    Thanks for replying!
    I am new to java and i have created the read and write method by using examples from existing code.
    what i want to do is store the elements its reading into an array so that i can use it in another method to do things with it.
    The code below is reading element from xml
    List frame = XMLManager.getListOfNamedChildren(tsFrames, xmlFrameTag);
                   Iterator iterator = frame.iterator();
                   while (iterator.hasNext()) {
                        Element tsFrameElement = (Element) iterator.next();
                        String tag = XMLManager.getAttributeValue(tsFrameElement, "tag");
                        String maximised = XMLManager.getAttributeValue(tsFrameElement, "maximised");
                        storeTsFrame.add(new TSFrameSettings(tag, maximised));I want to use a for each loop to read each line in the xmlFrametag by replacing the while
    can someone help me with this please!

  • New Hard drive, can't access certain aspects. Help needed please

    Hi everyone.
    I have an HP Pavilion dv6-6052ea laptop.
    I've been having problems with the hard drive so got a new one installed.
    My main issues are since getting it back, I can't access any of the original HP installations etc (I've downloaded all the drivers I know about through HP).
    The 2 main things I'm missing are 2 things that came with the laptop.
    1: Beats Audio sound system 
    2: Video Graphics: AMD Radeon HD 6490M (1 GB DDR5)
    and I have no idea how to get them back. Can anyone help. Do I need to install specific drivers? I can't find any trace that they exist on my laptop now apart from the stickers on the laptop! Any help is greatly appreciated. 
    I never had any CD back ups for the laptop. I do have the old HP back up etc saved on a USB but I don't know enough about the folders and files to know what I need to look for. (I still have the old hardrive.)
    Again, any help is massively appreciated. Thank you!
    Tony 

    If you used your HP Recovery Media, all factory install drivers and software would have been installed. If you didn't create your HP Recovery Media when you first setup your computer, please contact official HP support in your region / country, via the HP Worldwide Support Portal, to see if HP Recovery Media is available for your computer.
    If a generic Windows 7 installation disc was used, you will need to install all HP specific driver for your computer. Please try IDT High-Definition (HD) Audio Driver, Intel High-Definition (HD) Graphics Driver, and AMD High-Definition Graphics Driver to resolve your missing drivers issues. Windows 7 64-bit driver for your computer can be found on the HP Pavilion dv6-6052ea Entertainment Notebook PC Drivers page.
    If you have any further questions, please don't hesitate to ask.
    Please click the White KUDOS "Thumbs Up" to show your appreciation
    Frank
    {------------ Please click the "White Kudos" Thumbs Up to say THANKS for helping.
    Please click the "Accept As Solution" on my post, if my assistance has solved your issue. ------------V
    This is a user supported forum. I am a volunteer and I don't work for HP.
    HP 15t-j100 (on loan from HP)
    HP 13 Split x2 (on loan from HP)
    HP Slate8 Pro (on loan from HP)
    HP a1632x - Windows 7, 4GB RAM, AMD Radeon HD 6450
    HP p6130y - Windows 7, 8GB RAM, AMD Radeon HD 6450
    HP p6320y - Windows 7, 8GB RAM, NVIDIA GT 240
    HP p7-1026 - Windows 7, 6GB RAM, AMD Radeon HD 6450
    HP p6787c - Windows 7, 8GB RAM, NVIDIA GT 240

  • Load object from xml

    Imagine if you can that I have a XmlLoader class for each object that can be loaded from xml.
    Before I had the xmlLoader code inside the objects but it's better to separate loading from actual object...
    these xmlLoaders needs to be able to set all vars for those objects. How would be the best way to do that?
    Atm I have made all vars with a package scope. but this really opens the object open to all other objects in that package...
    I don't know any other options. so how do you keep your vars safe, but still be able to load them from whatever source(xml, txt)...?

    Apache Digester is good for this sort of thing. It uses setter methods to populate your objects. You could also just use XML Serialization and deserialization. Or, you could go for something like JAXB or XMLBeans, whereby you actually will have classes generated for you from XML Schemas, and instances of those classes can marshall and unmarshall themselves quite easily

Maybe you are looking for

  • Wish MSI would post this kind of info on this forum

    Nice to have a peek Inside MSI's Design Studio and Test Lab http://blog.laptopmag.com/msi-gaming-lab

  • Imessage 'not delivered' message!

    Hi all, Please, can somebody help me? I am on IOS 5 and all of my family are on IOS 5 too. we all have imessage enabled, yet when I try to send a message to either the ipod or ipad, from my iphone, I keep getting the message 'not delivered'. I have t

  • Numbers instead of Contacts iOS Imessage

    Hi I am trying to use Imessage for the first time. I was wondering for the iOS imessage why a person's number is coming up instead of the contact name? when I went i talk with people who have Imessage, their number comes up instead of their contact n

  • Java XSLT technologies

    I have a new project that will need an XSLT engine. What I'm now in the process of researching is which Java-based XSLT engine I will use, and are there any related technologies that I should consider to make my job easier :) I want to go with someth

  • My options with a bought iPhone 5s

    I bought a 5s for my son at WalMart.  I wanted to do a month to month plan ie Family Mobile.  The person at the counter told me I had to use Straight Talk.  Fine.  Let me say..I know very little about buying cell phones.  I get mine through my husban