A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: loading swf files from xml

  1. #1
    Junior Member
    Join Date
    Jun 2008
    Location
    North Jersey
    Posts
    10

    Question loading swf files from xml

    I am creating a CDROM using Flash and xml, I have a fla template that I converted into a Carousel that displays products. The xml links to http pages but what I want to do is direct the link to separate swf for a CDROM.

    Here is the source from the xml:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <images >
    <img image="photo_tb/sp56.png" title="SP56" url="http://www.website.html"window ="_blank"/>

    I am new to this and could anyone help me with the right source code to replace this to load a separate swf file that will be placed in a self window for a CDROM.

    Thanks I really appreciate it very much

  2. #2
    I know nothing.
    Join Date
    Feb 2008
    Posts
    315
    So will the main "Carousel" be run for the CDROM?

  3. #3
    Junior Member
    Join Date
    Jun 2008
    Location
    North Jersey
    Posts
    10

    Cool Yes it is for CD Rom

    I have solved the problem of the xml file issue but thank you for offering to help!!!

  4. #4
    I know nothing.
    Join Date
    Feb 2008
    Posts
    315
    Quote Originally Posted by Mad Ace
    I have solved the problem of the xml file issue but thank you for offering to help!!!
    No problem. I'm sure you found out it was probably a path issue. It may be helpful to post your solution, so other users can benifit...

  5. #5
    Junior Member
    Join Date
    Dec 2008
    Posts
    2
    no kidding. i'm looking for this answer.

  6. #6
    var n:Number = 0;
    function loadswf():Void {
    if(n<banner.firstChild.childNodes.length) {
    target_mc.loadMovie(banner.firstChild.childNodes[n].attributes.src);
    n++;
    }
    else {
    clearInterval(intervalID);
    }
    }

    var banner: XML = new XML();
    banner.ignoreWhite = true;
    banner.onLoad = function (success) {
    if(success) {
    intervalID = setInterval(loadswf,2000);
    }
    }
    banner.load("banner.xml");


    With the above code, you can load movies from XML file in the same target movieclip. After every 2 secs it will automatically load another movie from the XML file…

    Happy Coding!

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