-
Between Flash & Flashkit
comboBox + MC / change color
hi ..
i have a comboBox + a mc on the stage . i am trying to make a selection from the comboBox to change the color of the movie clip .. i really need some help on this .thanks .
see fla
or here is the code
Code:
//populate the comboBox
my_cb.addItem({data:"", label:"Select a Color"});
my_cb.addItem({data:"0x0000FF", label:"Blue"});
my_cb.addItem({data:"0xFF0000", label:"Red"});
my_cb.addItem({data:"0x000000", label:"Black"});
my_cb.addItem({data:"0x009900", label:"Green"});
// comboBOx on change
var colorListener:Object = new Object();
colorListener.change = function(evt_obj:Object) {
var Selected:Object = evt_obj.target.selectedItem;
ball_mc.color = +evt_obj.selectedItem.data;
};
my_cb.addEventListener("change", colorListener);
I want to learn .
wannabe flasher [ Actionscript 2.0 ]
-
OOP is one letter from OOPS
The following worked for me:
var aCollor:Color = new Color(ball_mc);
my_cb.addItem({data:"", label:"Select a Color"});
my_cb.addItem({data:"0x0000FF", label:"Blue"});
my_cb.addItem({data:"0xFF0000", label:"Red"});
my_cb.addItem({data:"0x000000", label:"Black"});
my_cb.addItem({data:"0x009900", label:"Green"});
var colorListener:Object = new Object();
colorListener.change = function() {
trace (my_cb.selectedItem.data)
aCollor.setRGB(my_cb.selectedItem.data)
};
my_cb.addEventListener("change", colorListener);
-
Between Flash & Flashkit
brilliant m8 .
thanks for that 1 .
cheer MGT
I want to learn .
wannabe flasher [ Actionscript 2.0 ]
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
|