A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Help With my Idea

  1. #1
    Pete Saia
    Join Date
    Nov 2004
    Location
    Bowie, MD
    Posts
    127

    Help With my Idea

    Hey, if anyone could help me with this, I would really appreciate it...I have around 50 photos, and I need to have them slide in to the stage, stay for about 25 seconds and then slide back out.
    I was thinking maybe I could give the pictures names 1-50. And then make a placeholder which would slide in and out, how I would want the photos to do. Then make a kind of loop which would call for the next numbered photo to load in the placeholder once it goes to repeat. So after each rep loadMovie would +1 to the name of the photo it's loading.
    Does anyone have any ideas if this is possible or how i could do it. Thanks...

  2. #2
    Senior Member
    Join Date
    Sep 2005
    Location
    Detroit
    Posts
    193
    You could do a basic XMl file for all the photos and then have the movie slide in and out advancing the array each time.
    You can have the movie clip go in and out fo the stage easily without actionscript just create a 25 second long presentation and have the movie tween in and then tween out and you have the right idea with the repeat and load movie +1.
    While the music played you worked by candlelight
    Those san francisco nights
    You were the best in town
    Just by chance you crossed the diamond with the pearl
    You turned it on the world
    That’s when you turned the world around

  3. #3
    Pete Saia
    Join Date
    Nov 2004
    Location
    Bowie, MD
    Posts
    127
    yeah, that does sound good, could you give me an example of how the actionscript and xml would look?

  4. #4
    Pete Saia
    Join Date
    Nov 2004
    Location
    Bowie, MD
    Posts
    127
    I think I have the basic idea. I would set up the XML like this, but i'm not sure how I would make it advance in flash.

    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <photos>
      <photo name="1" />
      <photo name="2" />
      <photo name="3" />
      <photo name="4" />
      <photo name="5" />
      <photo name="6" />
      <photo name="7" />
      <photo name="8" />
      <photo name="9" />
      <photo name="10" />
      <photo name="11" />
    </photos>

  5. #5
    I am not an expert
    Join Date
    Aug 2005
    Posts
    175
    <?xml version="1.0" encoding="iso-8859-1"?>
    <photos>
    <photo>=1.jpg </photo>
    <photo>=2.jpg </photo>
    <photo>=3.jpg </photo>
    <photo>=4.jpg </photo>
    <photo>=5.jpg </photo>

    </photos>


    to read this xml file u need to write the following script in fla

    myxml = new XML()
    myxml.ignoreWhite = true
    myxml.load("xmlfilename.xml")
    myxml.onLoad = function(){
    for var i = 0; i < myxml.childNodes[0].childNodes.length;i++){
    trace(myxml.childNodes[0].childNodes[i].childNodes[0])
    }
    }
    hopefully this will solve ur problem

  6. #6
    Pete Saia
    Join Date
    Nov 2004
    Location
    Bowie, MD
    Posts
    127
    thanks that actually did help a lot. I wasn't sure how to use the loop since it needed to load in to a placehold. However I got this to load the first picture in the xml, I just need it to advance.
    Code:
    photosXML = new XML();
    photosXML.ignoreWhite = true
    photosXML.load("/photos.xml");
    photosXML.onLoad = function(){
    _root.placeHolder.loadMovie (photosXML.firstChild.firstChild.attributes.Name);
    }
    Any Ideas?

  7. #7
    I am not an expert
    Join Date
    Aug 2005
    Posts
    175
    i = 0;
    photosXML = new XML();
    photosXML.ignoreWhite = true
    photosXML.load("/photos.xml");

    function changeImage(){
    _root.placeHolder.loadMovie (photosXML.childNode[0].childznode[i].childNode[0]);
    i++
    }

    call this function everytime u need to change the image


    in case u face problem do let me mail ur fla i will correct it for u

  8. #8
    Pete Saia
    Join Date
    Nov 2004
    Location
    Bowie, MD
    Posts
    127
    It looks like it's very close to working. Heres the file.
    http://www.rolldc.com/hosted_picture...tingphotos.fla

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