A Flash Developer Resource Site

Results 1 to 20 of 20

Thread: How can I continously move and loop images vertically and evenly spaced?

  1. #1

    How can I continously move and loop images vertically and evenly spaced?

    HI, I have approx 10 images of varying height that i want to continuously move down the page and loop... so they infintily scroll down and just keep repeating in a loop. I need these evenly spaced with eg 30px inbetween each one, but they are different heights

    My actionscripting knowledge is still fairly low and Im not too sure how to go about this. Moving them with onEnterframe is no problem I know that much. its the spacing and correct repositioning of them in the to start the loop again im not sure on

    I have given all my Mc's LInkage names of image1, image2 etc.
    I then want to attach them to the stage spaced evenly, then I want them to move down the stage and when they reach the bottom move up to the top of the list spaced correctly and continue moving.

    Itd be geat if it was easy to add more images if needed.
    heres what i have so far which isn't working properly with spacing them out...any help would be great !...cheers, thanks in advanec,..Dave


    //attach the mc's and space them evenly
    for(i=1; i<6; i++) {
    attachMovie("image"+i,"image"+i,i)
    this["image"+i]._y = this["image"+(i-1)]._height + 30;
    trace(this["image"+i]._y)
    }

  2. #2

  3. #3
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    upload your fla in mx 2004 .. cheers
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  4. #4
    HI, cheers for this, Ive attached the file. but as i mentioned i havent got very far. The MC's are just coloured rectangles at the moment for getting it to work.

    Thanks again!
    Attached Files Attached Files

  5. #5
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    Actually have a look at this thread http://board.flashkit.com/board/show...ighlight=cloud basically its the same thing except the clouds are moving from left to right..but the principles are the same
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  6. #6
    HI thanks for the quick reply.
    I looked at that thread. the thing is with that it just resets the position when it reaches the bottom of the stage to be at the top again.... what i need is to reposition it to the top of all the other images.. so i have all the images in a row scrolling down and repeating infinitally

    they need to be spaced evenly and all scrolling down the age and give the impression ov a contious loop that keeps going.. any ideas how to do this?
    cheers

  7. #7
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    it repostions in in such a way that it appears to be continously looping..try out the file and see
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  8. #8
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  9. #9
    Thanks again.. I understand this fine, But these mc's change position which is not what i want.

    I need all the images to stay in a neat row all the time! So its a smooth scroll of images in a line, evenly spaced that loop.
    I found this fla in another forum. I need it like this, but without the mouse control, and vertically

    cheers
    Attached Files Attached Files

  10. #10
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    here sorry dont have time to look at it cause at work..but ive updated my file..now they will all retain same position

    http://www.experiments.flashmatics....shkit/loop.html
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  11. #11
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    this will add them dynamically if u like and then start to move them ..create an mc with linkage name mcBox..

    Code:
    Stage.scaleMode="exactFit";
    
    var SW:Number = Stage.width;
    var SH:Number = Stage.height;
    
    var speed:Number = 5;
    
    var noChild:Number = 5;
    var movie:MovieClip;
    var mcHolder:MovieClip = _root.createEmptyMovieClip("mcHolder", _root.getNextHighestDepth());
    
    //attach mcs
    for(var i:Number=1; i<=noChild; i++){
    	movie = mcHolder.attachMovie("mcBox", "mcBox"+i, mcHolder.getNextHighestDepth());
    	movie._x = SW * Math.random();
    	movie._y = SH * Math.random();
    	movie._xscale = movie._yscale = 125*Math.random();
    }
    
    //move
    _root.onEnterFrame = function(){
    	mcHolder._y += speed;
    	if(mcHolder._y > SH){
    		mcHolder._y = - mcHolder._height;
    	  }
    }
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  12. #12
    Thanks for this i really appreciate it !
    The link http://www.experiments.flashmatics....shkit/loop.html doesent work, so i copied you code into my fla, but i still cant get it to work.

    I dont need any random scale positions or anything, i simple want the images all in a neat straight row!... so i took out the math.random functions but couldnt get it right. do I put all of the images into one movieclip called mcBox

    this is wghat i managed to do with you code which is nearly correct expect for the horrible gap when it loops
    I know your busy now , so ill keep looking into it.. cheers
    Dave
    Attached Files Attached Files

  13. #13
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    np..the code will automatically put the images in the movieclip u dont need to do that urself... heres the fla http://www.experiments.flashmatics.c...ynamicloop.fla
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  14. #14
    cheers, Ok...theres no way of me explaining what i want without showing you.. so i have found exactly what i want.. (attached) but the only difference is i dont want it controlled my a mouse movement.

    the file you have done for me is great, but as i mentioned i really need these images vertically, and NOT just snapping back to ._y = 0, i need them to pop to the top of the row of images so they all run
    1) in a row, with even gaps
    2) stay in there positions in the row. like an image gallery!

    this row of images will be a lot higher then the stage height.
    Thanks again
    Attached Files Attached Files

  15. #15
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    check out photoloop.fla in using the above url
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  16. #16

  17. #17
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  18. #18
    Thats wicked THANK YOU !!!!!!
    I cant beleieve all i needed was
    ---------------------
    speed = 5;

    mcFoto.onEnterFrame = function() {
    this._y += speed;
    if (this._y>-5) {
    this._y = -this._height/2;
    }

    };

    ----------------------
    PS are you a 3d animator, i saw some ewicked animations on the experiment site of a mouse, and your site. I ask cos Im a motion graphics/ web designer for a copmany in london and do maya work, which is what i love most

    cheers, dave

  19. #19
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    your welcome np na those arent my videos..although would liek to get into 3d as well..those movies were downloaded from http://www.archive.org/index.php

    P.S of ur company ever needs any flash development/database etc freelance work I'm here lol
    Last edited by silentweed; 07-27-2006 at 08:16 AM.
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  20. #20
    we have in house developers but i couldnt ask them about this cos it was for personal and in work time... likewise.. if you need any motion graphics or 3d,let me know LOL
    again cheers for the help
    www.davidmattock.co.uk

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