Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-21-2002, 03:06 PM   #1
edweb
Registered User
 
Join Date: Sep 2002
Location: Paris
Posts: 70
Default combo troubles

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
edweb is offline   Reply With Quote
Old 10-21-2002, 04:45 PM   #2
pom
Allez les Bleus!!!
 
pom's Avatar
 
Join Date: Oct 2002
Location: Paname
Posts: 2,493
Default

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
pom is offline   Reply With Quote
Old 10-22-2002, 07:06 AM   #3
edweb
Registered User
 
Join Date: Sep 2002
Location: Paris
Posts: 70
Default Re

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 is offline   Reply With Quote
Old 10-22-2002, 01:49 PM   #4
edweb
Registered User
 
Join Date: Sep 2002
Location: Paris
Posts: 70
Default re POM

have u got an idea?
edweb is offline   Reply With Quote
Old 10-22-2002, 02:10 PM   #5
pom
Allez les Bleus!!!
 
pom's Avatar
 
Join Date: Oct 2002
Location: Paname
Posts: 2,493
Default

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:
ActionScript Code:
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
pom is offline   Reply With Quote
Old 10-22-2002, 02:12 PM   #6
pom
Allez les Bleus!!!
 
pom's Avatar
 
Join Date: Oct 2002
Location: Paname
Posts: 2,493
Default

Un petit fla.
Attached Files
File Type: zip combo.zip (50.1 KB, 191 views)
pom is offline   Reply With Quote
Old 10-22-2002, 02:40 PM   #7
edweb
Registered User
 
Join Date: Sep 2002
Location: Paris
Posts: 70
Default Re

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
edweb is offline   Reply With Quote
Old 10-22-2002, 03:01 PM   #8
pom
Allez les Bleus!!!
 
pom's Avatar
 
Join Date: Oct 2002
Location: Paname
Posts: 2,493
Default

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
pom is offline   Reply With Quote
Old 10-23-2002, 01:20 PM   #9
edweb
Registered User
 
Join Date: Sep 2002
Location: Paris
Posts: 70
Default POM

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
edweb is offline   Reply With Quote
Old 10-23-2002, 03:54 PM   #10
pom
Allez les Bleus!!!
 
pom's Avatar
 
Join Date: Oct 2002
Location: Paname
Posts: 2,493
Default

OK, explication de texte

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:
ActionScript Code:
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
pom is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:42 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.