View Full Version : Actions from items of ComboBox
leandrosalem
10-10-2002, 05:01 PM
I created a ComboBox with the following labels. [car,house,ball] .
I want getURL when the item ball is selected. I wrote this code:
onClipEvent (enterFrame) {
if(mycombobox.getSelectedItem().label = ball ); {
getURL("www.flashkit.com", "_blank");
}
}
When i test the movie,it's opening continuosly a new window automatically,without the click. it almost crashed my compu
There are 2 problems in your code:
Your test: if(mycombobox.getSelectedItem().label = ball ); {You're assigning, not testing, and you have to remove the semi colon.if(mycombobox.getSelectedItem().label == "ball" ) {Then you shouldn't test the value of the selected item onEnterFrame. It's better to do it only when the user selects one of the items, right?
So you have to create your own function and assign it to the component. Something likefunction goThere(c){
var i=c.getSelectedItem().label;
if (i=="ball") {getURL("http://www.flashkit.com","_blank");}
}
mycombobox.setChangeHandler("goThere");This is untested, but that's how it works. I'm sure there's a tute on this site explaining it better than I did. :)
pom :D
JHallam
10-10-2002, 06:11 PM
Beat me to it....lol
Hey JH, I was wondering: how do you put that line under your name?? I looked in the user cp but didn't find it and I don't want to ask on the general forum... too ashamed of myself :D
JHallam
10-10-2002, 07:48 PM
you've done it! lol
YAAAAAAAAAAAAAAAAAY! lol
it's just the olde
____ Underscore ____
Magic-cal :D
Nonono, I meant where it says "member" :D
JHallam
10-10-2002, 08:08 PM
ooooooooooooooooooooohhh,
USER CP
Edit Profile
Custom text
there you go chappy :D
??? :confused: I don't have it :( :( :(
OR
I'm going blind. Dunno yet.
JHallam
10-10-2002, 10:33 PM
kayyyyyyyy
USER CP (at the top of the forum, next to register, TOP BAR)
Then in the other menu that it brings
EDIT PROFILE
then search down the page for
Custom User Text:
This is the title that appears beneath your name on your posts.
You may enter up to 25 characters.
Check the reset box if you wish to use the the default title for your usergroup and post count.
HTML is not allowed.
then edit it, DONE!
gh, for some reason, some members don't have that option, i don't know if it depends on number of posts, or what...
I know, I know... :D
Am I going mad?
Oups tg, crossposts.
Is that so? I hope the limit is 100 then. That way I only have to post 2 stupid posts.
Edit: Well, 100 and still nothing... Why is this always happening to me?? :D
Mortimer Jazz
10-10-2002, 11:24 PM
I can't even see the bit where it says 'member' and I don't have the option.
I have abot the same amount of posts as GRaPHiX_FReaK..... so now I feel kinda cheated ;)
JHallam
10-11-2002, 01:06 AM
MAYBE...it's the only special superior members have this option :D :D :D :D :D :D :D
hehehe
Mortimer Jazz
10-11-2002, 12:21 PM
Grrrrr (mummble mummble......) ;)
JHallam
10-11-2002, 01:14 PM
Heh Heh!
http://www.tutorialforums.com/images/smilies/New/classic.gif
hehe ;)
JHallam
10-11-2002, 01:15 PM
why is the IMG command not working? Anyone?
Originally posted by Mortimer Jazz
I can't even see the bit where it says 'member' and I don't have the option.
I have abot the same amount of posts as GRaPHiX_FReaK..... so now I feel kinda cheated ;)
HELLO! McFly! *knock,knock* YOO HOO!
thats cuz yours says MX-ray specs... you've already changed it.
Mortimer Jazz
10-11-2002, 04:08 PM
oh the user text! right.....
Better change these MX-Ray specs for a pair of contact lenses ;)
I have now changed my profile to something more fitting....
I feel so left behind... :(
And thanks for the pic, JH...
JHallam
10-11-2002, 05:40 PM
LOL
you have nicked my piccy!!
But i suppose you need that pom, to warn people :D
hehe
Glad you like it :rolleyes:
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.