Hi all,
I just need a little help to finish of this bottom I am creating for an offline Flash interactive piece I am doing.
Thanks to you helpful jokers, I got some advice on how to animate this button without the use of Tweens, but with Actionscript instead. I am trying to develop my knowledge of AS, so am trying to create this interactive solely (well almost soley) with AS.
So here’s how it is:
When you enter the interactive, all the buttons are as below:
[img=http://img331.imageshack.us/img331/9076/initialstate7dg.th.jpg]
Then when you rollover individual buttons they look like this:
[url=“http://img331.imageshack.us/my.php?image=rollover0cf.jpg”][img=http://img331.imageshack.us/img331/6258/rollover0cf.th.jpg]
I have got this working using the following AS:
on (rollOver) {
var colorful = new Color("_root.graphics.text");
colorful.setRGB(0xFFFFFF);
}
on (rollOut) {
var colorful = new Color("_root.graphics.text");
colorful.setRGB(0x034008);
}
on (rollOver) {
_root.graphics.bg.onEnterFrame = function() {
if (_root.graphics.bg._alpha<100) {
_root.graphics.bg._alpha += 25;
} else {
_root.graphics.bg.onEnterFrame = null;
}
};
}
on (rollOut) {
_root.graphics.bg.onEnterFrame = function() {
if (_root.graphics.bg._alpha>0) {
_root.graphics.bg._alpha -= 25;
} else {
_root.graphics.bg.onEnterFrame = null;
}
};
}
where ‘graphics’ is the Instance name of the button, and ‘text’ is the Instance name of the text within the button that changes colour.
**What I would like to know, is when I click the button to load an external .swf, how do I keep the button in it’s ‘rollover’ state when you move your mouse off it?
**As it is, after I click the button and my .swf loads, it returns to its initial state when I roll off it. I’m guessing there isn’t a lot to fix this problem, but I just seem to be having problems with AS.
If anyone could help, that would be sweet,
ta very much
Enforcer73