A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: help with clip....

  1. #1
    Junior Member
    Join Date
    Aug 2003
    Posts
    12

    clip with self contained script....

    Hi i am not an experienced flash user, but i've been using it for a little bit now.

    I have a rectanglular fill as a movie clip and all i want to have it do is flash (by changing colors) when i rollover it with the mouse.
    I figured out how to do it by putting code in the same timeline that i put the movie in, but i have many different instances of this movie and i would like to create a self contained movie clip, where i can stick it anywhere and it will flash when i roll over it. (I have it flash with 2 separate frames of different colors.)
    Last edited by opeleg; 08-15-2003 at 12:12 PM.
    Thanks,
    Omer Peleg

  2. #2
    ¤ ¤ ¤ PAZ ¤ ¤ ¤ nordberg's Avatar
    Join Date
    Nov 2000
    Location
    east of west
    Posts
    4,704
    hi there, and welcome to the kit....

    i think i understand what you are asking. it sounds like you have a movieclip of a rectangle with 2 frames - frame 1 is the rectangle with color A, and frame 2 is the same rectangle with color B. it also sounds like you are using code on the main timeline to tell this move clip to flash when the cursor is over it. the only thing i could not determine from your question is whether the rect. is suppose to switch to color B when you rollover, and back to color A when you roll off -OR- when you rollover the rect it is suppose to toggle quickly (flashing the two colors) until the roll out. i will answer this post as if it was the former rather than the latter...

    OK, all you need to do is create a new layer in your rectangle movie clip. create an invisible button on the new layer that is the same size as the rectangle (to do this, just put a fill in the hit state frame only). attach this code to the button:
    Code:
    on (rollOver){
    	gotoAndStop(2);
    }
    
    on (rollOut){
    	gotoAndStop(1);
    }
    so when the user rolls over the rectangle, the clip goes to frame 2. when the user rolls off the rectangle, the clips goes to frame 1. now you can go back to your main timeline and put instances of the rectangle movieclip anywhere you want.

    hope that helps, nords.

    Ah, these boys is all swelled up. So this was earlier...getting set to trade. Then, woooaaah differences.
    Blog ¤ Photos ¤ Book

  3. #3
    Junior Member
    Join Date
    Aug 2003
    Posts
    12

    movie

    thanks a lot, sorry for not being more specific but it was the latter, toggle quickly between the 2 colors to pose a flash effect.

    this is what i tried if you can take a look and help out cause its not working.

    www.dti-us.com/rollover2.fla

    thanks
    Thanks,
    Omer Peleg

  4. #4
    Junior Member
    Join Date
    Aug 2003
    Posts
    12
    is it just me or does flash give guys a lot of stupid problems such as this one?

    Can you help me out on why adding buffer frames would help?

    thanks
    Thanks,
    Omer Peleg

  5. #5
    Junior Member
    Join Date
    Aug 2003
    Posts
    12

    Another Problem

    ok thanks everyone that has helped me get this simple problem to work correctly. I have now run into a new problem. My intention for this movieclip was to have it rest behind thumbnails so that it has a nice effect when you rollover it with the mouse. when you click on it opens an image in a new window. All this i have working fine, including the javascript. But when i add any code to the movie clip it stops blinking.

    you can visit my website at http://www.dti-us.com

    and you can see the problem i'm having here:

    http://www.dti-us.com/rollout3.fla

    in the file you can see one is blinking and one is not, and the only difference is the code on the movieclip, which should have no effect.

    Thanks again
    omer
    Thanks,
    Omer Peleg

  6. #6
    Junior Member
    Join Date
    Aug 2003
    Posts
    12

    movie

    can you please post the fla as well?
    did you fix it so that its still nested? because i need the blinking effect to be self contained in the movie.

    thanks
    Thanks,
    Omer Peleg

  7. #7
    Junior Member
    Join Date
    Aug 2003
    Posts
    12

    movie

    what? he posted the swf, i want to see how he did it.
    Thanks,
    Omer Peleg

  8. #8
    Junior Member
    Join Date
    Aug 2003
    Posts
    12

    movie

    i did use your .fla

    you didnt fix my problem, you just added a frame to buffer.
    the only reason that worked, was because the first time i had gotoAndPlay on the same frame of the new color, and it went back to the old color before it even loaded the new frame.

    That you didnt know and you fixed it by fluke.

    you probably didnt even fix the last one because you probably removed the nested clips.
    Thanks,
    Omer Peleg

  9. #9
    Junior Member
    Join Date
    Aug 2003
    Posts
    12
    Originally posted by oldnewbie

    What you didn't notice is that I had given names to your clips instances and coded them on the first frame with functions.
    Dont you know that wouldnt change a thing?
    Thanks,
    Omer Peleg

  10. #10
    Junior Member
    Join Date
    Aug 2003
    Posts
    19
    Dude, all you have to do is create a button. Then, on the over frame, create a movie clip that flashes and put it in there. Its that easy.

  11. #11
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397

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