Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 40
  1. #16
    Regular Coder
    Join Date
    Mar 2006
    Posts
    202
    Thanks
    27
    Thanked 2 Times in 2 Posts
    Hey - Thanks. That was helpful. Flash can be a bit of a mind bender when you don't know what you're doing!
    I think I'm going to have to go for the 2 mc's, as I can't think how to do the button. Each image links to a separate page. If I had to mc's I could load the url and button over the t op of each instance of mc.
    What do you think?

    Thanks again.

  2. #17
    Regular Coder
    Join Date
    Mar 2006
    Posts
    202
    Thanks
    27
    Thanked 2 Times in 2 Posts
    Ok I can't get this to work at all. Nothing but errors.

  3. #18
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    I can imagine that it would require a large overhaul of the code, meaning lots of problems. How are you going about it?
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  4. Users who have thanked gnomeontherun for this post:

    huntelar (10-06-2008)

  5. #19
    New to the CF scene
    Join Date
    Nov 2008
    Location
    Cronulla, Sydney Australia
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,
    Thanks very much. This code is exactly what i was after. It works almost perfectly.
    The one problem i have though is....
    When i open the code up the first time it works perfectly, but when i view a different page and then reopen the swf file containing the slideshow, it all goes pear shaped.
    Please view here. http://www.semantics53.com

    Any ideas why?

  6. #20
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Not sure, did you make individual swfs for each of your pages? Or are they one swf on different frames?

    Perhaps you have some variables that are being reset?
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  7. #21
    New to the CF scene
    Join Date
    Nov 2008
    Location
    Cronulla, Sydney Australia
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The links at the bottom all load individual swfs.

  8. #22
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Are you reloading the content each time? Do you have code for the FLA to show?
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  9. #23
    New to the CF scene
    Join Date
    Nov 2008
    Location
    Cronulla, Sydney Australia
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry about the late reply. The code is really basic. On load i have the following to load the slideshow._root.load_movie.loadMovie("images_mainR.swf");
    Then when you load a different MC from the menu

    on (release) {
    unloadMovie("images_mainR.swf");
    unloadMovie("riders.swf");
    unloadMovie("contact.swf");
    _root.load_movie.loadMovie("items.swf");
    }

    Then finally to reload the slideshow:

    on (release) {
    unloadMovie("items.swf");
    unloadMovie("riders.swf");
    unloadMovie("contact.swf");
    _root.load_movie.loadMovie("images_mainR.swf");
    }


    Thanks for helping

  10. #24
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    I don't see a pearshaped problem, only that the slideshow is twice as fast when I go back to it...but I can't seem to think of a good reason for that one at the moment...

    There was also just an issue with your code causing my browser to crash. I don't think this has anything to do with the slideshow...
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  11. #25
    New to the CF scene
    Join Date
    Mar 2009
    Location
    Oakland
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for your generous help!

  12. #26
    New to the CF scene
    Join Date
    Mar 2009
    Location
    Oakland
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The slideshow works great; my only question is what if you want to use more than 26 images in the rotation in your xml file? After you go through the letters of the alphabet, how does the "numbering" system continue?

    ...
    <y title = "images/random_chamber_Tom-Bill.jpg" />
    <z title = "images/random_chamber_CR2.jpg" />
    ?

    Thanks,
    Anastasia

  13. #27
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Anastasia,

    It actually doesn't matter what you name the tag. The Actionscript pulls them line by line, so they could (and I would recommend actually) all be the same. It does this by accessing the <images> node and then getting each child, and as long as there is a title attribute it should work, as that is the only value that is kept. In fact that is a rather odd thing to have been done by the original designer, and I just never mentioned it but I had been doing something like this.

    Code:
    <xml>  
    <images>  
    <img title = "pic1.jpg" />  
    <img title = "pic2.jpg" />  
    <img title = "pic3.jpg" />  ...etc...
    </images> 
    </xml>
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  14. #28
    New to the CF scene
    Join Date
    Apr 2009
    Location
    Holland
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    @jeremy: tnx for your great code

    I want to use it as a header where people can click on the showing picture and go to that page.

    as:
    Code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    
    pauseTime = 2000;
    
    xmlImages = new XML();
    xmlImages.ignoreWhite = true;
    xmlImages.onLoad = loadImages;
    xmlImages.load("images.xml");
    
    function loadImages(loaded) {
        if (loaded) {
            xmlFirstChild = this.firstChild;
            imageFileName = [];
            imageUrl= [];
            totalImages = xmlFirstChild.childNodes[0].childNodes.length;
            for (i=0; i<totalImages; i++) {
                imageFileName[i] = xmlFirstChild.childNodes[0].childNodes[i].attributes.title;
                imageUrl[i] = xmlFirstChild.childNodes[0].childNodes[i].attributes.url;
            }
            randomImage();
        }
    }
    function randomImage() {
        if (loaded == filesize) {
            var ran = Math.round(Math.random() * (totalImages - 1));
            picture_mc._alpha = 0;  // Start image clip as invisible
            picture_mc.loadMovie(imageFileName[ran], 1);  //Load random image from xml
            var pictureTweenIn:Tween = new Tween (picture_mc,"_alpha",Normal.easeIn,0,100,1,true); // Use the Tween class to ease in the alpha from 0 to 100 over 1 seconds
            pictureTweenIn.onMotionFinished = function () { // When done fading
                _root.pause();  // Start pause() function
            }
        }
    }
    function pause() {
        myInterval = setInterval(pause_slideshow, pauseTime);
        function pause_slideshow() {
            picture_mc.onRelease=function(){
               getURL(imagesUrl[ran], "_parent");
            } 
            clearInterval(myInterval);
            var pictureTweenOut:Tween = new Tween (picture_mc,"_alpha",Normal.easeOut,100,0,1,true); // After pause, start fade out
            pictureTweenOut.onMotionFinished = function () { // Once faded out
                _root.randomImage();  // Call next randomImage()
            }
        }
    }
    xml:
    Code:
    <xml>  
       <images>  
          <img title = "hamminga.jpg" url="http:www/hamminga.nl/hamminga"/>  
          <img title = "kleding.jpg" url="http://www.hamminga.nl/hamminga/winkel/kleding" />
          <img title = "tuin.jpg" url="http://www.hamminga.nl/hamminga/winkel/tuin"/>
          <img title="hout.jpg" url="http://www.hamminga.nl/hamminga/bouwmaterialen/houtmateriaal"/> 
        </images>
    </xml>
    When i click on the picture i get the page "http://www.hamminga.nl/hamminga/undefined".
    And when i trace imageUrl[ran] inside the function randomImage the url works but then i can't click on the picture. so i have to put the geturl in the function pause but then i get undefined.
    So how do i get the var ran in the function pause?
    Last edited by spike1292; 04-13-2009 at 08:29 PM.

  15. #29
    New to the CF scene
    Join Date
    May 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I need this get to work on my handset
    nokia 6300 with flashlite 2.0

    Don't work as screensaver!!

    It seems that the problem is in the xml file (The phone only
    reads the swf file) , although
    plays well every time I openup normally..

    I need some help for embbeding the xml into the actionscript

    If there's a better way to do a slideshow without xml would be great!
    like a folder with images and a standalone swf!!

    Anyone can help me with this?
    Thanks so much

    Aldo

  16. #30
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    If you want to include XML directly in the file its pretty simple.

    Change

    Code:
    xmlImages = new XML();
    xmlImages.ignoreWhite = true;
    xmlImages.onLoad = loadImages;
    xmlImages.load("images.xml");
    To

    Code:
    xmlImages = new XML("<xml>  
       <images>  
          <img title = 'hamminga.jpg' url='http:www/hamminga.nl/hamminga'/>  
          <img title = 'kleding.jpg' url='http://www.hamminga.nl/hamminga/winkel/kleding' />
          <img title = 'tuin.jpg' url='http://www.hamminga.nl/hamminga/winkel/tuin'/>
          <img title='hout.jpg' url='http://www.hamminga.nl/hamminga/bouwmaterialen/houtmateriaal'/> 
        </images>
    </xml>");
    xmlImages.ignoreWhite = true;
    xmlImages.onLoad = loadImages;
    Make sure that inside of the " " only ' are used.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


 
Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •