A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: i need help with loops

  1. #1
    Junior Member
    Join Date
    Jul 2004
    Posts
    7

    i need help with loops

    Hi !!!

    Help wanted !!!! i am newbie to flash....
    I have created a movie where in there are 6 rectangles with different colors. I want that when i play the movie one by one color in the rectangle should pop up & continue till i close the file. I am attaching an .fla file for yr refrence so that u can give me pointers.
    i think i have to use some loop but not sure how to do ....

    Thankx
    Last edited by ni_ygs; 07-23-2004 at 07:55 PM.

  2. #2
    Expand Your Element Color420's Avatar
    Join Date
    Feb 2001
    Location
    Chicago
    Posts
    265
    I am not quite sure what you want to do w/ the rectangles. Can you find an example?

    I can tell you that you will probably have to change the rectangles to a Movie Clip Symbol instead of a Graphic Symbol. You'll probably need to add in the animation your looking to do. Then, you will need to add an action on the last keyframe coded like this:

    gotoAndPlay(1)

    This will tell controller to go back to the first frame and keep on moving!

    Hope this helps. Again more info on what your trying to do WITH the rectangles would help...tho I've got some ideas!

    Valerie
    ||| Valerie |||

    EXPAND YOUR ELEMENT

  3. #3
    Junior Member
    Join Date
    Jul 2004
    Posts
    7
    Thanks for the reply. Although I think the concept is simple but I couldnt search for some examples on the web that show it. So I will try to explain in words. Since there are 6 rectangles, lets call the left most rectangle 1 and right most the 6th. The end result of the .swf should be that the first no.1 rectangle should show up ( only the 1) and then the 2nd and then the 3rd .. sequentially till the 6th . For a moment all 6 should be visible and then they all dissappear and begin the loop with the rectangle no.1 showing up agian on the left side and then the rest show as described. The letters ctms should be constant/fixed.

    I am not sure how this can be done. Thank you agian for your reply

  4. #4
    Expand Your Element Color420's Avatar
    Join Date
    Feb 2001
    Location
    Chicago
    Posts
    265
    Ok This is easy. What you need to do is create a Movie Clip with the animation in there. So, what I would do, is create 6 layers and have one rectangle on each layer. Then, I would take your rectangle graphic symbol and edit it to the FULL color you want for the last rectangle (blue I think it was)...then, use the alpha at 0 to start and have it just move all the way to full color. Play with the Motion Tweens and timing...will take a bit of trial and error, but you'll get it!

    I can play around with the animation later and attach...so let me know if you still can't figure out how to make the animation work. I can't do it now though just got into work.


    valerie
    ||| Valerie |||

    EXPAND YOUR ELEMENT

  5. #5
    Junior Member
    Join Date
    Jul 2004
    Posts
    7

    i need help with loops

    Thankx Valerie....

    I did as per what u said. Made layers for every rectangle & motion tweened them & changed color to alpha but as u can see in the attached file that all the colors disappear at the same time....

    1] I want that one rectangle should dissappear then the next one & so on...

    2] In yr earlier mail u had told me to add action script to the last keyframe so that a loop is formed & rectangles can keep popping up continuously...but when i play the rectangles pop up only once & dont play again ....

    Please help...
    Last edited by ni_ygs; 07-23-2004 at 07:55 PM.

  6. #6
    Expand Your Element Color420's Avatar
    Join Date
    Feb 2001
    Location
    Chicago
    Posts
    265
    k i played with your file and I attached it...lemme know if this is what your looking to do.

    A few things though...I assume you are new to flash...so I'm gonna give ya a few tips...

    First, if you want a specific element, such as yours to repeat, it needs to be inside a movie clip so it can be independant from the timeline. This is especially good if you plan to have more things going on in that movie....

    As for the loop, you confuesed the timeline and it got screwed up because you added an action to the end of EVERY rectangle animation. The way to make that work is to simply use ONE ACTIONSCRIPT loop at the VERY END of the MC which tells it to just keep playing....but it needs to be in an MC, otherwise, your just replaying your whole movie...also MCS in this instance make it easier to update later on...

    Also, it helps when designing in flash to use layers to keep things organized...

    So, anytime your using actionscript, you should create a top layer and call it ACTIONS...see the rectangle MC for example...

    Same with frame labels...use a sep. layer...to keep organized...

    As for your rectangles not doing what you wanted them to do, you just had to move the keyframes around on the timeline so that they are timed right. YOu had it so all the rectangles fade in all at once. Hope that makes sense.

    I think you will understand when you see the attached file!

    I've been working in flash for over 6 years now, and I still don't know everything! Takes a lot of time and practice..especially with animation, but it'll come to ya, and before you know it, you'll be busting out some kick ass work, and helping other's on the forum!

    let me know if you have anymore questions, glad to help ya out!

    Valerie
    Attached Files Attached Files
    ||| Valerie |||

    EXPAND YOUR ELEMENT

  7. #7
    Junior Member
    Join Date
    Jul 2004
    Posts
    7

    i need help with loops

    Thankx Valerie,

    Its was really great after looking at the file. This is what i wanted. Thank you so much for removing time from yr work to make a file as well as explain me.

    Ofcourse by now with all the silly questions i have asked you ....u have come to know that i am very new to flash . i had no idea that in MC u could create everything ...like in our exmaple rectangle MC...I was under impression that we have to do everything in Scene 1 only....

    Definately i have got an idea & would explore more on it. Do u recommend any books or web sites which has easy tutorials to understand ???

    Thankx once again.
    Nilofar

  8. #8
    Expand Your Element Color420's Avatar
    Join Date
    Feb 2001
    Location
    Chicago
    Posts
    265
    Hi there,

    It's no problem, after all the help I've received on Flash Kit over the years, I try to hit the forums to answer the questions I feel I can answer. I love this community, and you'll grow to love it too!

    MCS are something you will be using quite often, trust me! It allows for some great interactivity, and opens up a world of ideas!

    Also, just a little tip when doing Web Design: USE External SWF Files.....when you start getting more into that..there are tons of tutorials on that as well...

    There are SO MANY RESOURCES it's sick!!

    First off, tutorials and taking apart movies are a great way to learn, that's how I did. Also just doing real world work and learning as I go - learning new things as needed! Still doing that...there is SO MUCH to flash that you could go crazy trying to learn it all...baby steps i say!

    Anyways this website is a great start. Flash kit has so many tutorials and example FLA downloads in the movies section. That should help you. But, below, are links to other resources:

    www.actionscript.org
    www.flashgoddess.org
    http://www.echoecho.com/flash.htm
    http://www.macromedia.com/software/f...nfo/tutorials/
    http://www.kirupa.com/
    http://www.cbtcafe.com/flash/

    You can find tons more by doing a google search for 'flash tutorials'


    as for books, The top two I'd recommend are the Macromedia Books put out by Macromedia - they have intro and advanced books.

    In my opinion this one is the best: the Visual Quick Start Guide books..>EXCELLENT! They have advanced and intro books as well...this one is a MUST HAVE I THINK...

    Please let me know if I can be of anymore help to you. Have fun flashing!

    and well ok, third..
    ||| Valerie |||

    EXPAND YOUR ELEMENT

  9. #9
    Junior Member
    Join Date
    Jul 2004
    Posts
    7

    help wanted for text loop

    thankx for all the info....

    Now on that file i have made some additions. i am attaching that fle for yr reference.

    Now this Clinical Trial Management Systems(a text) which appear below the rectangle ...comes flying....that is good but what is happening is it keeps playing again & again .

    I want it to play once & only rectangles should play continuosly....
    I think the actionscript added is affecting the text as well. How should i stop it.

    Help
    Nilofar
    Last edited by ni_ygs; 07-23-2004 at 07:56 PM.

  10. #10
    Expand Your Element Color420's Avatar
    Join Date
    Feb 2001
    Location
    Chicago
    Posts
    265
    k that was easy...i attached the file back and changed your ctms txt animation MC. I added in a layer called ACTIONS. in the last frame, I added a Keyframe with an action on it:

    stop();


    THIS will probably be the most widely used code you will end up using in flash, and one of the most important...

    technically, an MC will loop if you do not put a stop action at the last keyframe...

    I use stop actions often when creating navs and websites...
    Attached Files Attached Files
    ||| Valerie |||

    EXPAND YOUR ELEMENT

  11. #11
    Junior Member
    Join Date
    Jul 2004
    Posts
    7
    Thanks....

    As per yr statement "MC loops unless u put a stop action" means that whenever a MC is created it will keep playing even without a gotoAndPlay(); action ?????

    In this case ctms text i made a MC even if i would have made it a grahpic would it work the same ???

    I think i am not very sure when to use MC & when to make a graphic ???

    Nilofar

  12. #12
    Expand Your Element Color420's Avatar
    Join Date
    Feb 2001
    Location
    Chicago
    Posts
    265
    MCS SHould be used when you want them to play INDEPENDENTALY From the timeline. It will continue to play over and over again (OR if you want it to stop after playing once - use a stop action . =) ). MCS are used for Navs, they are used for animated graphics, they can be used as a part of many things!

    I suggest you pick up a book on Flash. Either the Book by macromedia, or the Visual Quick Start Guide. They will help you out quite a bit.
    ||| Valerie |||

    EXPAND YOUR ELEMENT

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