Helpful Information
 
 
Category: Flash
Using An Array With This Script

Hi All,

I have this script
onClipEvent (load) {
this.xGlowTo(0x2F0000, 1, 30, 1, 3, false, false, 0); which applies to a movie clip on my timeline, however I have set up an array var myButtons = [this.right_1, this.right_2, this.right_3, this.right_4]; is this correct? Now how do I make the first script apply to all?

put it here:



for (var i=0; i<myButtons.length; i++) {
// Sets its original X value. This will be used later for reference.
myButtons[i].originalX = myButtons[i]._x;
this.xGlowTo(0x2F0000, 1, 30, 1, 3, false, false, 0);


remove it from where ever else it is. :)

put it here:



for (var i=0; i<myButtons.length; i++) {
// Sets its original X value. This will be used later for reference.
myButtons[i].originalX = myButtons[i]._x;
this.xGlowTo(0x2F0000, 1, 30, 1, 3, false, false, 0);


remove it from where ever else it is. :)Hmmm the glow didn't happen? :eek:

Ack.. sorry, I am missing the glow. That is a version 8 thing.

What is it doing now and what SHOULD it do?

It doesn't do anything... But what it should do is put a glow around each button...

The glow is already defined in the AS file, why would you need to duplicate the script on the buttons?

:confused:
The glow is already defined in the AS file, why would you need to duplicate the script on the buttons? Ok I removed it from all the buttons and then just added the code to the as
for (var i=0; i<myButtons.length; i++) {
// Sets its original X value. This will be used later for reference.
myButtons[i].originalX = myButtons[i]._x;
this.xGlowTo(0x2F0000, 1, 30, 1, 3, false, false, 0); but the code doesn't make the buttons glow... It should yea?

no. I mean it is already defined in the mc_tween.as file.

It (theoretically) shouldn't be in the buttons anywhere. Remove it from that line and see what you get.

no. I mean it is already defined in the mc_tween.as file.

It (theoretically) shouldn't be in the buttons anywhere. Remove it from that line and see what you get.Oh... No that .as file is just set's up all the tween, including the glow tween... You still have to "activate" them in the flash movie. If I add this to each button/mc
onClipEvent (load) {
this.xGlowTo(0x3C0000, 1, 20, 1, 3, false, false, 1);
} it works for the individual button... But I have so many buttons that I thought I could add it to the array area... But with the previous code you gave me it just didn't seem to work :confused:

Oh... No that .as file is just set's up all the tween, including the glow tween... You still have to "activate" them in the flash movie. If I add this to each button/mc
onClipEvent (load) {
this.xGlowTo(0x3C0000, 1, 20, 1, 3, false, false, 1);
} it works for the individual button... But I have so many buttons that I thought I could add it to the array area... But with the previous code you gave me it just didn't seem to work :confused:AHHHHH I got it to work using this
for (var i=0; i<myButtons.length; i++) {
// Sets its original X value. This will be used later for reference.
myButtons[i].originalX = myButtons[i]._x;
myButtons[i].xGlowTo(0x2F0000, 1, 30, 1, 3, false, false, 0);:D Atleast something going right today! :confused: Any luck with my other post? :confused:

Oh, okay. I gotcha. Sorry, version 8 stuff still throws me sometime.

I am still working on the other post. A few idea but none are working just right.

Hopefully soon, as I only have an hour left before I go to work. LOL

Oh, okay. I gotcha. Sorry, version 8 stuff still throws me sometime.

I am still working on the other post. A few idea but none are working just right.

Hopefully soon, as I only have an hour left before I go to work. LOLAhhhh only an hour! lol I'm screwed :(

YOU'RE screwed? I'm the one that still has to go to work!!










privacy (GDPR)