A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: xml slideshow help needed...

  1. #1
    Abandon all Hope Inflicted's Avatar
    Join Date
    Aug 2003
    Location
    Harlem A+, Netherlands
    Posts
    296

    xml slideshow help needed...

    I copied a slideshow, it uses xml. How can I change the script and make the slides fade in/fade out? I know nothing about xml. Have enough trouble trying to learn AS! Anyone can help?

    regards


    code:

    <Slides>
    <slideNode jpegURL="images/image1.jpg">Pirat</slideNode>
    <slideNode jpegURL="images/image2.jpg">Sea anemone</slideNode>
    </Slides>
    regards

  2. #2
    Abandon all Hope Inflicted's Avatar
    Join Date
    Aug 2003
    Location
    Harlem A+, Netherlands
    Posts
    296

    the code

    code did'nt come through....sorry..

    <Slides>
    <slideNode jpegURL="images/piraat_bn.jpg">Pirat</slideNode>
    <slideNode jpegURL="images/image2.jpg">Sea anemone</slideNode>
    <slideNode jpegURL="images/image3.jpg">Sardines!</slideNode>
    </Slides>
    regards

  3. #3
    Abandon all Hope Inflicted's Avatar
    Join Date
    Aug 2003
    Location
    Harlem A+, Netherlands
    Posts
    296
    One more time!
    Could'nt copy the code.
    Here's the file...
    Attached Files Attached Files
    regards

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    replace this function:

    function updateSlide(newSlideNode) {
    imagePath = newSlideNode.attributes.jpegURL;
    slideText = newSlideNode.firstChild.nodeValue;
    targetClip._alpha = 0;
    loadMovie(imagePath, targetClip);
    myAlpha = new Object();
    myAlpha.intervall = function(){
    if (targetClip._alpha <100){
    targetClip._alpha +=5;
    } else {
    targetClip._alpha = 100;
    clearInterval(myTimer);
    }
    }
    myTimer = setInterval(myAlpha,"intervall",50);
    }
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Abandon all Hope Inflicted's Avatar
    Join Date
    Aug 2003
    Location
    Harlem A+, Netherlands
    Posts
    296

    newbie shoutout!!!

    As a newbie, I think these forums are great. BUT!!!!
    It's so easy to just copy codes and move on. Your movie works, but you don't understand sh*t what you've done....
    I think tutorials are a good way of learning,
    so guys at Flash Kit. PUT SOME MóRE TUTS ON THIS WEBSITE!!!

    Again, you guys are great,
    regards

  6. #6
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I don't go into details of this code because it is a different chapter:
    function updateSlide(newSlideNode) {
    imagePath = newSlideNode.attributes.jpegURL;
    slideText = newSlideNode.firstChild.nodeValue;

    To fade in something you have to first make it invisible by setting the alpha value to 0. The holder for your pics is targetClip and so you write this line:

    targetClip._alpha = 0;

    then you load your movie, pic or whatever into targetClip:

    loadMovie(imagePath, targetClip);

    now comes the fade in function, which we can do in different ways but I think it is clean AS to use the interval object. So we create a new object:

    myAlpha = new Object();

    Now the object will be filled with a function:

    myAlpha.intervall = function(){

    The next lines mean in other words that if the alpha of targetclip is smaller than maximum (100) then continously increment the alpha value starting from 0 by a value of 5. You can add other values here of course.

    if (targetClip._alpha <100){
    targetClip._alpha +=5;

    if 100 is reached

    } else {
    targetClip._alpha = 100;

    we stop the function

    clearInterval(myTimer);
    }
    }
    here we set the function with all the arguments and give a function name. The last number are the milliseconds interval the function is called. You can also change this value. When the value is higher the function will be called in less frequent intervals. Now whenever the function is called the alpha value of targetclip will increase by 5 or the value you enter until we stop it with clearInterval.

    myTimer = setInterval(myAlpha,"intervall",50);
    }

    Hope this helps. But there are many tutorials here on Flashkit where you find explanations for what you are looking for. Also since this question is not really related to xml you should have gone to a different forum.
    Last edited by cancerinform; 09-06-2003 at 07:39 PM.
    - The right of the People to create Flash movies shall not be infringed. -

  7. #7
    Abandon all Hope Inflicted's Avatar
    Join Date
    Aug 2003
    Location
    Harlem A+, Netherlands
    Posts
    296
    cancerinform,

    The reason I posted this was to cause a reaction. I got more reply's on this than of the initial post!

    Anyway, for a newbie like me, some of these codes look a lot like math. And that wasn't my favourite subject at school!
    But, than again, it's cool people wanna help eachother out.
    I started using Flash 4 weeks ago, and I'm improving!
    Still, I'm actualy a painter...

    Thanks again!

    regards
    regards

  8. #8
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I added a fadeout function. Have a look you will understand now.
    Your homework is now to make the fadeout function for the back button
    Last edited by cancerinform; 09-07-2003 at 11:48 AM.
    - The right of the People to create Flash movies shall not be infringed. -

  9. #9
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I added some extra effect to the slideshow. Check here after your homework:
    http://www.flashkit.com/board/showth...hreadid=488665
    - The right of the People to create Flash movies shall not be infringed. -

  10. #10
    Abandon all Hope Inflicted's Avatar
    Join Date
    Aug 2003
    Location
    Harlem A+, Netherlands
    Posts
    296
    Thanks for your help, but it's maybe a step to far at this moment. Still I will
    try to get through these codes.

    I saw your website, prety cool and nice tuts.

    regards
    regards

  11. #11
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Thanks.
    Don't forget. This your thread. You can always ask questions if you don't understand
    - The right of the People to create Flash movies shall not be infringed. -

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