dcsimg
A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: Dynamic image scroller

  1. #1
    Member
    Join Date
    Sep 2001
    Posts
    39
    I'm trying to create a gallery of pictures where the thumnails are scrolling on one side of the stage area. I'm having problems getting the images to load into the movie clip, and trouble getting the larger images to show up when the movie clip is pressed. Does anyone know of a solution to this problem, or even a better way of doing this?

  2. #2
    Member
    Join Date
    Jan 2002
    Location
    Dallas, TX
    Posts
    47

    is this what you're looking for

    I did a little experiment yesterday that loads jpgs from an XML file. Let me know if this is whta you're looking for.

    http://www.revjon.com/flash/scroller.html

  3. #3
    Junior Member
    Join Date
    Mar 2002
    Posts
    2
    Are you dynamically creating empty movie clips that in turn load a jpeg from an xml file...i'm very interested....the page looks really good...please advise...

    chase bentley

  4. #4
    Member
    Join Date
    Sep 2001
    Posts
    39
    jcd1489, this is what i'm looking for, except when a visitor clicks on an image, a larger version is displayed next to the thumnails.

  5. #5
    Member
    Join Date
    Jan 2002
    Location
    Dallas, TX
    Posts
    47
    okay here are links to everything you need:
    http://www.revjon.com/flash/scroller.html
    http://www.revjon.com/flash/scroller.fla
    http://www.revjon.com/flash/menuItems.xml

    In the .fla there is functionality for clicking to show a bigger image. Right now it just opens the JPG in a new browser window, but you can easily change this.

    Let me know if you can get it working.


  6. #6
    Member
    Join Date
    Sep 2001
    Posts
    39
    Thxs, i'll get working on it later tonight

  7. #7
    Member
    Join Date
    Sep 2001
    Posts
    39
    ok, i'm having trouble getting the scroll to work, when i change the pictures in the xml file, the image doesnt show up in the movie. Am i doing something wrong?? ALso, how would I go about having the thumnails scroll upwards instead of horizontaly??

  8. #8
    Member
    Join Date
    Jan 2002
    Location
    Dallas, TX
    Posts
    47
    if you change the xml file, make sure your browser is not caching it.

    if you want it to go vertical just change everything that deals with X to deal with Y.

  9. #9
    Member
    Join Date
    Sep 2001
    Posts
    39
    ok, i was able to get some pictures to work, but not others. Is there a specific demention that the pictures have to be? The pictures that dont load can be loaded using the loadMovie... script. Also, is there a way to have the thumbs open up a diffrent file? I have presized thumnails and the original larger files. Thxs for your continued help.

  10. #10
    Member
    Join Date
    Sep 2001
    Posts
    39
    hello???

  11. #11
    Member
    Join Date
    Sep 2001
    Posts
    39
    Ok, new problem. I have buttons inside a movie clip that are scrolling along the side of my movie. How would I go about being able to click on a button and load say a picture onto the main stage?

  12. #12
    Member
    Join Date
    Jan 2002
    Location
    Dallas, TX
    Posts
    47
    I am thinking of upgrading to this eventually, but it was just an experiment for now.

    Try this:
    1) make a new movie clip on the main time line with and instance name of "bigPic" with nothing in it.
    2) add another attribute to you XML file that has the filename of your bigger picture
    3) where you load the Title of each pic in, also load the big pic's filename
    4) then when someone presses a clip, change getURL code to say:
    _root.bigPic.loadMovie(bigPicFileName);
    5) you may also want to include something to stop the scroller from moving will the big pic is up and then some kind of close button.

    hope that helps (ie. teaches, but doesn't do it for you

    John

  13. #13
    Member
    Join Date
    Sep 2001
    Posts
    39
    ok, thxs, will work around with this. Keep me posted on your developments.

  14. #14
    Member
    Join Date
    May 2001
    Posts
    32
    hey! i am a noobie in Flash and XML. But i really wanna to try this. Is there a site where i can find tutorial on this?

  15. #15
    Member
    Join Date
    May 2001
    Posts
    32
    hey! i changed the Links in the .XML but when i run the SWF, the picutres just won't show up? Can you guys help out?


    thanx you very much!


    I am new to XML. thanx!

  16. #16
    Member
    Join Date
    May 2001
    Posts
    32
    anyone can help me out?

  17. #17
    Member
    Join Date
    Jan 2002
    Location
    Dallas, TX
    Posts
    47
    Two things to check:
    1) that the XML is still formatted correctly
    2) that you did not save your JPG as "progressive"

  18. #18
    Senior Member
    Join Date
    Oct 2000
    Location
    California
    Posts
    149

    very cool

    I have a question...what about setting a variable in flash dynamically that would equal the number of images in a directory on the server? So if you wanted to reuse the image scroller as a dynamic engine on a site with different galleries with each gallery having a different amount of images. That way you wouldn't have to hardcode it in Flash. Can MX do that? Maybe a PHP or XML script could count the number of files and pass that value to flash.
    Possible?

  19. #19
    Member
    Join Date
    Jan 2002
    Location
    Dallas, TX
    Posts
    47
    Everything is already set dynamically by the XML file. Flash automatically counts the number of pictured defined in the XML file and created an infinite number of movie clips. Like you said, you could create a script that generated you XML file based on the number of images in a folder. In this example the XML also holds titles though.

    The point of this flash file is that your SWF doesn't have to know anything about the pictures and you never have to edit a FLA to get content into it. I used same XML file and same images with a different SWF in http://www.revjon.com/flash/spin.html.

    Any number of XML, JPGs or SWF can all interact this way. I think this is one of MX's great new strengths (along with drawing and components).
    [Edited by jcd1489 on 03-31-2002 at 05:50 PM]

  20. #20
    Junior Member
    Join Date
    Mar 2002
    Posts
    7
    Looks Awesome the spin example.
    Do you mind to post the .fla?
    Thanks a lot

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