SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Actionscript based Slide show for Flash 5?

    Hey there guys...

    I'm looking for something that I would think would be fairly simple. I've got 6 images that I need to flip through in a Flash ecard that I'm building.

    I do this fairly often and each time until now it's been manual. I'm getting tired of manually setting keyframes for each of these images so what I'd like is to automate this somewhat.

    A great way to do it would be to set each image on a keyframe, then code some sort of time function that would jump to the next frame after a preset amount of time had elapsed.

    Does anyone have something like this or can you point me in the right direction?


    andy

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you need any kind of transition effect? Or is just straight jump from one image to the next until they are done then start at the beginning again?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay here is the easiest way to do it. I have one empty clip on the stage with an instance name of holder. This is placed where you want the images to show up.

    Now I have a mc named controller sitting off the left edge of the stage. In it I have the number of seconds times the fps, normally 12 frames per second, so if I want the images to change every 3 seconds, I would put 36 frames into the controller clip. In the first frame of controller I have this

    Code:
    _root.swapImage(_root.imgCnt);
    _root.imgCnt++;
    if(_root.imgCnt > _root.numImages) _root.imgCnt = 1;
    On the root timeline in frame 1 I have
    Code:
    _root.numImages = 6;
    _root.imgCnt = 1;
    function swapImage(which) {
     holder.attachMovie("pic"+which,  "pic"+which, 0);
    }
    Each image is in a clip with a linkage name of pic1, pic2, etc...


    I can't show you the fla because its in MX, and once I create it in MX it won't be able to be opened in %. Unless you have MX.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  4. #4
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Louie!

    Comin' through for me again. Thank you sir. I wish I was better at thinking stuff like this up.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

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