AS3 XML Slideshow v1.3

February 19, 2009 by jared 

v1.3

  • Completely revamped and robust code architecture.
  • Fixed a bug where certain images weren’t loading.
  • Now uses cTween and cXMLHelper
  • New nav buttons
  • Smaller file size, now only 10KB

Demo

Here

Download (v1.3)

Here (23KB)

Feeling Advanced?

Contribute or see how others have extended this slideshow at the Google code repository.

Go PRO

Want more features? Check out the PRO version of this slideshow.

Comments

148 Responses to “AS3 XML Slideshow v1.3”

  1. michael on May 21st, 2008 10:28 pm

    really lovely, excellent
    keep it up

  2. Joseph Schneekloth on May 22nd, 2008 8:33 am

    Is there anyway the next picture can show without the previous picture showing behind it? Since the pictures are different ratios, it has been a problem I cannot solve.

    thank you so much,
    Joseph

  3. Jared on May 22nd, 2008 5:53 pm

    Well you could just photoshop your images to the same size.. even if you could hide the image behind, you’ll still be left with some empty space to deal with anyway..

  4. Joseph on May 23rd, 2008 6:28 pm

    that is not an option. Their are widescreen and full screen pictures. Any help would be much appreciated. I tried removechild but I must not be putting it in the right spot.

    thanks in advance,
    Joseph

  5. Steve on May 24th, 2008 4:34 am

    Joseph, I also ran into the same problem but it seems you need the current and prior images on the stage for the transition. If one if smaller than the stage this allows the other to show during the transition.

    As Jared suggested, simple fill the space with your background color in photoshop and the problem will be resolved.

    I had some widescreen images that were not as tall as the others so I had to then add whitespace below the less tall images and the problem went away.

  6. Bruce on May 25th, 2008 6:13 pm

    This is excellent. Is there any way to make the images come in randomly every time?

  7. jared on May 26th, 2008 4:15 pm

    Randomizing it will be tricky, right now the code is inputting all url nodes in the xml file into an array, and it’s also checking if it’s the last node of the array, and if itis then go back to the first node (and vice versa), so randmizing the array will mean also deleting part of an array once the image is loaded until the array is empty, then reload everything again.

  8. Joseph on May 27th, 2008 10:20 am

    Is it possible for the picture that lays behind to be removed from the stage after the transition?
    thanks,
    Joseph

  9. Bruce on June 2nd, 2008 2:02 pm

    Hello, I’m back. sorry for this random question but I’m trying to figure out how to slow the fade down a little. I’d like to play around with that a little.

  10. jp on June 3rd, 2008 1:36 am

    hi jared, great work.

    is there anyway a slideshow can start in the pause state? i mean that the slideshow won’t autostart, and the user has the forward and back controls at the first screen.

    thanks!
    jp

  11. Hipburra on June 3rd, 2008 7:09 am

    Great job, jared!
    Looking forward to more.

  12. martin on June 5th, 2008 2:25 am

    just wondering how you would add a mask transition everytime the new image was loading.

  13. Jim on June 5th, 2008 11:44 am

    Nice work. I’ve been successful at recreating the slideshow but at a much smaller size. The problem is the controller doesn’t appear in the live area. What do I need to do to make it appear in the live window? Thanks…

  14. jared on June 7th, 2008 3:37 am

    Jim, just adjust the x and y position of the control movieclip.

  15. Jim on June 9th, 2008 9:16 am

    Simple enough…worked fine…thanks, Jared.

  16. Quince on June 20th, 2008 1:23 pm

    Made anther nic add-on t this code. very simply I used ‘flashvars’, ‘filexml=blah.xml’ on the embeded javascript and …swf?filexml=blah.xml in the object embed tags for noscript.

    Then in the fla i added

    var xmlfile:String = loaderInfo.parameters.xmlfile;

    and changed the first line to.

    var simplistika:XMLSlideshow = new XMLSlideshow(xmlfile, true, 7000);

    Now I can dynamically call the xml file to load the pics with.

    Hope this helps!
    Quince

  17. Peter on June 28th, 2008 4:06 pm

    Hi Jared:
    Thank you. This is just what I was looking for. Is there a way of coding AS3 in Flash Action to produce a caption for each image? Also, could you point me in the direction of adding thumbnails to the slideshow that interact with the slideshow images – if you have time.
    Regards,
    Peter

  18. KOUPOK on July 3rd, 2008 3:37 am

    hey man thanks for this good source. efficient. I don’t need more effects during transitions. the alpha tween is just fine.

    Have a nice day

    Alec

  19. Steve on July 3rd, 2008 5:04 am

    It would also be nice to have each image linked to a different page in set to the XML…

  20. Joseph on July 4th, 2008 12:03 pm

    I attempted to get the slideshow to start paused. But the first time the user pushes the next button, it doesn’t go to the next picture until the second click.

    Setting the starttime to stop
    and the isPlaying to false

    Is there anything else I should do in order so the button will work on the first click?

    Joseph

  21. test on July 11th, 2008 10:08 am

    Test trial

  22. antonio on July 21st, 2008 4:47 pm

    I am testing the Slideshow v1.2, in a project, (I am new user of AS3.0) your Slideshow v1.2 is loader with:

    >>

    var loaderSs:Loader = new Loader();
    var sshow:String = “ss/ss.swf”;
    loaderSs.load(new URLRequest(sshow));
    addChild (loaderSs);
    barra_mc.addChild(loaderSs)

    <<

    in my site “local” is good, but in the server is not run.

    the play/pause and next and back buttons load but the images not.

    TweenLite.as, xmlfile.xml, XMLSlideshow.as, the folder “images” and ss.swf (slideshow) are in the same folder.

    that I must do?

    excuse-me my english.

    thanks for your generosity!!

  23. Jack on July 29th, 2008 3:32 pm

    BRILLIANT! WORKED INSTANTLY!

    thank you much!

  24. Joe on July 29th, 2008 4:38 pm

    Hello, this is an excellent slideshow, how would I go about slowing down the transition of each image that is fading in? I want a moderately slow transition, the default is a little to quick.

  25. Joe on July 29th, 2008 7:55 pm

    I assume the speed of the transition is in the showLoadResult function (the last function in the .as file), but when I change the number, nothing is happening. Is there something else that I need to change?

  26. Steve on July 30th, 2008 12:18 pm

    Anyone figure out how to wrap a link to a URL so the images can also be linked to other pages?

  27. Luis on August 2nd, 2008 7:01 am

    Hey Jared,

    I’m working on a flash app that has tabs on the left side and a content pane on the right. I’ll be using your example to do most of the work. If all goes well, I’ll post the post the source here. I’ll mention that I’m a big fan of JavaScript so I’ll be working to implement JavaScript type effects into your example. I’ll be using these commercially btw.

  28. Joe on August 6th, 2008 10:42 am

    I figured out the transition speed issue. Not really an issue more like a user error. No worries.

  29. mike kelly on August 7th, 2008 8:05 pm

    I got the following error right out of the box after opening the with images fla and hitting command + return (mac):
    1046: Type was not found or was not a compile-time constant: XMLSlideshow.

  30. GOMAR2 on August 27th, 2008 12:40 pm

    Thanks yO!

    The mp3 Player and this has been

    informative for me in learning some

    of this stuff. I appreciate you posting

    your hard work for someone like me

    to learn from.

  31. Philippe on September 3rd, 2008 9:06 am

    Excellent job, the slideshow works perfectly.
    Only one question: where should I change the code to ensure that it does not automatically start, only manually for the users

    thanks
    nice work
    Philippe

  32. Alincof on September 11th, 2008 12:51 am

    Hello
    i’m a beginner in AS3.
    I want to add your beautiful and useful slideshow in my own fla file of my website.

    When i add the two commands in the action pannel, some errors occurs…
    Sorry but my messages are in french but here they are :

    XMLSlideShow.as, ligne 27
    1046: Ce type est introuvable ou n’est pas une constante de compilation : Control.

    XMLSlideShow.as, ligne 27
    1180: Appel à une méthode qui ne semble pas définie, Control.

    XMLSlideShow.as, ligne 30
    1046: Ce type est introuvable ou n’est pas une constante de compilation : PreBg.

    XMLSlideShow.as, ligne 30
    1180: Appel à une méthode qui ne semble pas définie, PreBg.

    What can i do to solve this problem in my fla file ?

    Thanks a lot for your answer !!
    Alincof From Belgium.

  33. Alincof on September 18th, 2008 6:39 am

    Hello…

    No answer to help me ??
    I’m a poor lonesome AS3 beguinner !!!

    Snif…
    Alincof.

  34. Ronald on September 23rd, 2008 1:21 am

    @Alincof;
    Those errors are generated because you don’t have the required movieclips in the library.

    Actionscript tries to talk to non-existing clips in the FLA file. Open up the original FLA file (from the sourcecode in this blog) and open your library (window > library [CTRL-L] on windows) and copy/paste these movieclips into your own project file.

    –or, edit the actionscript so you don’t have to use the control buttons and just let the slideshow run.

  35. Alincof on September 27th, 2008 12:38 am

    Hello Ronald.

    Thanks for your answer…
    I’ll try to do this and i’ll tell you if this solve my problem.

    Alincof.

  36. rob on October 17th, 2008 10:49 am

    thanks for the script
    I have a question:
    how to remove the slideshow from the stage?

  37. jared on October 22nd, 2008 6:06 am

    rob – use removeChild(whateveryoucalledithere);

  38. Mike on October 24th, 2008 6:21 am

    I am trying to get the slideshow to center when I import it to the stage. Right now it aligns to the upper left of the stage. Here is the code I am using to import the slideshow:

    var bgToLoadv:String = “XMLSlideshow.swf”;
    var bgLoaderv:Loader = new Loader();
    var bgURLv:URLRequest = new URLRequest(bgToLoadv);
    bgLoaderv.load(bgURLv);
    var bgv:Sprite = new Sprite();
    bgv.addChild(bgLoaderv);
    addChild(bgv);

    I had this piece of code on an old slideshow I was using and it worked, but now with your new code it is failing.

    show.x = (stage.stageWidth / 2) – (show.width * 3);

    Any ideas?

    Thanks!

  39. Mike on October 24th, 2008 11:44 am

    Ok, got the slideshow working and it is centered how I need it, but it is throwing this error when I publish the movie:

    ReferenceError: Error #1065: Variable show is not defined.
    at XMLSlideshow_fla::MainTimeline/frame1()

    It is working ok, but still throws this error. Any ideas where it is coming from?

  40. Robert on November 1st, 2008 6:29 am

    Awesome script!

    I’m having trouble scaling down the size of my images to fit the stage. I don’t want to generate thumbnails for the images in my show are constantly changing and the originals need to remain large.

    Any ideas on controlling image size would be great!

    Thanks again for the great script!

  41. jared on November 2nd, 2008 9:29 pm

    this has been discussed before, it’s probably easier to photoshop your files to a fixed resolution than to spend time thinking of conditional statements. (im not saying its impossible, im just saying it’ll probably be better off)

  42. Lucas Mattos on November 3rd, 2008 5:42 am

    Thanks from Brazil man!

  43. Robert on November 3rd, 2008 5:53 am

    Thanks for the response. My challenge is that the images I’m displaying are made for another app and are changing regularly. The are all the same dimension, they just need to be scaled down by the same factor. Manually resizing them is not feasible. I’m making the XML with PHP mySQL.

    Either way, you have shared an awesome script and it is very much appreciated.

  44. jared on November 3rd, 2008 6:13 am

    cheers robert, i must say i havent really given it much thought, but am pretty sure its possible.

  45. Robert on November 3rd, 2008 6:19 am

    I’m new to AS3 and I think I’m being lazy. I should probably buckle down and learn it instead of hacking around.

    Thanks again.

  46. Filipe on November 3rd, 2008 10:06 am

    Hello,

    It’s a nice code what you have. How can i pass xml by flashvars in a php file to your ’simplistika’?

    It’s all.

    Best regards,

    Filipe

  47. Khader on November 6th, 2008 11:02 pm

    Hi,

    I am really thankful to u that u have provided such a good and exact thing what i want. I am really thankful to u and now I will make a daily habit to see http://www.simplistika.com for Good stuff

    Thanks
    Khader Ali Khan

  48. Collette on November 10th, 2008 6:02 am

    Jared,

    Perfect working code. After making very little changes, it even scales perfectly. Will absolutely use it for a new site I’m building right now.

    I wonder if it is possible to place a transparent image on top of the images that makes up the slide show. I’m totally new to action script. I guess a transparent image on top of the slide show requires a new layer? And maybe something to get the images in the background layer?

    Anyway, THANKS!!!

  49. rachel on November 12th, 2008 9:35 am

    Hi. Thanks Jared for this great code.

    I’m trying to apply an actionscript drop shadow to the images. I have the following code (below) which I’ve sort of adapted from another tutorial. (I don’t need the on click/drag elements of it – only for there to be a shadow)

    However, as there is no movie clip on the stage in your files I’m not sure what I can apply the shadow var to and how. Is this possible?

    Thanks in advance
    R

    var filt_shadow:DropShadowFilter = new DropShadowFilter;

    filt_shadow.blurX = 4;
    filt_shadow.blurY = 4;
    filt_shadow.alpha = .4;

    ball.addEventListener(MouseEvent.MOUSE_DOWN, dragMovie);
    ball.addEventListener(MouseEvent.MOUSE_UP, dropMovie);

    //this is the dragMovie function
    function dragMovie(event:MouseEvent):void
    {
    //tells flash to start dragging the object we refer to.
    this.startDrag();
    //this line adds our two filters to the object, notice we use [ ] and not ( ), also separate the two filters by a comma.
    this.filters = [filt,filt_shadow];
    }

    //this is the dropMovie function.
    function dropMovie(event:MouseEvent):void
    {
    //tells flash to stop dragging the object.
    this.stopDrag();
    //setting the filters to none.
    this.filters = [];
    }

  50. Neo3D on November 24th, 2008 4:10 pm

    Great job but how did you link the class to the fla file? I don’t see it pointing to it as the document class, nor is it linked anywhere in the library?

  51. Lorenzo Gils on November 24th, 2008 4:40 pm

    Hey how do you move the control bar of the slideshow.

    Thanks
    Lorenzo Giles
    Reef Radio Electronics

  52. jared on November 25th, 2008 5:19 pm

    linking the class file –> look at the code on the timeline.
    moving controlbar, do a search for all “.x” and “.y” and see what is positioned by what. all the best!

  53. Rosivaldo on November 28th, 2008 12:08 pm

    Hey Dude, this is great. Any chance I can combine the thumbnail menu to this slide show and maintain the functions on both menu?

  54. moira on December 1st, 2008 7:44 pm

    Thank you so much for posting this incredible template.
    I tried to place a bitmap image on a layer above the actions layer, a bitmap that partially covers the xml-loaded images, so they appear to peek out from behind it. But it shows up for just the first millisecond and then disappears. Do you happen to know what I’m doing wrong?

    I’ve loaded my working file at http://www.organicdesignworks.com/XMLSlideshow-japan.fla

  55. Anthony on December 15th, 2008 9:22 am

    Great Job!

  56. Trish on December 29th, 2008 10:05 pm

    Thank you Jared for this template and your tutorials. I have been through the xml slide show tutorials.

    Unfortunately, the only one I can get to work on a server is the one with the script in the timeline.
    XMLSlideshow works as a swf and html on my desktop. However,even if I publish your fla and put up the swf, html, both as docs and the xml on a server all I see in the browser is the navigation tool. Clearly, I am missing something. I tried putting XMLSlideshow in the class path on the main timeline but that threw an error. Also the site seems to be ‘waiting’ in the browser. (Waiting to load, an awfully long time – unlike your slide show on your site…)

    Someone please help! Thanks, Trish

  57. Trish on December 31st, 2008 11:31 am

    Hi Jared,

    I figured it out. Somewhere on the web it said to check your xml file for errors. I re-coded the xml and it worked! Thanks so much. I have learned tons from your tutuorials and the slideshow.

    Happy New Year!

  58. Neo on January 1st, 2009 2:14 am

    Hi Jared,

    Thank you for the code, it really helps me with my project.

    I do have one question though. I am trying to create multiple swf and xml files that load the same batch of photos from the images folder but with different starting image. I have given the swf and xml files different names, they play correctly on their own and also using firefox. But in IE, I get this message: “Error #2044: Unhandled IOErrorEvent:. text=Error #2036: Load Never Completed.”.

    I am not sure where I did wrong as I am not a programmer, do you happen to have sample files for multiple xml slideshow or maybe you can tell me where I did wrong?

    Thank you very much. Nice work, really appreciate it.

  59. Neo on January 1st, 2009 3:04 am

    Oops, never mind. I did a typo in the script and I have fixed it.

    Thanks again! : )

  60. Rvanlaak on January 2nd, 2009 5:42 am

    Hi,

    Great script.. got it working with a php file wich makes an array of all the files from a directory.

    My current problem is the black background color. Is it possible to set it to white? All my images are white-oriented, and the black screen at start doesn’t fitt with it..

    Great work!

  61. Trish on January 2nd, 2009 9:38 am

    Hi Rvanlaak,

    Just set the color of the stage on the main time line to white. Go to the properties tab at the bottom and you will see a small color swatch. Click that and you can change the color of the stage.

    Cheers!

  62. Rvanlaak on January 2nd, 2009 10:31 am

    Trish,

    Thanks for the help, i’ve already tried that one. After an half hour of trying i finally found the “problem”. Because of the black background, the published html file contained black as background color in the html object.

    Greetings…

  63. Laura on January 15th, 2009 7:35 am

    How do you change the color of the progress bar?

  64. Laura on January 15th, 2009 7:35 am

    How do you change the color of the progress bar?

  65. darby on January 26th, 2009 6:26 pm

    thank you VERY MUCH. at last a xml slideshow without a million confusing bells and whistles. thank u for sharing.

  66. jared on February 5th, 2009 11:20 pm

    Laura – open the control mc in the library and change it there.

  67. Macman on February 9th, 2009 4:21 am

    Great Slideshow!!

    But i have a question, is there an easy fix to remove the pause btn and the arrows could be activated from start instead of being activated when click on pause.

  68. Carrie on February 12th, 2009 11:01 am

    Thanks!

    I am trying to add two different slide shows to a site.
    There is a start page, then click a button, which goes to the first slide show. Click another button, which goes to the second slide show.
    I need to remove the slideshow before the next one starts. But when I use removeChild(slideshow) I get the following error.

    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/removeChild()
    at test_fla::MainTimeline/climbOrizaba()

    It seems to work inspite of this but not consistently.

    Below is the code. And I get all sorts of problems when I try to go back to ‘home’. Everything is located in 1 frame, I’ve tried it in 3 and still had the same problem.

    var IzPics:XMLSlideshow = new XMLSlideshow(“pics.xml”, true, 7000);
    var Orpics:XMLSlideshow = new XMLSlideshow(“orizabapics.xml”, true, 7000);

    izta_btn.addEventListener(MouseEvent.CLICK,climbIzta);
    orizaba_btn.addEventListener(MouseEvent.CLICK,climbOrizaba);
    function climbIzta(event:MouseEvent):void{
    addChild(IzPics);
    /*removeChild(home_mc);*/
    removeChild(Orpics)

    }

    function climbOrizaba(event:MouseEvent):void{
    addChild(Orpics);
    removeChild(IzPics);
    /*removeChild(home_mc)*/

    }

    What am I missing?

    thank
    carrie

  69. Lorenzo on February 13th, 2009 7:50 am

    Hey Jared,

    Great job love the slideshow.

    I do have one question about a problem that im running into.
    the slideshow seems to work great when im bench testing on
    my localhost. But seems to freeze on the 1st pic when its loaded online. It will freeze on the 1st pic then the load bar will stay 5 percent loaded. If you pause it and press the skip button a couple times it will then go to a picture that is further down the list of photos. Seems to me its skipping some pictures, and freezing up on the ones being skipped on slideshow mode. and this only happens when im loaded to the my godaddy server.

  70. jared on February 13th, 2009 8:41 am

    im in the midst of releasing an update, so hang in there.

  71. jared on February 13th, 2009 8:42 am

    carrie, i recommend that you try to load an external swf using a Loader, instead of adding it by the class, realised its not a very good idea to do so.

  72. Lorenzo on February 14th, 2009 6:12 pm

    Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

    Just for Refrence this is the error im receiving when its loaded to go live.

    Thanks man and let me know if i can make any donation
    toward your work.

  73. Carrie on February 15th, 2009 7:16 am

    Thanks and I’d been thinking about trying that.

  74. Brain on February 17th, 2009 2:20 am

    Hey Jared,

    great job, that is what i need, but I can not oben the .fla in Flash 8 professional. What version I need?

    Best regards, Brian

  75. jared on February 17th, 2009 5:27 am

    it’ll be flash cs3 only.

  76. jared on February 17th, 2009 5:30 am

    Lorenzo, your error is pretty obvious, most probably it can’t find your xml file. try using the absolute path to your xml in the code, i.e. http://www.yoursite.com/xmlfile.xml

    and in your xml file put absolute links as well to images.

  77. Lorenzo on February 17th, 2009 11:28 am

    Where do I edit the code to input the absolute path.

    Thanks
    Lorenzo

  78. Guillermo on February 17th, 2009 7:10 pm

    How i can make that the actions of the NEXT Button works with a key_down press? any idea?

  79. jared on February 17th, 2009 7:38 pm

    as you would add an event listener to listen for mouse clicks, likewise add an event listener to listen for keyboard events.

    child.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);

    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/events/KeyboardEvent.html

    See example at bottom of page

  80. jared on February 20th, 2009 12:34 am

    v1.3 out, download the new update for bug fixes.

  81. Richard on February 20th, 2009 12:54 am

    Great! I’ve also have put some time in it.

    It might be a great idea to migrate the project to Google Code. Then i can also commit the code, and every event will get its own place…

  82. AvidStoryTeller on February 25th, 2009 7:32 pm

    Looking for a solution where the .swf file is separated from the .as files. I have a CMS that can only upload the .swf file, therefore I would need to host all linked content on a sub-domain.

    How do I link the .swf file the action script files?

    Thanks.

  83. jared on February 25th, 2009 8:06 pm

    no idea what you’re saying.

  84. AvidStoryTeller on February 26th, 2009 6:46 am

    Where I want to use the slideshow I can only upload the .swf file. All other supporting files have to be uploaded somewhere else.

    Therefore, I am looking to place the .swf file in one location (www.mysite.com) and then all supporting files in another location (subdomain.mysite.com).

    Obviously, I can state an absolute URL for the XML file, but what do I do to reference the .as files that are now not in the same folder as the .swf file?

  85. richard on February 26th, 2009 6:49 am

    The .as file can be integrated into the .swf file, in the F9 actions panel you can place the code.

    When you want to use the absolute URL for the XML file, please mention you need an crossdomain.xml file. Google a bit to find more info about it.

  86. AvidStoryTeller on March 8th, 2009 6:15 pm

    Richard, you suggest that I integrate the .as files into the .swf. I am not sure what I need to do to avoid nested package or class errors when I combine the two .as file into the .swf.

    Could you explain or direct me to where I could find out more. I have been playing with this but I am not quite up to speed in AS3.

  87. David Vera on March 15th, 2009 7:48 pm

    You are awesome!

  88. gabriele on March 27th, 2009 2:18 am

    Hi, I insert the following lines to the XMLSlidesho.as file to resize the image, but when load swf in my website (in Loader component) the images don’t displayed

    private function
    fNextImage(
    vPlaceholder : Loader
    ) : void
    {
    trace(“fNexTIMAGE()”);
    setChildIndex(vPlaceholder, this.numChildren – 2);
    vPlaceholder.alpha = 0;
    vPlaceholder == mPlaceholder1 ? cTween.to(mPlaceholder2, {alpha:0}, 1) : cTween.to(mPlaceholder1, {alpha:0}, 1);
    cTween.to(vPlaceholder, { alpha:1 }, 1);

    var r:Number;//ratio
    r = vPlaceholder.height/vPlaceholder.width;//calculation ratio to which resize takes place
    trace(“r = ” + r);
    if (vPlaceholder.width > 200) {
    vPlaceholder.width = 200;
    vPlaceholder.height = Math.round(vPlaceholder.width*r);
    trace(“width = ” + vPlaceholder.width + ” height = ” + vPlaceholder.height);

    }
    if (vPlaceholder.height>200) {
    vPlaceholder.height = 200;
    vPlaceholder.width = Math.round(vPlaceholder.height/r);
    trace(“width = ” + vPlaceholder.width + ” height = ” + vPlaceholder.height);
    }
    }

    help me please

  89. Brian The Lion on March 27th, 2009 11:21 am

    Jared,

    Are you still providing technical support for version 1.2? I downloaded it via code.google.com because it had the buttons and everything that I desired.

    It worked on my computer locally, but when I uploaded it to my server, it doesn’t load the images or seem to play.

    I tried updating the .xml file location with a hard link in the SlideShow.as file, but still isn’t working. My browser(s) won’t return any errors to me, so I don’t know what’s wrong.

    Thanks,

    Brian

  90. Brian The Lion on March 27th, 2009 11:29 am

    it just occurred to me that the v1.2 I am speaking of is not your creating, just something named very similarly in the google code repository.

  91. Richard on March 27th, 2009 4:04 pm

    Hi Brian,

    Why don’t you try this one? I’ve implemented it on a couple of sites without a problem.

    The Google Code link of this project is at the top of this page. Please post the site where it is placed on in the Google Code wiki.

  92. Raphael on April 7th, 2009 6:12 am

    Hello Jared !

    I’m new to AS3. I tryed to write my onw slideshow before finding yours. Mine with not so well written and has some stability issue … So I’m now using your ;)

    I have the same question as gabriele, in my swf, I must have 2 slideshows and other stuff. My idea was to create 2 XMLSlideshow object, but i’m not able to resize them. When I do this, the image does nt appears anymore.

    Can you maybe give me the trick ???

    Regards,

    Raphael.

  93. busa on April 9th, 2009 2:58 am

    Hi there!
    is there any way to launch the swf fullscreen?

    basically i want to implement something like this.

    import flash.display.StageDisplayState;
    stage.displayState = StageDisplayState.FULL_SCREEN;

    and eventually make a projector fullscreen.

    is it possible?

  94. Richard on April 9th, 2009 3:42 am

    Since the Flash Player 9,0,28,0 update, flash applets can go to true full-screen. There are no fancy javascript hacks needed either. Users can toggle between normal size and fullscreen with a simple click, which can toggle Stage["displayState"] from “normal” to “fullScreen”. The param allowFullScreen must be set to true in the applet html.

    http://www.bezzmedia.com/swfspot/tutorials/flash8/True_Fullscreen_Flash_Mode

  95. busa on April 9th, 2009 5:09 am

    thank you Richard,
    i knew about the toglle normal/fullscreen mode.

    i can’t launch this gallery on fullscreen mode at start.

    i have to make a .exe autorun cd, so it has to start on fullscreen mode, without any activity from the user.

    how and where can improve the code?

    thanks

  96. AS3 XML Slideshow | Simplistika « Flash Designers on April 12th, 2009 7:56 pm

    [...] See original here: AS3 XML Slideshow | Simplistika [...]

  97. Alex on May 28th, 2009 10:50 am

    LOVE the script – thanks for posting for all! Is there a way to start on a random photo and just cycle thru the list normally after that? Please help!

  98. Alex on May 28th, 2009 11:09 am

    ok nevermind – i found the solution. Great code and thanks again for making this available to the public – it’s saved me some headaches!

  99. jared on May 29th, 2009 12:56 am

    probably want to share the fix for the benefit of others?

  100. Richard on May 29th, 2009 12:58 am

    I’ve implemented a random order with my php script. It is available on the Google Code repos.. :)

    http://code.google.com/p/as3-xml-slideshow-simplistika/

  101. Michele on June 1st, 2009 7:47 am

    thanks a lot, cool stuff

  102. Will on June 1st, 2009 10:19 am

    Hello My name is Will and my company is interested in your sideshow script but they need to have the images link to a webpage.

    I’ve tried to implement this myself but I cannot find the solution. How would I add a link to the images loaded so that when clicked you go to a webpage?

    Please help if you can, Thanks!

    -Will

  103. jared on June 1st, 2009 8:11 pm

    @will: just put an invisible movieclip in there and handle it.

  104. Al on June 3rd, 2009 2:57 am

    Total newb to Flash and AS3. When i downloaded your file, I opened up the FLA and an there is nothing there. I thought there would be at least a movieClip but nothing. I checked the library and it only had the controls.

    While I was able to adjust the XML to what I needed I’m not sure how to add this slideshow to another FLA I have already built.

    So how do I add this to an existing FLA?

    Thanks in advance!

  105. Richard on June 3rd, 2009 3:36 am

    The slideshow is initiated by Actionscript. Press F9 to see the code wich adds it to the timeline..

  106. Al on June 3rd, 2009 3:45 am

    Hey Richard,

    I open the fla and there is only one frame and it is empty and when I hit F9 it opens the ActionScript window and it too is empty.

    But when I test the movie, I do have a slideshow. Weird.

    The ONLY thing that is popluated is in the Properties window—the “document class” field is filled with the following: com.simplistika.XMLSlideshow

    So with no movie clip there, I’m not sure how to move this over to another fla!

  107. jared on June 4th, 2009 7:32 am

    @Al: If you haven’t figured it out by now, there’s a .as file inside the zip. All the code is in there. If you click on the stage inside your flash ide, and look at the properties panel, you’ll see something called “Document Class”. That’s where it’s at.

    We were all once a newb, no worries at all. I used to think people who code inside a document class were crazy. Now there’s no turning back from it; way too many advantages.

  108. jared on June 4th, 2009 7:34 am

    if you want to load it into another FLA, use the Loader class and load in the swf. good luck.

  109. Roberto on June 4th, 2009 6:29 pm

    Pretty nice thanks

  110. Carmel on June 5th, 2009 4:09 pm

    O.k. another total Newbie… Jared, with respect to you last comment about loading a swf file (ideally the slideshow that you have created) into a FLA file, how exactly do you do it?

    I am designing a website using Flash. I’m using SWF Object to embed it into a HTML file because I like how the SWF file can stretch to fit the WHOLE browser window (which is especially good for large screens). What I’d like to do is have a slideshow contained within my Flash file, however the slideshow has to fit in a specific area of my main FLA file.

    I’ve created a layer called “actions” and I’ve brought up the script assist window and am looking for the loader tab. Can you tell me what else I need to do.

    I’m confused as to how the inserted swf file is going to know where to get inserted.

    thanks

  111. jared on June 5th, 2009 4:19 pm

    @Carmel, check back in a while I’ll post an example of loading an external swf on the site.

  112. Michele on June 8th, 2009 2:26 am

    I am implementing it and everything works great. But i cannot change the slide time. I modified the var
    private var mInterval : uint = 12000;
    in the file XMLSlideshow.as but it dosen’t seem to work :o

    any help?

  113. Natasha on July 13th, 2009 1:10 pm

    Hello Jared:

    First of all, It’s a nice slideshow, thank you for your post.
    Is there a way of coding AS3 to produce a caption for each image using the xml file you have? I´ve been searching and I tried to make something similar in this function:

    private function fLoadTitle() : void
    {
    /*getChildIndex(mPlaceholder1) != 0 ?
    mPlaceholder2.load(new URLRequest(mData.slide[mSlide].title)):
    mPlaceholder1.load(new URLRequest(mData.slide[mSlide].title));*/

    }

    But it doesn´t work :( , How can I do that ?

    Any help would be appreciated :)

  114. Natasha on July 13th, 2009 1:13 pm

    The code is in comments, anyways, it doesn´t work without them :P , it´s because I tried something different, but finally I cleaned up the code and I just have this. How can I code to produce the caption using the xml file on every image?

    Thanks in advance!! :)

  115. mike miller on July 19th, 2009 10:30 pm

    Awesome script! I’m new with actionscript and was wondering if any would help me with the process of putting my own pics in the slide and resizing the slide for different proportions?

    Thank you

  116. jagan on August 10th, 2009 9:55 pm

    Your work simply super

  117. Robert on August 28th, 2009 7:31 am

    Thanks for sharing your work. Is there a trick to opening this without buying a mac? (although I’d like to have one)

  118. Robert on August 28th, 2009 7:32 am

    Oops my bad, it works on my pc

  119. Trish on September 1st, 2009 3:08 pm

    Hi Jared,

    Are you going to put up your awesome tutorial on how to move actionscript from the timeline to as files?

    Thanks for all of your hard work!

  120. Stuart on September 4th, 2009 9:06 am

    Hi Jared – I just purchased XML slideshow pro and I love it!

    Quick question – Is there a way to change the nav controls so that they only appear when a user mouses over any part of the entire photographic image area? Ideally I’d only want the ‘back’ and ‘next’ buttons to show on mouse over and drop the ‘pause’ button entirely? Any help would be appreciated, thanks!

  121. kade on September 4th, 2009 10:48 am

    Is it possible to add movie clips on top of the images, if i want to have text moving across?.. i tried the demo but the text fades out soon as the slideshow starts.. any solutions to this?

  122. Stuart on September 10th, 2009 10:49 am

    Hi – can anyone tell me how to turn off the Ken Burns effect in slideshow pro? Thanks!

  123. tomboy on September 22nd, 2009 2:02 pm

    Hi Jared,

    thx a lot for your nice work.

    I´m also a newby and have a question. My XML file includes 4 pics,
    and i dont want to have a rotation in the slide show it should go from Pic 1 to 4, and backwards using the arrows (i allready killed the slide interval). At the moment you could go from pic 4 to pic 1 again.

    Another problem is that i receive a:
    TypeError: Error #1010: Ein Begriff ist nicht definiert und hat keine Eigenschaften.
    at com.simplistika::XMLSlideshow/fLoadImage()
    at com.simplistika::XMLSlideshow/fOnClick()

    after clicking the arrows …to much.

    could you help?

  124. Alex on September 25th, 2009 9:47 am

    Thank you,
    very nice,
    found it hard to find a solid, smooth, easy, AS3 slide show!
    You Rock!

  125. Alex on September 25th, 2009 9:47 am

    Thank you,
    very nice,
    found it hard to find a solid, smooth, easy, AS3 slide show!
    You Rock!
    BTW,
    How can I add links to each slide?

  126. Tom on September 29th, 2009 6:48 am

    Hi Jared,

    Great work on the slideshow! I have tried to find a good, solid working tutorial for ages, and eventually managed to kind of code my own slideshow, but it’s nowhere near as robust and flexible as yours!

    I do have one question, though, and several people have asked it before me, but they all seem to have found a solution before any proper explanation was given here.

    When working offline everything works great, but as soon as i embed the swf in a html file and upload it to a server, the swf refuses to load the xml. Hence, no images are loaded. The xml is in the same folder as the swf, the link to the xml is absolute, and the links to the images inside the xml are absolute as well. As such, no crossdomain policies are violated, the xml exists and it is valid, but still it won’t load.
    Would using swfObject instead of the standard Dreamweaver embed do any good? I’m running out of ideas…

    Has anyone got any ideas on this?

    Greatly appreciated!

    Cheers!
    Tom

  127. Robert on September 29th, 2009 7:21 am

    Tom,
    I had the same issue and crossdomain.xml is all I could find to help. You put the file in the root directory of the server with the xml data. Below is a very basic one, there are a lot of other options available for the xml file.

    crossdomain.xml

  128. Alex on September 29th, 2009 10:15 pm

    Hey Jared, very cool man.
    I have a question.. How in the world do I re size the spectrum? I have tried playing around with the spectrum. as code and cannot for the life of me figure it out, sorry for such a simple question I am sure…

    Thanks again

  129. Tom on September 29th, 2009 11:43 pm

    I’ve uploaded a crossdomain.xml to the server’s root, but no changes.
    The annoying thing with this swf/xml issue is that you don’t get any feedback from it, the swf just sits there not loading any images, without telling you why.

    Anyone run into similar problems? Any suggestions?

    Cheers!

  130. Steve on October 1st, 2009 2:31 pm

    I like the new nav graphic.

    Looks like it still suffers from being able to recover from the click. For instance you click the visible pause sprite , then the play / next image arrow and it does not go back to playing the slideshow and hiding the arrows.

    Any chance that will be fixed?

    I’ll make a donation to help the cause.

  131. Lisa Ruffman-Weiss on October 2nd, 2009 10:59 am

    Jared,

    Your slideshow looks great but there was no code in the actions panel. How did you do this?

  132. jared on October 2nd, 2009 4:58 pm

    Click on the stage and you’ll see a Document Class in the properties panel

  133. jared on October 4th, 2009 6:05 am

    Steve: that behaviour is deliberate..

  134. Steve on October 6th, 2009 5:37 pm

    I have the Pro version but can not find the code in any of the .as files that determines the size? I see the example page does a proportional reduction in the swf embedded in the page but what if you want a totally custom envelope? Basically, I need a 450 wide by 400 tall swf.

    Is there an FAQ on mods somewhere that would show what code is needed to add a new size? Simply resizing the stage cause everything to fall off both right and bottom. I’m missing something but just don’t know where these values are to be found and yes I fully understand the code is separate from the fla file.

  135. Steve on October 6th, 2009 10:13 pm

    So the controller graphics are set in location relative to their origin point and can be changed in the Library by moving the Controls item relative to it’s origin.

    But what about the text that is displayed from the XML file?

    What value or attribute determined it’s position at the bottom of the Slide Show?

  136. Steve on October 6th, 2009 11:03 pm

    I believe I have it figured out now…

  137. Dion on October 19th, 2009 2:57 pm

    Thanks for this great script, it’s working perfectly! I’m trying to add two small things though, but I don’t manage:

    I would like to horizontally center the image that is displayed. Some images are smaller than the width of the flash movie. And now they’re aligned to the left, which doesn’t look good in my setup.

    I’m using the slideshow dynamically and some pages I’m using it on only have one image. Is there any way to tell the script not to animate when only one image is found?

    Cheers,
    Dion

  138. federico on November 20th, 2009 9:52 pm

    great, great work!
    just one question: I’d like to add smoothing to the images, so i tried

    var smooImg:Bitmap=mPlaceholder1.content as Bitmap;
    smooImg.smoothing=true;
    var smooImg2:Bitmap=mPlaceholder2.content as Bitmap;
    smooImg2.smoothing=true;

    but it doesn’t work… any idea?
    thanks in advance!

  139. Laviathan on December 6th, 2009 6:18 am

    Great xml flash slideshow, does anyone know how to add an invisibe button that clicks through to a url specified in the xml file. I will have a different url for each image

  140. Alison on December 30th, 2009 8:35 pm

    Hey, I’m very new to flash and actionscript and am trying to load the provided example into my own .fla using the ULloader component, and am getting the following error in my output window…
    “[object XMLSlideshow] XMLSlideshow.constructor
    [object XMLSlideshow] cXMLApp.constructor
    Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: file:///C|/Users/Admin/Documents/MA%5FCreativeDigitalMedia/Authoring%20Practice/FinalProject/FinalProject%5Ffiles/FinalSWF/nokiaawards/Slideshow.xml
    at com.simplistika::cXMLApp()
    at com.simplistika::XMLSlideshow()”

    Does anyone know why this is happening and how I might rectify??? Thanks in advance :)

  141. Josh on January 28th, 2010 1:35 am

    Any obvious reason why this would show up in Firefox, but not Safari or IE?

  142. Sharedtut on February 4th, 2010 4:02 am

    This is a very useful script, thank you for sharing.

  143. Loren on February 25th, 2010 1:00 am

    Jared, you are the MAN!

    Your slideshow here http://jared.simplistika.com/actionscript-3-dynamic-xml-slideshow/ is awesome. It works flawlessly for me and I have been able to manipulate it to look and act exactly the way I want it to.

    Is there a way to pass hyperlinks from the XML file through to the flash file? I am having great difficulty finding a way to do this and the forums I have been to make it sound like its impossible. Please say it ain’t so!

  144. Dirk on March 18th, 2010 4:06 am

    This is great!
    In the previous version, you provided a solution to control the time of each picture individually in the XML sheet. How can I modify the .as file for this?
    Thanks!

  145. sardsch on April 7th, 2010 8:21 pm

    Hi Jared! How can I add hyperlinks to each image from within the xml?

  146. Peter on April 29th, 2010 9:05 am

    Hi guys, this is a pretty stupid question but how do you remove/resize the outer border line. I don’t see it in the action script file or anywhere. Can anyone help me. Thanks.

  147. Peter on April 29th, 2010 9:11 am

    Never mind I figure it out. :)

  148. Kieran on June 16th, 2010 8:47 am

    Very nice – can you tell me how do you go about adding a simple preloader to the slideshow?

Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!