A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Fade Effect

Hybrid View

  1. #1
    Member
    Join Date
    Jan 2006
    Posts
    44

    Fade Effect

    I've got an image that is 50% transparent. I want there to be no tranparency on it when I put my mouse over it. Any ideas on how to do this?

  2. #2
    Senior Member pherbrick's Avatar
    Join Date
    Jul 2004
    Location
    Los Angeles
    Posts
    291
    Quick and dirty solution:

    1) Convert the image to a button,
    2) Copy the Up state to the Over state
    3) Set the transparency to 0% on the image in the Over State
    4a) If you need a transition from 50% to 0%, before step 1 above, copy the image to a movie clip and create a multiframe clip, w/ image on first frame starting at 50% and image on last frame at 0% transparency. Don't forget to put a stop() on the last frame or you will have a cycling image.
    4b) After step 1) above, create a blank Over state and cut and paste the clip from the stage to the button's Over state; disregard steps 2) and 3).
    5) Create a Down state.

  3. #3
    Member
    Join Date
    Jan 2006
    Posts
    44
    That's what I tried to start off with but when I play movie it comes up as 0% transparent

  4. #4

  5. #5
    Senior Member pherbrick's Avatar
    Join Date
    Jul 2004
    Location
    Los Angeles
    Posts
    291
    Quote Originally Posted by bailyesboy
    That's what I tried to start off with but when I play movie it comes up as 0% transparent
    Did you adjust the transparencies within the states?

    I found I ccouldn't keep the Over state from cycling each time the mouse was clicked. For that reason, using a movie clip is better. I was working on a movie clip version when Chris beat me to posting (his looks much nicer than mine).

  6. #6
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Mine is just like Peter mentions, a MovieClip as a button. If you want the look of a component button (drop in) but the added benefit of a movieclip just convert your onstage component button to a clip:

    http://flashnow.servebbs.com/example...ttonFade2.html


    There are literally dozens of ways to skin this cat.

  7. #7
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Exchange example approved and ready for download

  8. #8

  9. #9
    Member
    Join Date
    Jan 2006
    Posts
    44
    Thanks

  10. #10
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357
    why dont u guys use "hit test" much more easy

    just ad this to any movieclip:

    Code:
    onClipEvent (enterFrame) { 
    t = this.hitTest(_root._xmouse, _root._ymouse, 0); 
    //fade out
    //_alpha += (10*t*(_alpha<0)-10*!(t)*(_alpha>100)); 
    //fade in
    _alpha -= (20*!t*(_alpha>0)-20*(t)*(_alpha<100)); 
    
    }
    Does anyone know how to use this script but with blur for example? Or is it even possible?
    /xzerox... Take a look at http://www.vmgcomputers.com/h75

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