# Help with code to change alpha

**URL:** https://forum.kirupa.com/t/help-with-code-to-change-alpha/1135
**Category:** Uncategorized
**Created:** [August 9, 2002, 7:22am UTC](https://forum.kirupa.com/t/help-with-code-to-change-alpha/1135 "2002-08-09T07:22:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![linque](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/linque/32/50_2.png) [@linque](https://forum.kirupa.com/u/linque)
#### Post date: [August 9, 2002, 7:22am UTC](https://forum.kirupa.com/t/help-with-code-to-change-alpha/1135/1 "2002-08-09T07:22:13Z")

</div>

I want to have a movie with a movie clip that’s just a rectangle (later to be an image). Say it’s instance is called “square\_mc”. I’d like the movieclip to behave as a button with a url.

In the main movie, I want the alpha to start out 50% for that movieclip and when the mouse rolls over it to increase to 100%. Then back to 50% when the mouse rolls out.

I was trying to avoid doing a tween and was hoping to learn how to use the terminology for actionScript.

I’ve been reading and trying different tutorials till I’m totally mixed up now. I think this may be simple, but being a newbie is not. GEtting the timelines and references right are a big challenge for me now. Any help will be appreciated but please remember I am struggling with ALL the terminology. Thanks

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2002, 8:00am UTC](https://forum.kirupa.com/t/help-with-code-to-change-alpha/1135/2 "2002-08-09T08:00:57Z")

</div>

\_root.square\_mc.onLoad = function() {  
\_root.ball.\_alpha = 50;  
};  
\_root.square\_mc.onRollOver = function() {  
\_root.ball.\_alpha = 100;  
};  
\_root.square\_mc.onRollOut = function() {  
\_root.ball.\_alpha = 50;  
};  
This should help you, put this code on the first frame of your movie.

If you have any questions post again. Hope this helps.

Kyle:)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2002, 4:56pm UTC](https://forum.kirupa.com/t/help-with-code-to-change-alpha/1135/3 "2002-08-09T16:56:13Z")

</div>

i GOT IT… with your help. Thanks iceman. It took me a while of head scratching. but i got it…

(there was reference to .ball there but soon as i changed it to match my own instance it was fine)

Well… i think i can sleep now 🙂 no really… i was STUCK on this… and now back to more learning.

It’s very much like listening to a foreign language and understanding most, but being unable to speak it. that’s what I feel like.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2002, 5:51pm UTC](https://forum.kirupa.com/t/help-with-code-to-change-alpha/1135/4 "2002-08-09T17:51:13Z")

</div>

Yeah that was my fault I should have explained that to you about the instance names, I don’t always know how much you know about actionscript so I didn’t want to seem presumtuous. E-mail me if you need help on anything else.  
[iceman4@sympatico.ca](mailto:iceman4@sympatico.ca)

Hope this helps

Kyle:)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2002, 6:03pm UTC](https://forum.kirupa.com/t/help-with-code-to-change-alpha/1135/5 "2002-08-09T18:03:06Z")

</div>

lmao … i think the ball instance was from the object control movie i posted for help.

you stole my code!

hehe … j/k

fun stuff fun stuff. 🙂
