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
cause I won’t ask this if it’s already success…
help me please… thank u…
system
March 2, 2003, 4:23pm
2
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 =)
system
March 2, 2003, 4:38pm
3
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…
system
March 2, 2003, 4:46pm
4
yes it works !!
you did something wrong. it works
system
March 2, 2003, 5:04pm
6
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…
system
March 2, 2003, 5:05pm
7
yeah his code worked for me too…
system
March 2, 2003, 5:06pm
8
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…
system
March 2, 2003, 5:14pm
9
but i need this “but” inside the “button”, i rather lazy to make the MC to act like a button… too much scripting thing…
system
March 2, 2003, 5:25pm
10
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…
system
March 2, 2003, 5:33pm
11
hey indojepang
it’s not that hard to make the movie clips act as buttons. i posted an example maybe two or three days ago
honestly i don’t remember the title of the thread …
but …
this["button"+i].but.onRelease = function() { ... }
should work … did you tested it ?
system
March 2, 2003, 5:47pm
12
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]
system
March 2, 2003, 5:48pm
13
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
system
March 2, 2003, 5:52pm
14
what about my past reply?
system
March 2, 2003, 5:53pm
15
WOW!!! IT WORKS!!! THANK U>>> KAX YOU"RE ROCK!!!
what a fool of me… i forgot this targetting thing…
GOD bless u KAX…
system
March 2, 2003, 6:17pm
17
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…
system
March 2, 2003, 6:22pm
18
i think he meant that he’s lazy to create the up, over and down states
not that he didn’t know that you can use button event handlers …
system
March 2, 2003, 6:39pm
19
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…
system
March 2, 2003, 6:43pm
20
as a matter of fact … i think i have never used a button for anything