# Variable RollOut

**URL:** <https://forum.kirupa.com/t/variable-rollout/117736>\
**Category:** Uncategorized\
**Created:** [July 29, 2004, 8:12pm UTC](https://forum.kirupa.com/t/variable-rollout/117736 "2004-07-29T20:12:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaskedMarvel](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@MaskedMarvel](https://forum.kirupa.com/u/MaskedMarvel)\
**Post date:** [July 29, 2004, 8:12pm UTC](https://forum.kirupa.com/t/variable-rollout/117736/1 "2004-07-29T20:12:31Z")

</div>

[[color=#006699]http://www.aows.info/Media%20work/MaskedMarvel/Final%20Stuff/colorchange.swf[/color]](http://www.aows.info/Media%20work/MaskedMarvel/Final%20Stuff/colorchange.swf)

Anyways, click on that link. As you can see I’ve set it up so that clicking on one will change the color of the other. As well, they have a rollover to another color.

But, I want to add a rollout thing to each link so that when I rollout the link will go back to the color it was before I rolled over.

Right now it stays with the rollover color and when I add a rollout thing it is constrained to one color. I need it to be adaptive to each situation as I will be adding more links and more colors down the road.

I just need a rollout action that will not change it to a certain color, just the color it was before I rolled over.

If you understood that at all answer. If not, tell me or ask a question to clear it up. I might even whip up a larger version of it with more colors to make it clearer, but only if you need.

Thanx!

(I’m working with Flash MX.)

---

<div class="post-metadata">

**Author:** ![2nd\_day](https://avatars.discourse-cdn.com/v4/letter/2/a4c791/32.png) [@2nd\_day](https://forum.kirupa.com/u/2nd_day)\
**Post date:** [July 29, 2004, 10:10pm UTC](https://forum.kirupa.com/t/variable-rollout/117736/2 "2004-07-29T22:10:38Z")

</div>

on(rollOut){  
// code for changing color back  
} ?? i don’t get the problem… maybe you should make an example with more colors or buttons…

---

<div class="post-metadata">

**Author:** ![MaskedMarvel](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@MaskedMarvel](https://forum.kirupa.com/u/MaskedMarvel)\
**Post date:** [July 29, 2004, 10:27pm UTC](https://forum.kirupa.com/t/variable-rollout/117736/3 "2004-07-29T22:27:11Z")

</div>

I’ll make a better example.

---

<div class="post-metadata">

**Author:** ![MaskedMarvel](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@MaskedMarvel](https://forum.kirupa.com/u/MaskedMarvel)\
**Post date:** [July 29, 2004, 10:44pm UTC](https://forum.kirupa.com/t/variable-rollout/117736/4 "2004-07-29T22:44:57Z")

</div>

Here’s a better example. It has more stuff.

[http://www.aows.info/Media%20work/MaskedMarvel/Final%20Stuff/nav.swf](http://www.aows.info/Media%20work/MaskedMarvel/Final%20Stuff/nav.swf)

Click on and of the last 4 links, you’ll notice what happens. All the other links turn a color and the one you clicked goes whitish. When you RollOver any link that is colored, it goes whitish as well. But when you RollOut, it goes to a single color. I want it to be so that when you RollOut it will go to the color it was previously, but it has to be adaptive because each link could be one of 5 colors (grey included) when you RollOver it.

Anyone see what I mean?

---

<div class="post-metadata">

**Author:** ![bobdoe](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@bobdoe](https://forum.kirupa.com/u/bobdoe)\
**Post date:** [July 29, 2004, 11:28pm UTC](https://forum.kirupa.com/t/variable-rollout/117736/5 "2004-07-29T23:28:14Z")

</div>

why dont you just capture the last color into a variable?  
when you click a button, how exactly are you changing the colors of the text? If its sending the timeline to a different frame, you can just rollout back to that frame. I have to know how you are changing the colors so I can tell you how exactly your code can be fixed.

---

<div class="post-metadata">

**Author:** ![MaskedMarvel](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@MaskedMarvel](https://forum.kirupa.com/u/MaskedMarvel)\
**Post date:** [July 30, 2004, 12:14am UTC](https://forum.kirupa.com/t/variable-rollout/117736/6 "2004-07-30T00:14:54Z")

</div>

It’s with this:

This is what the “Portfolio” button looks like.

```auto
on (release) {
var colorful = new Color("_root.home");
colorful.setRGB(0xA06161);
var colorful = new Color("_root.portfolio");
colorful.setRGB(0xCACACA);
var colorful = new Color("_root.tutorials");
colorful.setRGB(0xA06161);
var colorful = new Color("_root.downloads");
colorful.setRGB(0xA06161);
var colorful = new Color("_root.infocontact");
colorful.setRGB(0xA06161);
}
on (rollOver) {
var colorful = new Color("_root.portfolio");
colorful.setRGB(0xCACACA);
}
on (rollOut) {
var colorful = new Color("_root.portfolio");
colorful.setRGB(0x818181);
}

```

I need to change that rollOut tag so its not just one color. So it works in all situations. If that isn’t possible this way, can you help me out with another way of doing this?

---

<div class="post-metadata">

**Author:** ![bobdoe](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@bobdoe](https://forum.kirupa.com/u/bobdoe)\
**Post date:** [July 30, 2004, 1:01am UTC](https://forum.kirupa.com/t/variable-rollout/117736/7 "2004-07-30T01:01:23Z")

</div>

The problem with this is that it becomes too tedious to code it all out. One way I think you can do this is to make a prototype for all the buttons. However, I think there should be a way to keep track of teh last color with your current code. The problem is that you are using var and you cant easily access it outside of the event. Also all your variables are called colorful which makes it hard to keep track which is which.

If you create new variables like:  
redColor = (0xd50000);  
blueColor = (hecidecimal for blue) //put hecidecimal values in there.  
pinkColor = (blah blah) and so on.  
on each button put this release and roll out code:  
on(release){  
homeColor = new Color("\_root.home");  
homeColor.setRGB(redColor);  
//set the rest of the buttons to redColor accordingly.  
}

on(rollOut){  
thisColor = new Color(this);  
thisColor.setRGB(redColor);  
}

I hope this isnt too confusing. The code might not be correct but if you get the logic you can just figure something out on your own.

---

<div class="post-metadata">

**Author:** ![MaskedMarvel](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@MaskedMarvel](https://forum.kirupa.com/u/MaskedMarvel)\
**Post date:** [July 30, 2004, 3:14am UTC](https://forum.kirupa.com/t/variable-rollout/117736/8 "2004-07-30T03:14:06Z")

</div>

I think I understand it, but will that rollOut code work in all instances? Say if the button was Green or Blue when you rolledOver?

---

<div class="post-metadata">

**Author:** ![bobdoe](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@bobdoe](https://forum.kirupa.com/u/bobdoe)\
**Post date:** [July 30, 2004, 3:32am UTC](https://forum.kirupa.com/t/variable-rollout/117736/9 "2004-07-30T03:32:55Z")

</div>

\*\*\*\* masked your right, I didnt think of fixing that yet. Ill think of something soon

---

<div class="post-metadata">

**Author:** ![MaskedMarvel](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@MaskedMarvel](https://forum.kirupa.com/u/MaskedMarvel)\
**Post date:** [July 30, 2004, 3:38am UTC](https://forum.kirupa.com/t/variable-rollout/117736/10 "2004-07-30T03:38:48Z")

</div>

Thanx! This means a lot!
