A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: AS3/XML Image Loading

  1. #1
    Junior Member
    Join Date
    Sep 2009
    Posts
    18

    AS3/XML Image Loading

    I have an project where I need to load in random images to movieclips spaced throughout a website and am having a little trouble dynamically loading the images in. Would it be easier to load the images in through AS3 or XML? (I have all images in an FTP online, so I'm trying to figure out an efficient way to load the images into the SWF but stuck on the code right now)
    The last time I did this was AS2 so switching over is a little confusing, any help is appreciated. Thanks-

  2. #2
    what do you mean load them through as3 or XML? if you were to load them in you would need either just AS3 and a bunch of hardcoded paths (bad idea) or AS3 and XML with all the image names and paths stored in the XML.

    Ideally you would setup an XML file with all the image names and paths... load the XML file into Flash (via AS3) and load the images from there.

  3. #3
    Junior Member
    Join Date
    Sep 2009
    Posts
    18
    Yeah, that's what I was looking to do I just don't really know how to. I tried a couple tutorials for image galleries with XML and got those to work, but I can't really figure out how to just load separate images through the website. I have the hardcoded paths but didn't think that would be too efficient, so instead tried loading in a separate XML and using that but finding any tutorials for loading in a single image to a movie clip somewhere in the FLA is difficult. (For some reason when I tried adding the single image to the XML i'm already using the gallery quit working) Basically what I would like to do is have it so when the user clicks on "Link 1" there would be a graphic in the following page loaded in from XML.

    Thanks again for the help, by the way.

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5

  6. #6
    Junior Member
    Join Date
    Sep 2009
    Posts
    18
    So how would I call a specific image from the .xml and push it into a specific movieclip in flash? Say I have 'exampleImage01' in the .xml and I am trying to push it into 'exampleMC' movieclip that is already on the stage in flash. I don't want to just create a direct link in AS3 to where the image lives but I'm having a great deal of trouble when I'm trying to set it so that image shows up in the 'exampleMC'
    Thanks again

  7. #7
    what you have to do is load the XML into flash and PULL the image in.. if you take a look at the example in the tutorial i just posted you can see that the XML contains links pointing to the images and flash uses those links to load the images..

    so the process would be..
    xml contains links
    flash loads xml
    flash parses xml
    flash finds link in xml
    flash loads link (image)

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