Array do array....:(

Can I do that?? (array do array)…

for example : i have 3 buttons & 3 destination URL.

targetURL = [“http://www.kirupa.com”, “http://actionscripts.org”, “http://www.me.com”];

for(i=1; i<=3; i++){
this[“button”+i].onRelease = function(){
getURL(targetURL[i-1], “_blank”);
};
}

this is what i’ve been trying… but u know the result I guess :slight_smile:
cause I won’t ask this if it’s already success…
help me please… thank u…

for (i=1; i<=3; i++) {
	this["button"+i].ii = i-1;
	this["button"+i].onRelease = function() {
		getURL(targetURL[this.ii], "_blank");
	}
}

something like that should work =)

It’s not workin!!!

when i click the button it opens the main folder of this fla, not the browser…, it’s the same like previous script act
by the way… your script, gets the same result like i did I guess…

yes it works !! :stuck_out_tongue:

you did something wrong. it works :slight_smile:

it works …

you’re right man!!!
i’m sorry…

the problem came when the button(“but”) is in a movie clip(“button”)…
cause i need this MC to be duplicated…

how do i write the script to make it works…

this[“button”+i].but.onRelease = function(){… and so on…

yeah his code worked for me too…

If you are using MX then Movieclips can have button actions… so you don’ tneed to put the button inside of a movieclip just make the button into a movieclip and duplicate it with those actions…

but i need this “but” inside the “button”, i rather lazy to make the MC to act like a button… too much scripting thing…

kax… thank u…
jubba… u2…
(i see u’re not browsing anymore…c…u)…

will some one help me… with this?? i’m beginning to feel sleepy…

hey indojepang :slight_smile:

it’s not that hard to make the movie clips act as buttons. i posted an example maybe two or three days ago :slight_smile:

honestly i don’t remember the title of the thread …

but …

this["button"+i].but.onRelease = function() { ... }

should work … did you tested it ?

sorry … brain lapse :sleep:

try

for (i=1; i<=3; i++) {
	this["button"+i].ii = i-1;
	this["button"+i].but.onRelease = function() {
		getURL(targetURL[this._parent.ii], "_blank");
	}
}

[size=1]note. untested !![/size]

yes, I’ve tested it

code:--------------------------------------------------------------------------------this[“button”+i].but.onRelease = function() { … }--------------------------------------------------------------------------------

but it won’t work unless i eliminate the(.but)…

// i rather lazy to make scripts on a button movieclip for rollover,release,etc. effect

what about my past reply? :slight_smile:

WOW!!! IT WORKS!!! THANK U>>> KAX YOU"RE ROCK!!!
what a fool of me… i forgot this targetting thing…

GOD bless u KAX…

no problem =)

glad i could help :slight_smile:

Making a MovieClip behave like a button does not require any extra scripting if you are using Flash MX… the MovieClips can use Button event handlers now… Press Release… etc…

forgive me if this was already covered, i read fast…

i think he meant that he’s lazy to create the up, over and down states :slight_smile:
not that he didn’t know that you can use button event handlers …

oh… I don’t even use MCs as buttons any more. I always find that its easier to make one Invisible button and just place it over my MCs and target them… makes things much easier in my opinion. I forgot about making the different states…

as a matter of fact … i think i have never used a button for anything :stuck_out_tongue: