PDA

View Full Version : [FMX2004]Setting the alpha



Phlashman
July 4th, 2004, 08:49 AM
Hi. I am having trouble setting the alpha of a movie clip (this is a bitmap, if that matters). My code is as follows:

on (change) {
if (this.getSelectedItem().data == 3) {
set (this._parent.ahouston._alpha,100)}
if (this.getSelectedItem().data <> 3) {
set (this._parent.ahouston._alpha,0)}
}
I don't believe it is a problem with my combobox actionscript, as just putting:
set (this.ahouston._alpha,100) in the only frame of the parent movie clip doesn't work either. Can I have some help please? Thanks

EDIT: Now it shows it with 0% alpha, but won't turn to 100%. I was wrong. It is a combobox problem.

ScriptFlipper
July 4th, 2004, 03:23 PM
maybe

on (change) {
if (this.selectedItem.data == 3) {
this._parent.ahouston._alpha = 100;
} if (this.selectedItem.data != 3) {
this._parent.ahouston._alpha = 0;
}
}

Phlashman
July 6th, 2004, 06:39 PM
the selectedItem.data property doesn't return a property. Thanks for trying is there any other way? I added this.getSelectedItem() at the top, but it still didn't fix it.

ScriptFlipper
July 6th, 2004, 07:21 PM
well, if it doesn't return a property, then you haven't added a property to that item!
if it's the label you're after, then you should refer to it as this.selectedItem.label
that's the best answer i can give you, unless you provide me with source files

Phlashman
July 6th, 2004, 07:30 PM
Okay, the source file is available here (http://shermans.gotdns.com/NYKCenter.fla), and the swf file is here (http://shermans.gotdns.com/NYKCenter.swf). Thanks for the help, and No, I am not looking for the label.

ScriptFlipper
July 6th, 2004, 08:20 PM
Those links aren't working for me :(

Phlashman
July 6th, 2004, 09:17 PM
... Yes, I forgot that I am under a firewall. Sorry.

I believe I have found the problem - data is the string found in the data parameter; previously I thought it was the index. Problem solved, case closed. Thank you.

ScriptFlipper
July 7th, 2004, 06:27 AM
Okay, glad you found it!