A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: importing image from xml - with a twist...

  1. #1
    -=The Holy Step-Father=-
    Join Date
    Jun 2000
    Location
    Coast to Coast
    Posts
    85

    importing image from xml - with a twist...

    OK - so here is my dilema -

    I'm creating an MP3 radio/player

    I am trying to import an image file from XML.

    The XML already contins variables (text) that are getting passed into thie flash movie.

    The end result is this -

    Artist:
    Title:
    Label:

    THEN next to all of this - I want to load a picture of the musician.

    The songs are grabbed at random - so all the invormation is included in a SONG node.

    the code looks like this:

    PHP Code:

    <song>
    <
    artist>Foo Fighters</artist>
    <
    title>Watershed</title>
    <
    label>Capital Records</label>
    </
    song
    i have tried just about everything.. from adding a new node
    PHP Code:
    <imgSRC>foo.jpg</imgSRC
    and all sorts of onLoad commands.
    I don't know if i'm messing up the XML or the AScript (or both)

    does anyone have a solution for this problem?

    greatly appreciated

    RR
    working on it

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    There isn't any standard for adding an image, you will have to write the Actionscript code to handle loading the jpg file (as a new movie), and then deciding where to display it.

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  3. #3
    Member
    Join Date
    May 2001
    Location
    S*PORE!
    Posts
    56
    There's a tutorial on the Macromedia site on this:
    http://www.macromedia.com/support/fl...slideshow_xml/

    Basically, you can add the image path as an xml attribute and then load the jpeg file into a target movie clip. It's also easier to handle values like artist, title, name etc as xml attributes rather than have to go thru all the nodes...

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