ComboBox On(change)?
Why can't I add an on(change) handler to my comboBox!?!
This is really driving me mad. I place a comboBox on the stage, select it, give it an instance name, then add the following actionscript:
Code:
on(change){
trace("hello");
}
... but when I try to run it I get the following errors:
Quote:
Scene=Scene 1, Layer=Layer 14, Frame=1: Line 14: Invalid mouse event specified.
on(change){
Scene=Scene 1, Layer=Layer 14, Frame=1: Line 15: Statement must appear within on/onClipEvent handler
trace("hello");
Scene=Scene 1, Layer=Layer 14, Frame=1: Line 16: Unexpected '}' encountered
}
What am I doing wrong? This should be so simple...
FlashKit > Flash Help > Flash ActionScript
Posted on: 11-13-2006, 10:23 AM
View Complete Forum Thread with Replies
Sponsored Links:
ComboBox On(change)
hello All,
i have a falsh application that enables movieclips when they are run over depending on whether some values are equivalent to that in a combobox. i have stored some values in an xml file which the movie clips rely on.
the problem i am facing now is that when i trace the contents of the xmlnodes in the on(change) event handler of the combo box it traces undefined. this is what i traced:
trace(nums[0].childNodes[0].firstChild)
var nums:Array = newsXML.firstChild.childNodes;
nums is the array that contains the xmlnodes.
how can i get access to nums in the on(change) event handler for the combo box?
please help
thanx
korkor5
View Replies !
View Related
How To Change Combobox Looks?
the setStyleproperties arent working, im using Flash 8.. and i did a thread search, it seems every single thread that came up asking how to skin a combobox in flash8 etc was redirected to an MX/MX2004 thread, but it seems to be different in flash 8
any help would be appreciated
View Replies !
View Related
Change Combobox Speed
Is there any way to change the speed of the combobox in MX 2004 so that it comes down quicker?
P.S. Has anyway else had a terrible time searching the forms? I can never get any results...it just times out.
View Replies !
View Related
ComboBox Border Change
OK, I've gone in and skinned new buttons for my combo box but I can't figure out how to control the color and style of the border! I know it has to be actionscript somewhere. Would be nice to get that radiused corners off of the border too, just want a nice square blue border.
View Replies !
View Related
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);
View Replies !
View Related
ComboBox Change Timeline?
So, I know you can pull data such as .swf into the projector when selecting an item in a ComboBox, however I have not found any information talking about when items are selected how to skip to a cretin frame on the timeline.
Is this possible, and if so could you elaborate or point me to a tutorial?
Thanks.
View Replies !
View Related
Change Font In Combobox
Why is this working on my Button
but not on the combobox
----------------------------------------------
var myFormat:TextFormat = new TextFormat();
myFormat.font = "Arial";
myFormat.bold = true;
myFormat.color = 0xFFFFFF;
myFormat..size = 12;
Pbtn.setStyle("textFormat", myFormat);
Pcombo.setStyle("textFormat", myFormat);
----------------------------------------------
????
any Idears
View Replies !
View Related
How To Change Icon In Combobox
Hello,
Does anyone know if it's possible to show an icon for the default item in a combobox component?
I can change icons in the drop down list using:
dropdown.setPropertiesAt(1, {backgroundColor:0xA89957, icon:"check"});
But then the icon only appears when you expand/dropdown the combobox - the currently selected item doesn't show any icon when the combobox is closed.
Thanks,
Julia
View Replies !
View Related
Change Combobox Width
How do I change the width of a dynamically attached Combobox?
PHP Code:
function comboBoxInitialize():Void {
var cb_Initialization = {data:[],editable:false,labels:[],rowCount:5, restrict:"",enabled:true,visible:true,minHeight:0,minWidth:200};
_root.attachMovie("ComboBox", "cb_videoCategorie", this.getNextHighestDepth(), cb_Initialization);
}
Thanx!
View Replies !
View Related
Combobox Change Handler
I want to have a combobox that works like a javascript onclick dropdown box. When it is clicked, i want to fscommand to javascript i have written in my HTML page. can anyone find any mistakes in this code or help me? this code is in frame one, the same frame as my combo box. the combobox is named "music_combobox" and the change handler is "changehandler"
Code:
function changehandler(whichbox) {
if (whichbox == "music_combobox") {
var select = music_combobox.getSelectedItem().data;
if (select != 0) {
fscommand(playit, select);
}
else if (select == 0) {
fscommand(stopit);
}
}
}
View Replies !
View Related
Can You Use ComboBox To Change Scene Or Frame
Hi!
Can somebody please write down what I have to do to activate a Combobox to move inside a flashmovie.
I want to use a ComboBox with data and labels. For example... If a user selects the label "Scene2" I want the Action
(load) {
gotoAndPlay("Scene 2", 1);
}
Is that possible? Do I have to use a PushButton to activate the selection?
Many thanx!!
View Replies !
View Related
Combobox To Change Font Types...
I have a textarea I want the font changed for when they choose the corresponding font from a combobox.
On the combo box itself I have it named "myCombo". This is the code for it..
Code:
on (change) {
if (myCombo.getSelectedItem() == "Garamond") {
user_output.setStyle("fontFamily", "Garamond");
} else if (myCombo.getSelectedItem() == "Arial") {
user_output.setStyle("fontFamily", "Arial");
} else if (myCombo.getSelectedItem() == "Verdana") {
user_output.setStyle("fontFamily", "Verdana");
}
}
the textarea is called user_output.
Ideas?
View Replies !
View Related
V1 ComboBox - Change Font Style?
Working in FlashMX2004 Pro coding environment but have to edit a file containing a version 1 comboBox.
All I want to do is increase the font size of the comboBox.
I've tried everything I can think of.
What code should I use to simply increase the font size?
View Replies !
View Related
Change Alpha On Combobox Options
Simply put, is there a way to change the alpha, or change the enabled/disabled state of an option in a combobox?
Say I have comboBox1 with these options:
item1
item2
item3
item4
item5
item6
Then I click on item 6 - I now want item 6 to still be in the list, but i want it to be alpha faded out or to no longer be selectable.
Any ideas? Thanks.
View Replies !
View Related
Combobox To Change Font Type...
I have a textarea I want the font changed for when they choose the corresponding font from a combobox.
On the combo box itself I have it named "myCombo". This is the code for it..
Code:
on (change) {
if (myCombo.getSelectedItem() == "Garamond") {
user_output.setStyle("fontFamily", "Garamond");
} else if (myCombo.getSelectedItem() == "Arial") {
user_output.setStyle("fontFamily", "Arial");
} else if (myCombo.getSelectedItem() == "Verdana") {
user_output.setStyle("fontFamily", "Verdana");
}
}
the textarea is called user_output.
Ideas?
View Replies !
View Related
Combobox Component: Change Bg Color
[resolved]
hello
i suceeded to change the combobox's text
ActionScript Code:
var CSScombo:TextFormat = new TextFormat("Arial", 8.6, 0x00FF5F);combo_zone.zone.textField.setStyle("textFormat", CSScombo);
I even manually edited the combobox original graphics but I still have the BG color when selecting items not yet changed!
any hints?
thanx
View Replies !
View Related
Combobox To Change Font Type...
I have a textarea I want the font changed for when they choose the corresponding font from a combobox.
On the combo box itself I have it named "myCombo". This is the code for it..
Code:
on (change) {
if (myCombo.getSelectedItem() == "Garamond") {
user_output.setStyle("fontFamily", "Garamond");
} else if (myCombo.getSelectedItem() == "Arial") {
user_output.setStyle("fontFamily", "Arial");
} else if (myCombo.getSelectedItem() == "Verdana") {
user_output.setStyle("fontFamily", "Verdana");
}
}
the textarea is called user_output.
Ideas?
View Replies !
View Related
ComboBox Change Size Freakness
I have created a mini text editor and I have a comobox which changes the size of selected text. This works perfectly. But when I load it into _level10. of another flash movie it stops working properly. I changed all my paths to _level10.txtbox etc so I don't get it.
Whats even more strange is that it works on the last two size options in the list but not the first 3. Sometimes it doesnt even work on the bottom two. It just isn't consistent.
The combobox uses a function which is called from the Change Handler property, and the function resides on the first frame of the timeline of the mini text editor (not the main movie it loads into)
Can anyone tell me why this is happening?
Thanks!
View Replies !
View Related
Triggering Change Event In ComboBox
Shouldn't this cause a change event to fire in ComboBox 'cb'?
Code:
import mx.events.*
test = new Array("one", "two");
cb.dataProvider = test;
receiver = {};
receiver.change = function(evtObj) {
trace("change");
}
cb.addEventListener("change", receiver);
trigger = {};
trigger.onMouseDown = function() {
cb.selectedIndex = 1;
}
Mouse.addListener(trigger);
Mike
View Replies !
View Related
Unable To Change ComboBox Text Color
Does anyone know how to pinpoint the text color style property of the highlighted text in the ComboBox component? The item text can be changed with the "color" property, but the item that is selected still appears to remain a halo green unless it's moused over.
The following doesn't seem to address this:
PHP Code:
ComboBox.setStyle("themeColor", 0xCC0000)
ComboBox.setStyle("color", 0xCC0000)
Thanks.
View Replies !
View Related
How To Make A ComboBox Change Selection... Without Clicking It (through AS)?
Hello there.
I have a nice picture gallery, in which you can select the gallery you want to watch by choosing it from a ComboBox component that contains a list of them (it has a listener and a "change" event associated to it). When you click on one of the galleries, it starts the load process.
Everything works fine, but as it is now, when you enter the picture gallery you're welcomed with a white space an a "<SELECT A GALLERY>" message in the center.
What I'd like to do is remove this message, and be able to load one of the galleries straight away when you enter the site, without any user interaction required. And I believe the best way to do this, would be to force a "change" event in the ComboBox from the code when everything's loaded, without the user clicking anything.
Is it possible to call a "change" event from the code, without clicking anything in the component?
Any help would be really appreciated.
Thanks
View Replies !
View Related
[F8] Combobox, Multiselect Or An 'onselect' Event (not The Same As Change)
Okay, I have a combobox that has options in it. I would like a user opening the combobox and clicking on an item in it to work like a toggle for that item.
The problem is that the change event does not allow a user to toggle on and off a single item without first picking another item in between. Very annoying. There is the close event, but that does not care if the combobox is closed due to a user clicking on an item or the user clicking on the open/close button.
I have even tried combining it with the itemrollover/rollout listeners to detect if an item was being rolled over when the combobox was closed, but the closed event does not trigger until the box is fully closed so the itemonrollout always triggers first (tracing out the false response no matter what in the example below)
For this code, the stage just has a combobox named category.
Code:
stop();
names = new Array("Fred", "John", "Smith");
fruits = new Array("Apple", "Banana", "Grape")
category.addItem("Names", names)
category.addItem("Fruits", fruits)
var inputListener:Object = new Object();
inputListener.change = function(eventObject:Object) {
trace(eventObject.target.value)
};
inputListener.itemRollOver = function(eventObject:Object) {
eventObject.target.rolledover = true
trace(eventObject.target.rolledover)
};
inputListener.itemRollOut = function(eventObject:Object) {
eventObject.target.rolledover = false
trace(eventObject.target.rolledover)
};
inputListener.close = function(eventObject:Object) {
if (eventObject.target.rolledover == true) {trace("True when closed")}
if (eventObject.target.rolledover == false) {trace("False when closed")}
};
category.addEventListener("change", inputListener)
category.addEventListener("itemRollOver", inputListener)
category.addEventListener("itemRollOut", inputListener)
category.addEventListener("close", inputListener)
So even this convoluted method does not let me detect when the user clicks on an item... Any idea how I could do this?
Is there a way to get a multiselect combobox in flash? That might work if the selections stay persistent when the combobox is closed.
Is there a multiselect listbox? I could do that with some rollover animation to make it look nice and get out of the way when done...
View Replies !
View Related
ComboBox/Textfield Change Focus Problem
Hello people,
I’m having a real noodle baker at the moment with a combo box and a text field.
I am creating a text editor to apply css styles to text, so a portion of the text is selected in the text field, the combo box is then used to run some code on the selected text, the end result needs to be focus returns to the text field after the selection is made from the combo box and the original text highlighted as it was before the combo box came into play.
The problem I am tearing my hair out over is, even though I use setSelection() to highlight the text again, (which you momentarily see it selected) something sets the getBeginIndex() and getEndIndex() to zero, not once, but constantly. The text becomes unelectable as the cursor always resets back to (0,0).
If you click outside the text field and back in it again, selecting the text becomes normal again.
I’ve attached a really simple version of the code – if you fancy testing it – an input field with the name of “input” and a combo of “styles_DD” with random filled entries will do the trick.
Any help would be much appreciated.
View Replies !
View Related
Change FontFamily And FontSize In Combobox Component
I am having some trouble changing the fontFamily and fontSize in the combobox component. I want to create a combobox where the items are displayed in the tahoma font size 9.
I have seen the macromedia style guides and tutorials and how they explain such parameters as: mycomboBox.fontFamily and mycomboBox.setStyle but I still have no idea. I already know how to skin the component but i am still lost at this.
Can someone throw some code for me and explain were to insert it? Please help!!
View Replies !
View Related
Change FontFamily And FontSize In Combobox Compone
I am having some trouble changing the fontFamily and fontSize in the combobox component. I want to create a combobox where the items are displayed in the tahoma font size 9.
I have seen the macromedia style guides and tutorials and how they explain such parameters as: mycomboBox.fontFamily and mycomboBox.setStyle but I still have no idea. I already know how to skin the component but i am still lost at this.
Can someone throw some code for me and explain were to insert it? Please help!!
View Replies !
View Related
Use Of Change Handler On Combobox In Flash Mx 2004
Hi all,
I am a complete beginner to flash and was going through some tutuorials from the macromedia site.
The tutorial uses flash but I have flash mx 2004 and I am stuck.
I have got round most of my problems but I am adding a combobox which needs to call a function which is placed in the change handler box in the properties inspector.
I dont have this line in MX 2004!!!! How do I do it???
Please help
Michael
View Replies !
View Related
StupiD Combobox RollOverColor Doesn't Change Until I Re-rollOveR?
guys, i need help with this bad. I want to be able to change the color of the items as i rollOver them in a COMBOBOX or LISTBOX.
i've tried the eventhandler itemRollOver with an if/else changing the rollOver Colors but it only activates on the following rollover.
like if i have 3 items, how can i make it so that the first item is blue the second item's rollover is red and the third is green?
thanks for annnnyyyy advice.
View Replies !
View Related
Simple Button.onRelease Style Question With ComboBox.change
Hello, i'm working on a flash movie where i want all code to be on the one frame rather than scattered round placed on all different objects. This is just so it's easy to edit and monitor.
I understand the difference between having a button named btnMyButton and writing say
on(press)
{
trace("this actionscript is on the button itself");
}
and having the code on the root timeline like btnMyButton.onRelease = function()
{
trace("this code is on the actual main timeline");
}
What i want to do is do the same thing but with the comboBox component on it's "change" event. (The user makes a different selection in the comboBox and the code then executes).
the comboBox has an instance name myComboBox.
why is it that i can put on the actual comboBox object the actionscript:
on(change)
{
trace("You changed the combo box item");
}
yet when i put on the main timeline
actionscript:
myComboBox.change = function()
{
trace("You changed the combo box item");
}
it doesn't have the same effect and no trace text is shown.
I've verified the naming is correct in my coding being as i refer to "myComboBox" to set it's themeStyles on the main timeline in exactly the same way and the theme colours get set correctly.
Thanks In Advance,
Bryce.
View Replies !
View Related
Programming A Combobox To Call Movie Clips And Change Properties
Hi, I´m a Flash newbie and I need some help for a project I´m making. I have a dialogue box with a ComboBox labeled as "square", "circle", "triangle", and "rectangle", which are supposed to call movie clips (they have the same instance name as the labels). What I want is that the ComboBox selects any of these movie clips and get their size and position properties through input textboxes, and also have the chance to rearrange the properties by changing the values on the input textboxes (sort of like the property inspector in Flash).
I was looking for any tutorial that looks like what I´m looking for, but I didn´t find anything. I´m not even sure if a ComboBox can be used to call a movie clip on stage. I hope anyone can help me out.
View Replies !
View Related
Put Parameters In A Function Called By The "change" Event Of A Combobox
Hello everyone,
As the title of my post might be a little hard to catch, let me explain a bit more...
I've got several combobox.
When changing their value, each of them launch the same action, except that they do it on different clips.
Let' say
list1_cb will work on clipA_mc
list2_cb on clipB_mc
list3_cb on clipC_mc
...
instead of doing
list1_cb.addEventListener("change", function1);
list2_cb.addEventListener("change", function2);
list3_cb.addEventListener("change", function3);
...
and than create a function function1, function2, function3 which would be the same, except acting on different clips
I would rather do
list1_cb.addEventListener("change", common_function(clipA_mc));
list2_cb.addEventListener("change", common_function(clipB_mc));
liste3_cb.addEventListener("change", common_function(clipC_mc));
and then, only define a function common_function which would work on a movieclip known as a parameter.
Unofrtunately, it looks like it's not possible to put any parameter to a function called by the "change" event on a combobox.
Would anybody have an idea about how I can do that ?
Thanks a lot to all of you who read this and tried to help me
Emilie
View Replies !
View Related
ComboBox Attribute To Input Text Box On "change"
Here's the scoop: I have a comboBox that has two attributes being loaded from an XML file. No problems there. The comboBox is loading the arrays into its drop-down and I'm seeing the values. Now what I'm trying to do is when a user selects an item from the comboBox, an input textbox is updated with the value of the second attribute for that node. I think I just have a syntax problem because I can't get the value in the input textbox to change when a user selects an item in the comboBox. Can anyone see a problem with my code?
CBOLoadMembers is the combox.
The input box is emailAddress.
The name of the attribute from the XML file is memberEmail.
Code:
function LoadCombo(success) {
if (success) {
//set variables
var BaseNode=thisXML.childNodes[0];
var ComboMembers = new Array();
var ComboEmails = new Array();
var ThisNode;
//add a default item to the combo box
CBOLoadMembers.addItem("-------Select Your Name-------");
for (i=0; i < BaseNode.childNodes.length; i++) {
ThisNode = BaseNode.childNodes[i];
ComboMembers[i] = ThisNode.attributes["memberName"];
ComboEmails[i] = ThisNode.attributes["memberEmail"];
CBOLoadMembers.addItem(ComboMembers[i],ComboEmails[i]);
trace ( emailAddress ) ;
}
}
}
import mx.controls.ComboBox;
var CBOLoadMembers:ComboBox;
CBOLoadMembers.addEventListener ("change", onComboChange);
function onComboChange (event:Object):Void
{
emailAddress = CBOLoadMembers.selectedItem.attributes["memberEmail"];
trace ( emailAddress ) ;
}
View Replies !
View Related
ComboBox "change" Bug
Is there away around this issue when using a comboBox...?
I have a comboBox full of URLs. If you select one it opens a window with that URL. But if you close that window and reselect the same item from the comboBox nothing happens because there has been no "change" event.
Whats the simple answer. I have tried a few options but they either dont work or present other issues (like editing the event from "change" to "close"...works but it opens a new window even whenit closes...even if the user doesnt select anything again)
thx in advance.
View Replies !
View Related
ComboBox Doesn't Use ComboBox Assets
I've been customizing some components, and discovered that the ComboBox doesn't actually use the ComboBox Assets, but instead uses the ScrollBar Assets. I need to have a slightly different design for the ComboBox down button. Does anyone know how to make the ComboBox use it's own assets, perhaps by editting the ComboBox.as or ComboBase.as file?
Thanks.
View Replies !
View Related
ComboBox Problem, Displays A "text Box Like" Object Instead Of A ComboBox
Hello friends,
A friend of mine is having a tough time getting a ComboBox integrated into an existing flash movie, to work right.
Here's the story so far.....
The ComboBox when tried out in a sample new file works absolutely fine, but when the same thing (see code below) is added to
an existing movie (which has a preloader in Scene 1) does not work at all. Instead, it displays a "text-box-like" object in place of a
ComboBox...
Code:
form = new Object();
form.change = function (evt){
trace(evt.target.selectedItem.label);
}
comboBox.addEventListener("change", form);
Now, is there a possibility that because a preloader exists in the movie, the ComboBox does not work, not sure on this reasoning!
If someone could help out here, I'd really appreciate it!
View Replies !
View Related
Button Change Color On Select, Then Change Back
I have 3 buttons, named but,but2,but3. What I want is if you click a button it changes color to show what page your on. But when you click a different button now that one is highlighted and the original one goes back to the original color. Here's the code.
but3.onPress = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("banner3.swf", "container");
container._x = 0;
container._y = 0 ;
I figure I have to add some kind of if statement?
}
View Replies !
View Related
|