PDA

View Full Version : combo troubles


edweb
10-21-2002, 03:06 PM
hi all
It might sound stupid but even though i know a bit of actionscripts,
i got some worries concerning the components.

ok let's try:

i got a stupid intro with a direct access to the site and the other one with a combo box that contains 10 website inside.

i would like to set this component in the way that after the user chooses "mysite", go straitgh to labels "mysite" and i'm bit lost because i don't really know how to apply code on it.

many thank's for u help

pom
10-21-2002, 04:45 PM
Ca fait du bien de voir des petits français par ici, parce qu'y en a pas des masses...

And there's something I don't understand: do you have 10 websites in your combobox or 10 labels??

pom :confused:

edweb
10-22-2002, 07:06 AM
Salut cousan,
en fait j'ai 10 labels dedand le combobox, et je veux y accéder sans passer par le site. En plus j'aimerai savoir comment appliquer le code sur ce genre de component

look at this:

mySite
myFriendSite
myFriendSite

après avoir selectioné une de choix, je voudrai que le timeline se deplaçe sur la label créee precedement

thanx

edweb
10-22-2002, 01:49 PM
have u got an idea?

pom
10-22-2002, 02:10 PM
Je vois pas trop ce que tu veux dire par y accéder sans passer par le site...

But if you have a combobox (instance name myCombo on your main timeline that has a bunch of labels (say "friend", "site" and "sandwich"), you can put that kind of code on the first frame of the movie:stop();
myCombo.addItem("friend");
myCombo.addItem("site");
myCombo.addItem("sandwich");
myCombo.setChangeHandler("goLabel");

function goLabel(c){
var select=c.getSelectedItem().label;
_root.gotoAndStop(select);
}Cheers.

pom :cool:

pom
10-22-2002, 02:12 PM
Un petit fla.

edweb
10-22-2002, 02:40 PM
Thanx a lot for your help.

imagine a combobox with 10 items inside.
when i select one of them i go straight to the label named with the same name

the second part is:

imagine that i want load an external mc or URL in a blank page
what kind of code i have to type??

thanx

pom
10-22-2002, 03:01 PM
I think the thing I gave you does the first part of what you're asking.

About the second, what do you mean exactly by "load an external mc or URL in a blank page"?

pom :cool:

edweb
10-23-2002, 01:20 PM
Hi and thax a lot..
Whta i 'd like to know, is how u can explane your code in theese lines please

myCombo.setChangeHandler("goLabel");

function goLabel(c){
var select=c.getSelectedItem().label;
// the ".label" means that goes straight to labels you selected??

_root.gotoAndStop(select);
// what u mean for "(select)" ??
}


thanx

pom
10-23-2002, 03:54 PM
OK, explication de texte :D

var select=c.getSelectedItem().label;

I declare a variable called "select". You can call it "pom", "shirt", "beer" or anything you like.

c is your component.

c.getSelectedItem() will return the item that has been selected. This item has a label property and a data property. When I entered the items:myCombo.addItem("friend");friend is the label. I could have entered a data but we didn't need it.

c.getSelectedItem().label will return the "label" property of the selected item.

Voilà!

pom :cool: