-
Senior Member
ListBox variable?
Here's my code:
FlowRate = "";
dia = "";
answer = "";
inSq = 144;
if (componet.name == "mgd") {
num = 1.547;
}
if (componet.name == "gpd") {
num = .000001547;
}
if (componet.name == "gph") {
num = .0000371334877;
}
if (componet.name == "gpm") {
num = .00222800926;
}
How do I get the variables "mgd","gpd","gph" and "gpm" out of the listBox componet so flash knows what value to apply to "num"?
-
-
Senior Member
don't laugh.... componet.
-
Hihihi!
Component?
"mgd","gpd","gph" and "gpm"?
Are these 4 different listboxes? Or are these data in 1 list box?
-
Senior Member
They're the data in one ListBox. I haven't played around with the ListBox very often, if ya can't tell.
-
-Iron Myk-
myListBox.getSelectedItem().data
-myk
-
Senior Member
myListBox.getSelectedItem().data
So...it'd be
componet.getSelectedItem(2).data;
to get gph?
And off that subject for a second, Why is the very bottom of the listBox covering the bottom of letters like "g" and "p"?
-
-Iron Myk-
close.. nothing goes inside the parenthesis.. it'd be:
Code:
componet.getSelectedItem().data;
that'd return the data of the currently selected item..
as for lowercase letters with tails, if anyone knows how to fis that, please speak up now!
-myk
-
-Iron Myk-
here's a link that explains all available methods for a list box:
http://www.macromedia.com/support/fl...ionary241.html
-myk
-
Still wondering what a "componet" is?
I'd use the Change Handler and put your if statements in the function.
As for the lower case letters, how about adding an empty label on the bottom?
-
Senior Member
I'll give that a try guys, Thanks!
And a "componet" is some insight to my magnificent spelling abilities.
-
-Iron Myk-
wont help.. what i think he means is:
lets say you have a list box with 4 rows visible.. Anything on the 4th row will cut off the tails of lowercase letters. Even if you add blank rows, whatever is currently on that last row will mysteriously be chopped...
go figure..
-myk
-
Open up the Library...
Flash UI Components->Components Skins->Global Skins...
Double-click the Flabel component
Unlock layers, open up the actions window...
Change the value in this line from 2 to 4:
this.labelField._height = this.labelField.textHeight + 4;
The label field will then NOT cut off tails of lower case letters.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|