A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: changing background colour...making it fade

  1. #1
    Junior Member
    Join Date
    May 2007
    Posts
    10

    changing background colour...making it fade

    hey there...i have made a file that changes the background colour when you roll over a button using the code

    on (rollOver) {
    bgcolor = new Color(_root.myBG);
    bgcolor.setRGB(0x66FF00);
    }

    now i feel that the effect doesnt look right since the bg snaps instantly to that colour when i rollOver the button...i was wondering if it is possible to make the background fade from its original colour to the new colour

    i have found a way to do this using tweens but i would perfer to use actionscript as i plan on having more complicated colour changes

  2. #2
    Senior Member Speed85's Avatar
    Join Date
    Apr 2007
    Posts
    291
    I'd suggest using a movie clip as the background, either dynamically bringing it in and set its depth to a negative number or just putting it on your stage and send it to the back.

    I havn't really investigated on tweens using actionscript so there might be a better way.

  3. #3
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    Hi welcome to FK...

    have a look at colorshifter application at http://www.braingiants.com/ for an example of background color fades
    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
    Junior Member
    Join Date
    May 2007
    Posts
    10
    thanks silentweed...that has helped a lot

  5. #5
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    glad i could help
    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