A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Making A Button Flicker

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Posts
    449

    Making A Button Flicker

    Hi all, onRollOver I am trying to make my button Flicker on/off but cannot get it too work, the best I can do is get it to go to alpha 60 and then back to 100...

    Code:
    newBut.onRollOver = function() {
    			if( cnt < 100){
    // Reduce alpha.
    // Lower this for more dramatic effect.
    this._alpha = 60;
    this._alpha = 100;
    cnt++;}}
    Thanks in advance!

  2. #2

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Posts
    449
    You don't say

  4. #4
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    not sure i understand fully ... when u rollover it you want it to fade to alpha 60 and when you rollout back to alpha 100?
    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

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Posts
    449
    Hiya silentweed... When I rollOver it I was trying to get it to go to alpha 60 and quickly back to 100 and loop over and over until the user roll off...

  6. #6
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    this should do the trick:

    PHP Code:
    newBut.onRollOver = function():Void{
        
    this.onEnterFrame = function():Void{
             if(
    this._alpha >=100this._alpha 60;
             else 
    this._alpha 100;
            
        }    
    }

    newBut.onRollOut = function():Void{
        
    this._alpha 100;
        
    delete this.onEnterFrame;

    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

  7. #7
    Senior Member
    Join Date
    Jul 2001
    Posts
    449
    Thanks absolutley poifect!

  8. #8
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    your welcome
    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

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