PDA

View Full Version : Using An Array With This Script



tomyknoker
09-27-2006, 02:48 AM
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?

BLiZZaRD
09-27-2006, 03:10 AM
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. :)

tomyknoker
09-27-2006, 03:53 AM
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:

BLiZZaRD
09-27-2006, 04:04 AM
Ack.. sorry, I am missing the glow. That is a version 8 thing.

What is it doing now and what SHOULD it do?

tomyknoker
09-27-2006, 04:09 AM
It doesn't do anything... But what it should do is put a glow around each button...

BLiZZaRD
09-27-2006, 04:16 AM
The glow is already defined in the AS file, why would you need to duplicate the script on the buttons?

tomyknoker
09-27-2006, 04:18 AM
: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?

BLiZZaRD
09-27-2006, 04:33 AM
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.

tomyknoker
09-27-2006, 04:40 AM
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:

tomyknoker
09-27-2006, 04:43 AM
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:

BLiZZaRD
09-27-2006, 04:46 AM
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

tomyknoker
09-27-2006, 04:48 AM
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 :(

BLiZZaRD
09-27-2006, 04:51 AM
YOU'RE screwed? I'm the one that still has to go to work!!