# Alpha problems

**URL:** <https://forum.kirupa.com/t/alpha-problems/282769>\
**Category:** flash\
**Created:** [February 26, 2009, 8:15am UTC](https://forum.kirupa.com/t/alpha-problems/282769 "2009-02-26T08:15:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HullRobbie](https://avatars.discourse-cdn.com/v4/letter/h/7c8e57/32.png) [@HullRobbie](https://forum.kirupa.com/u/HullRobbie)\
**Post date:** [February 26, 2009, 8:15am UTC](https://forum.kirupa.com/t/alpha-problems/282769/1 "2009-02-26T08:15:07Z")

</div>

Hi all,

I’m new to Flash and just starting to get my head round ActionScript in Flash CS4, so if I’m missing something blindingly obvious, please bear with me.

I’m creating a little project that uses GetDate and a little bit of maths to calculate an approximate sunrise and sunset time to give a value (called “opacity”, and ranging from 0 to 100) that changes how bright a movie clip looks depending how bright it is outside.

I’ve done the brightness bit with a black version of the movieclip duplicated on top of the main version, and changing the transparency of the black version from opaque to transparent using

Object.alpha = opacity

However.  
At 100 the routine works fine, and at 0 it works fine too. If it returns a value in between (ie 50, or 99, or 1), it still looks like alpha=100. So instead of a smooth transition, I get a jump on or off.

What am I doing wrong?

Any help much appreciated.

Cheers  
Rob
