A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Internal XML in variable

  1. #1
    Senior Member
    Join Date
    Jul 2008
    Posts
    117

    Internal XML in variable

    I have a Flash application which an absent colleague has written, which has a movie clip on stage.

    The movieclip loads external variables from an external XML file. I need to put the flash piece inside of a Powerpoint presentation. I've search for a long time to see if you can feed external variables into a Flash movie that is itself inside of a Powerpoint presentation, specifically whether it can load XML, and have come up with a blank.

    As such, to make it work, I've had to write the XML directly into the actionscript, which is not ideal, but a work around.

    The movie has a movieclip inside it, with this code on in in the first frame...

    PHP Code:
    movieclip1.load("xmlData.xml"); 
    Then the code within that movieclip loads all the necessary variables from the external XML file. However, now due to the limitation of putting Flash movies in Powerpoint and having to write the XML into Actionscript I have the following code...

    PHP Code:
    var xmlData = <tag1>variable1</tag1etc... 
    How do I change this line of code...

    PHP Code:
    movieclip1.load("xmlData.xml"
    ;

    so that the variables from xmlData still get feed into the movieclip on stage?

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Typically you would have something like this...
    Code:
    movieclip1.load("xmlData.xml");
    
    var movieclip1 = new XML();
    movieclip1.ignoreWhite = true;
    movieclip1.load("xmlData.xml");
    movieclip1.onLoad = function() {
    	// code for parsing xml here
    };
    Replace it with...
    Code:
    var xmlData = <tag1>variable1</tag1> etc...
    // code for parsing xml here

  3. #3
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    22
    Last edited by angelhdz; 04-11-2012 at 06:31 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center