Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Combox.selectedItem Says Undefined?


cbox.addItem("hi");
cbox.addItem("Hello");

In the button release
on(release)
{
trace(cbox.selectedItem.label);
}

When I select "hi" and click on button it says "undefined"
Any idea?




KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 11-12-2005, 10:00 PM


View Complete Forum Thread with Replies

Sponsored Links:

Combox Value?
Heya guys, Im in a pickle.

I can't get my combobox to tell me what was selected,


my_vars.budget = budget.getValue;
mail returns: [type Function]


my_vars.budget = budget.selectedItem;
mail returns: [object Object]

Anyone know how to read the value of a comboBox selection?

View Replies !    View Related
Using Combox Component
Hi all
I just downloaded Flash UI Components.
How do I use combox component?
Below is the option from combox menu
Labels
Data
Row Count
Change Handler

I want to add 26 labels and when clicked jump to label_marker 1 to 26
where do I define this?

thanks
PilotX

View Replies !    View Related
Combox And AddEventListener
Hi,

I'm using multiple comboBox component on the same screen and I was wondering how I can also have multiple listeners to respeond to the selections? ie, each comboBox calls its own handler when needed.

For example
this.comboBoxA.addEventListener("change", this);
this.comboBoxB.addEventListener("change", this);
this.comboBoxC.addEventListener("change", this);

All the comboboxes call the "change" handler when I would rather they call, changeA, changeB, changeC etc.

TIA and Seasons Greetings,
Randy

View Replies !    View Related
Combox Mystery
I have some combo boxes that i have attached to the stage with attachMovie. I used a for loop to attach many combo boxes. after you click a button to submit the data in the boxes it takes u to another frame, but the combo boxes are still on the stage even 10 frames later, even with blank keyframes right after the frame that holds the combo boxes. how do i get rid of these bitches.

View Replies !    View Related
Few Combox On The Same Frame
to answer to POM,
each label on my comBox are linked to different frames labels.

What is the value (c)?
do I still need to name my combox : box1, box2, box3...

Because so far it doesn't work. I did a mistake somewhere, but I don't know where...

Thank you again for your precious help
Corinne

View Replies !    View Related
Combox Features Question
I'm creating a form in Flash. The form has combo boxes.

What are the folowing different parameters for(which show up in the properties panel of when a combo box is selected):

1: labels
2: data
3: row count (I know this one)
4: changehandler

thanks

View Replies !    View Related
Setting Icon In Combox
Can you set an icon on this component. I have problems with that, but I can have the same icon on all items when settings defaultIcon = "name";

Any ideas?

View Replies !    View Related
Combox Is Messing With My OnRelease
I have an application that uses a combo box to select information to be loaded. Before the user uses the combo box, my onRelease functions work fine; I can click on a button several times to activate the function without moving the mouse. Once a selection is made with the combobox, however, I can only click on a button once. After that, it won't run the function unless i move the mouse.

This is the code I have for the combobox (named select_order)


Code:
function change(evt) {
if (evt.target.selectedItem.data == null) {
init();
} else {
updateOrder(evt.target.selectedItem.data);
pro_mc._visible = true;
updateText();
}
}
select_order.addEventListener("change", this);


Any clues on to why this is happening or how to get around it? There are a few buttons affected by this where the user wouldn't normally have to move the mouse. Thanks

Phar

View Replies !    View Related
Combox + Set Initially Selected Value
I have a combobox dropdown that is populated with US State abbreviations (AL, CA, NY, etc.).

I would like the dropdown to set itself according to an initial value or label (not the index):

_root.stateDropDown.selectedIndex= "NY"; //does not work
_root.stateDropDown.selectedItem= "NY"; //neither does this

Is this possible? Please help. Thanks.





























Edited: 02/15/2007 at 08:58:36 AM by jencarnac

View Replies !    View Related
Combox Xml Attributes Question?
How many xml node attributes can be passed to a Combobox item?

scenario:

xml = <video url="video01.flv" xml="video01_cap.xml" desc="video 01" />

as = combobox.addItem(videos[i].attributes.desc, videos[i].attributes.url, videos[i].attributes.xml);

As you can see, I need the first one to label the item, the second to access the video and the third to access the caption xml.

THX

View Replies !    View Related
Load Movie (swf With A Combox)
hi people

i have a swf with a combox (called swf1)

i have another swf (called swf2)

when i load swf1 into movieclip( called movieclip1) from swf2, combox no open.

if i load swf1 into root swf2 no problem,,,

any idea?

i use flash 8

View Replies !    View Related
Scrollpane And Combox Box Issues
Hiya guys,

Im dynamically adding some mc's with some buttons in them to a scrollpane. The problem Im having is that the buttons work fine untill you select something from my combo box, then they only work intermitently.

I think it might be some kind of redraw issue as if I move my mouse a tiny little bit the button will run its function when clicked again, but if i keep it totally still its just wont do it.

Has anyone heard of any bugs to do with this?

cheers, J

View Replies !    View Related
Combox List Doesn't Opening
Hi,

I have a combox on the stage & I have inserted some values in the combobox using addItem().
Now, when I run the movie, I can see the default value in the combo text field, but when I click the arrow, drop down list is not opening & also trace(mc_combo.dropdrown) displays nothing. What could be the reason?
TIA
Mahesh

View Replies !    View Related
Combox Interaction With Submit Button
Hi i have a university project, where i have to create an flash file that letes 7-11 year old kids to write a story.

i have desgined it so that i have written most of the story but the user can sellect say for example the name for the character by selecting a comobox.

i now need to create a submit button that will store their choices, and it anther use them in another frame. to basically to show the user their finished story.

can anybody help me, and tell me how can i can do this, im not very good with flash or action script,


i will paste my code onto here. note the options for combo-boxes are loaded from a simple xml file.










Attach Code

import flash.events.*;
import fl.controls.ComboBox;

var changed_txt:TextField=new TextField();


var story_xml:XML;


var urlLoader:URLLoader=new URLLoader();


var urlRequest:URLRequest=new URLRequest("STORY.xml");

urlLoader.addEventListener(Event.COMPLETE,completeLoading);
urlLoader.load(urlRequest);



function completeLoading(event:Event):void {

var choice_1:Object;
var choice_2:Object;
var choice_3:Object;
var choice_4:Object;
var choice_5:Object;

story_xml=new XML(urlLoader.data);// any idea of what this does?


for (var i:Number=0; i<story_xml.OPTION.length(); i++) {

choice_1=new Object();
choice_1.label=story_xml.OPTION[i].CHOICE1;
choice_1.data=story_xml.OPTION[i].CHOICE1;
if (choice_1!=null){
choice1_combo.addItem(choice_1);}

choice_2=new Object();
choice_2.label=story_xml.OPTION[i].CHOICE2;
choice_2.data=story_xml.OPTION[i].CHOICE2;
choice2_combo.addItem(choice_2);

choice_3=new Object();
choice_3.label=story_xml.OPTION[i].CHOICE3;
choice_3.data=story_xml.OPTION[i].CHOICE3;
choice3_combo.addItem(choice_3);

choice_4=new Object();
choice_4.label=story_xml.OPTION[i].CHOICE4;
choice_4.data=story_xml.OPTION[i].CHOICE4;
choice4_combo.addItem(choice_4);

choice_5=new Object();
choice_5.label=story_xml.OPTION[i].CHOICE5;
choice_5.data=story_xml.OPTION[i].CHOICE5;
choice5_combo.addItem(choice_5);



}


}

View Replies !    View Related
Help With SelectedItem In ComboBox..
I have a combo box "sex" and an object "formData" that saves the label selected in sex. this is my coding and it works great.

//SAVING
formData.sex = sex.selectedItem.label;

traced it,, it works good...

my problem is when i want to set the combo box back to the label i saved,,,,

i thought maybe

sex.selectedItem.label = formData.sex;

but it doesnt work... anyone know the simple way of doing this?

thanks

View Replies !    View Related
ComboBox Set SelectedItem
How do I set this?

Flash documentation says this is possible, but cb.selectedItem={label:'labeltext',data:'data'}; is a no go for me. Maybe I'm missing something obvious?

Setting selectedIndex works great, but this should work too.

Can anyone get this to work?

Thanks.

sphoenixee

View Replies !    View Related
Change SelectedItem With AS.
Is it possible to change the "selectedItem" in a Tree with script?

View Replies !    View Related
Contact Form With Combox's And Check Boxes
Hi does anyone know of any tutorials to create a contact form that
includes use of a combobox, i've found loads that are just straight
input boxes and have got one working, but i've found nothing that
includes being able to set variables for a combobox.

I'm very very new at action script so that's why im looking for a
working example/tutorial so I can pick it apart and see how it works.

I've tried places like actioscript.org and flashkit but as I said above
the only contact form examples they have are just straight input text
boxes.

If anyone can point me in the right direction I would be most gratefull.

View Replies !    View Related
Contact Form With Combox To Choose Who To Send To
Hello. Iv'e been coming to this site for all my flash needs and have found everything i have needed so far but this one thing.

Im trying to create a contact form that has a dropdown menu with a list of names that can be emailed. So someone can choose who they want to email in one easy action. Im pretty new at flash so im not really sure where to begin. I've read the different tutorials on contact forms and am trying to understand PHP and XML and all... but am still pretty confused. If anyone can help me out in this or point in the right direction where to start I would really appreciate it. Thanks

Great site btw

View Replies !    View Related
How To Bold The SelectedItem In A List Box
Hi,
i am trying to make the selected item of a list box to look bold. Any help would be appreciated. Thanks in advance
Nesamani.E

View Replies !    View Related
HELP NEEDED: Get Value Of A SelectedItem In A DataGrid?
Hi everyone!

What do I have to do to get the value of a selectedItem in a DataGrid? I wan't this to happen dynamically.

1 This works:

Code:
trace(event.currentTarget.selectedItem.station_name);
Here I give the selectedItem an existing object, station_name. And it works - it gives me the value of that column/row. But this is not dynamic...

2 But I have an array consisting of the headerText values of the DataGrid I'm running the selectedItem on.

Code:
var rowDataField:String = array[event.columnIndex].headerText
So:
How do i glue event.currentTarget.selectedItem and the value of rowDataField together to form a valid statement?
For example,
Code:
trace(event.currentTarget.selectedItem.[rowDataField];

The rowDataField could be:

Code:
trace(event.currentTarget.selectedItem.station_name
trace(event.currentTarget.selectedItem.station_type
trace(event.currentTarget.selectedItem.station_address
This would then give the value that I'd want

Any ideas anyone? This is getting frustrating..
Kenwio

View Replies !    View Related
Problem To Set A SelectedItem In A List
Hi all

I have a list/component and I want to set the selection.

But this command doesn't work:

lb3.selectedItems(2);

Any idea ?

View Replies !    View Related
Refresh Combo Box SelectedItem
Hello forum

I have the following code on my first frame:

rec="myEmail@myDomain.com";
serv="php";
var fields_descriptions= Array ("",
Array("t1", "your_name", "Your Name:"),
Array("t2", "your_email", "Your Email:"),
Array("t3", "telephone", "Telephone:"),
Array("t4", "message", "Message:"),
Array("t5", "field_2", "Servicio:"),
Array("t6", "field_3", "Address:"),
Array("t7", "field_4", "fax:")
);

var field_2=my_cb.selectedItem.label;
// this line makes the combo box selected item to be this play on the email send.

for (i=1; i<=fields_descriptions.length; i++) {
this["k"+i].text=fields_descriptions[2];
}

I have the following code on my second frame:

on (release) {

var field_2=my_cb.selectedItem.label;
//I have the same line of code again so when the user selects the new value will be display. but it does not show the new value selected. How could I make the movie refresh her self so it could accept the new value enter?

for (i=1; i<_parent.fields_descriptions.length; i++) {
if (_parent[_parent.fields_descriptions[1]]!=undefined) {
this[_parent.fields_descriptions[1]]=_parent[_parent.fields_descriptions[1]]"&777&"+_parent.fields_descriptions[2];
}

}

this.recipient=_parent.rec;
i=undefined;
getURL("contact."+_parent.serv, "_blank", "POST");

for (i=1; i<_parent.fields_descriptions.length; i++) {
_parent[_parent.fields_descriptions[1]]="";
}
}

View Replies !    View Related
Refresh Combo Box SelectedItem
Hello forum

I have the following code on my first frame:

rec="myEmail@myDomain.com";
serv="php";
var fields_descriptions= Array ("",
Array("t1", "your_name", "Your Name:"),
Array("t2", "your_email", "Your Email:"),
Array("t3", "telephone", "Telephone:"),
Array("t4", "message", "Message:"),
Array("t5", "field_2", "Servicio:"),
Array("t6", "field_3", "Address:"),
Array("t7", "field_4", "fax:")
);

var field_2=my_cb.selectedItem.label;
// this line makes the combo box selected item to be this play on the email send.

for (i=1; i<=fields_descriptions.length; i++) {
this["k"+i].text=fields_descriptions[2];
}

I have the following code on my second frame:

on (release) {

var field_2=my_cb.selectedItem.label;
//I have the same line of code again so when the user selects the new value will be display. but it does not show the new value selected. How could I make the movie refresh her self so it could accept the new value enter?

for (i=1; i<_parent.fields_descriptions.length; i++) {
if (_parent[_parent.fields_descriptions[1]]!=undefined) {
this[_parent.fields_descriptions[1]]=_parent[_parent.fields_descriptions[1]]"&777&"+_parent.fields_descriptions[2];
}

}

this.recipient=_parent.rec;
i=undefined;
getURL("contact."+_parent.serv, "_blank", "POST");

for (i=1; i<_parent.fields_descriptions.length; i++) {
_parent[_parent.fields_descriptions[1]]="";
}
}

I tried a gotoAndPlay (movie,#); and it does not accept the new value selected. I tried this function on the combo box on (FocusIn), and on the two frames metion above and it does the same.

Thanks in advance

View Replies !    View Related
ComboBox Setting SelectedItem()
I’ve got a combobox, cb, for which I need to programmatically set the selection. The combobox was populated by:

cd.addItem({data:”string1”,label:”string1”});
cd.addItem({data:”string2”,label:”string2”});
cd.addItem({data:”string3”,label:”string3”});

Lets say I need to set the combobox to “string2”, I’ve tried all of the following, none work:

cb.selectedItem(“string2");
cb.selectedItem(data:"string2");
cb.selectedItem(label:"string2");
cb.selectedItem({data:"string2",label:"string2"});

The docs say selectedItem() is read/write but all the examples I can find are read only.

View Replies !    View Related
Manually Set ComboBox.selectedItem
I'm clearly not seeing the forest for the trees here.

How do I set a ComboBox to display a specific label in its list?

Current Example: ComboBox is a list of fonts : Arial, Helvetica, Courier.

I have buttons associated with text formats.

If I press a button, I want to read textFormat.font and have the combobox display the label that is the same.

I already have it so changing the ComboBox changes the font of the text, it's just when I click to the next textFormat I can't seem to get the ComboBox to reset to the current font.

View Replies !    View Related
HELP NEEDED: Get Value Of A SelectedItem In A DataGrid?
Hi everyone!

What do I have to do to get the value of a selectedItem in a DataGrid? I wan't this to happen dynamically.

1 This works:

Code:
trace(event.currentTarget.selectedItem.station_name);
Here I give the selectedItem an existing object, station_name. And it works - it gives me the value of that column/row. But this is not dynamic...

2 But I have an array consisting of the headerText values of the DataGrid I'm running the selectedItem on.

Code:
var rowDataField:String = array[event.columnIndex].headerText
So:
How do i glue event.currentTarget.selectedItem and the value of rowDataField together to form a valid statement?
For example,
Code:
trace(event.currentTarget.selectedItem.[rowDataField];
The rowDataField could be:

Code:
trace(event.currentTarget.selectedItem.station_name
trace(event.currentTarget.selectedItem.station_type
trace(event.currentTarget.selectedItem.station_address
This would then give the value that I'd want

Any ideas anyone? This is getting frustrating..
Kenwio

View Replies !    View Related
ComboBox.selectedItem --> To A String?
comboBox.selectedItem() will return an Object. How can I turn that into a String?

E.g., if the DataProvider is an array--> new Array({data: "20", label: "twenty")

tracing that selected item gives--> [object Object]

but I want to get "20". I can't simply cast it. Using Object.toString() doesn't help either.

Thanks.

View Replies !    View Related
Development Of Form W/o Using Combox Box Or Component Assets Folder
I have the need to develop a search form for one of our site with a 20k size limit. The component assets folder weighs 37k. I am searching for help or examples on how to write all the logic into a combox type drop downs.

View Replies !    View Related
Change SelectedItem From Button On Stage
I have a bunch of buttons on the stage that are not components, and I would like to press each button to set the value displayed in a combo box which is the dataprovider for a bunch of other components. is this possible?

View Replies !    View Related
Displaying SelectedItem In Tree Component
Hi,

I have a custom component that, when clicked, calls a webservice which returns an XML hierarchy. I set this hierarchy to be the dataProvider for a Tree component, which is then added to the childlist. I am searching the XML for a node which matches a specific id, and setting this node to be my Tree's selectedItem. It is finding my requested node ok, but I can't get the Tree to expand this node's parent nodes so that the selectedItem is visible. Here's my code:

private var myTree:Tree;
private var buttonText:TextField;
private var myWebservice:WebService;

//ctor
public function myComponent()
{
buttonText = new TextField();
buttonText.addEventListener(MouseEvent.CLICK, setupTree);

// Setup state change
var treeShown:State = new State();
treeShown.name = "tree_shown";
var addTree:AddChild = new AddChild(this, myTree);
treeShown.overrides[0] = addTree;
states.push(treeShown);
}




// Calls webservice to build hierarchy
private function setupTree(event:MouseEvent):void
{
myWebservice.build_hierarchy.addEventListener(Resu ltEvent.RESULT, onHierarchy);
myWebservice.build_hierarchy.send();
}




// Populates tree and sets selectedItem
private function onHierarchy(event:ResultEvent):void
{
if (event.result != null) {
myTree.dataProvider = new XML(event.result).node;
myTree.labelField = "@label";

// Searches all descendants for matching attribute
var selectedId:String = "requested_node";
var selectedNodes:XMLList = XML(myTree.dataProvider)..node.(@id==selectedId);

// Expands all parents above the matching node and sets that node to be our selectedItem
if (selectedNodes[0] != null) {
expand_parents(selectedNodes[0]);
myTree.selectedItem = selectedNodes[0];
}

currentState = "tree_shown";

}

}




// Expands each parent above the selected node
private function expand_parents(node:XML):void
{
// Validates tree so that expandItem() works...
myTree.validateNow();

while (node.parent() != null) {
node = node.parent();
myTree.expandItem(node, true);
}

}



My XML looks something like:
<nodes>
<node label="World" id="TOT">
<node label="Europe" id="EUR">
<node label="UK" id="UK"/>
<node label="Germany" id="GER"/>
<node label="France" id="FRA"/>
</node>
</node>
</nodes>



Any help would be appreciated.

View Replies !    View Related
ComboBox: Display SelectedItem In Another KeyFrame
id like to know how can i display in a combobox the selected item,

im building a form and i would like to go back to previous keyframe, that has a combobox, when i come back to this frame, i want to see in the combo the item ive already select.

thankz

View Replies !    View Related
...selectedItem.children() Returns An Error. Why?
hi,

I have a Tree komponent which structure is created from an xml file. I want to display/save in XMLList all children nodes and their attributes whenever parent node is selected. I'm trying to use selectedItem with children() but it doesnt work and I get an error value is not a function.

Code:
myTree.addEventListener(Event.CHANGE, itemChange);

function itemChange(e:Event):void
{

//var myList:XMLList = e.target.selectedItem.children();
trace(e.target.selectedItem.children());

View Replies !    View Related
ComboBox: Display SelectedItem In Another KeyFrame
id like to know how can i display in a combobox the selected item,

im building a form and i would like to go back to previous keyframe, that has a combobox, when i come back to this frame, i want to see in the combo the item ive already select.

thankz

View Replies !    View Related
Set Default SelectedItem For List Component
Any have any Idea how I can set the Default value of SeletedItem for a List component.

View Replies !    View Related
ActionScript 3 XML Basics - SelectedItem On ROLL_OVER?
Is there a way to modify this tutorial to execute selectedItem on ROLL_OVER instead of click?

I changed

lb.addEventListener(Event.CHANGE,itemChange);

to

lb.addEventListener(MouseEvent.ROLL_OVER, itemChange);

but when I rollover a list item I get:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at as3xml_finished_fla::MainTimeline/itemChange()

Thanks!

View Replies !    View Related
V2 ComboBox: Default Value Based On SelectedItem Not SelectedIndex
Ok I can't find any doco on this and it's driving me crazy. Anyone know how you specify the default value for the V2 ComboBox component based on the selectedItem when you don't know the selectedIndex? Here's my scenario:

I have a hardcoded combobox called "dd_names" with 50 names in it. I'm returning a dataset into Flash via a SQL query, and onload I need the dd_names dropdown to default to the value of the name returned in the dataset. So if the query returns "Tom" I need the dropdown to default to "Tom."

I tried setting dd_names.selectedItem = "Tom" and dd_names.value = "Tom" and these don't work. The ComboBox just defaults to the first item in the list.
However, if I use the selectedIndex property and set dd_names.selectedIndex = 3, the ComboxBox doesn't default to the first item in the list but shows the appropriate item. This doesn't help because I don't know the selectedIndex being returned from the query - I only know the selectedItem. Anyone know how to do this???

thxInAdv

View Replies !    View Related
V2 ComboBox: Default Value Based On SelectedItem Not SelectedIndex
Ok I can't find any doco on this and it's driving me crazy. Anyone know how you specify the default value for the V2 ComboBox component based on the selectedItem when you don't know the selectedIndex? Here's my scenario:

I have a hardcoded combobox called "dd_names" with 50 names in it. I'm returning a dataset into Flash via a SQL query, and onload I need the dd_names dropdown to default to the value of the name returned in the dataset. So if the query returns "Tom" I need the dropdown to default to "Tom."

I tried setting dd_names.selectedItem = "Tom" and dd_names.value = "Tom" and these don't work. The ComboBox just defaults to the first item in the list.
However, if I use the selectedIndex property and set dd_names.selectedIndex = 3, the ComboxBox doesn't default to the first item in the list but shows the appropriate item. This doesn't help because I don't know the selectedIndex being returned from the query - I only know the selectedItem. Anyone know how to do this???

thxInAdv

View Replies !    View Related
V2 ComboBox: Default Value Based On SelectedItem Not SelectedIndex
Ok I can't find any doco on this and it's driving me crazy. Anyone know how you specify the default value for the V2 ComboBox component based on the selectedItem when you don't know the selectedIndex? Here's my scenario:

I have a hardcoded combobox called "dd_names" with 50 names in it. I'm returning a dataset into Flash via a SQL query, and onload I need the dd_names dropdown to default to the value of the name returned in the dataset. So if the query returns "Tom" I need the dropdown to default to "Tom."

I tried setting dd_names.selectedItem = "Tom" and dd_names.value = "Tom" and these don't work. The ComboBox just defaults to the first item in the list.
However, if I use the selectedIndex property and set dd_names.selectedIndex = 3, the ComboxBox doesn't default to the first item in the list but shows the appropriate item. This doesn't help because I don't know the selectedIndex being returned from the query - I only know the selectedItem. Anyone know how to do this???

thxInAdv

View Replies !    View Related
If Undefined Dont Show Text That Says Undefined
Curious to know, I am using flash, .Net, and MySQL and have elements (text fields) posting in flash.

Question is, if the table in the data base is not holding the var char how can I set the text field in flash to not show undefined and just be blank?

I am about to search the heck out of this but if anyone can hit me with some insight it would be much appreciated.

Thanks in advance,
MT

View Replies !    View Related
Undefined
buttondata = new XML();
buttondata.load("buttons.xml");
buttonlist = new Array;
function myOnLoad(){
count = buttondata.firstChild.firstChild.firstChild.nodeVa lue;
var = buttonlist[1].firstChild.nodeValue;
for (i=1; i<=count; i++){
createTextField("button"+i,i,30,30+(i*20),80,50);
_root["button"+i].text = "Button"+i;
}}
buttondata.onLoad = myOnLoad;

Flash says: var is undefined. Why?

View Replies !    View Related
Undefined
Im using code: var item = CBOLoadSites.getItemAt(1); to see if any items have been loaded into a combobox. When I trace with nothing loaded in the combobox it returns "undefined".

So can I do:code: if (item=="undefined"){CBOLoadSites.addItem("site1")}or should "undefined" be "null" or just "" or what?

Thanks

View Replies !    View Related
Why 'undefined' ?
This has me baffled! I am testing an application that lets users look up the stock symbol for a company by entering the name in a text field (co_name).

The code works just fine in the test movie mode, but when it test it on the HTML publish page, I immediately get back an "undefined" value.

I integrated the LoadBar animation clip to delay the onLoad function so that the application had enough time to make the query and get back the data. Again this works fine until I try it on the web.

The HTML page and .SWF are in the same directory and on the same domain. Also, I use nearly identical code to make stock quote queries in same application and can pull back the data with no problem.

So, why will this work in Test Movie mode, but not on the web page?


code:
on(release){
var colist = new LoadVars();
url = "http://www.mycompany.com/flash_quote.cfm?co_name=";
colist.load(url + co_name, _root);

attachMovie("loadbar","loadbar",9);
loadbar._x=5;
loadbar._y=180;

colist.onLoad = function() {
removeMovieClip(loadbar);
_root.lookupWin.company_list = colist.company_list;
}
}

View Replies !    View Related
NaN Or Undefined Or What?
I am creating dynamic text that is effected by input text boxes. I have this type of code going:

dynamicText = inputText1 + inputText2;

When one of the input text boxes has nothing in it, the dynamic text box shows NaN. I tried this code to prevent it:

if (inputText1 == undefined) {
inputText1 = 0;
};

Instead of undefined, I've also tried NaN. Is there a way to make the text box always have at least a 0 or higher in it?

Thanks.

View Replies !    View Related
Undefined
//why does this code say the sharedobject is undefined when i have clearly defined it as flashcookie15?

stop();

myLocalSO = sharedobject.getLocal("flashcookie15" );

trace(myLocalSO.data.counter); // undefined???????

if (myLocalSO.data.counter > 1) {
numVisits.text = "You have been here " + myLocalSO.data.counter + " times."
gotoAndStop(4);

}else {
Play();
myLocalSO.data.counter = 1;
}
myLocalSO.data.counter++;

View Replies !    View Related
Why The 'undefined' ?
Can anyone tell me why the following code produces an 'undefined' result somewhere in the trace list. I just want it to randomly list all of the numbers from 1 to 30 (inclusive of both 1 and 30):


Code:
popped = []; // create empty array
for (var i = 1; i < 31; i++) {
popped[i] = i;
}

addNumber = function()
{
var idx = random(popped.length);
r = popped.splice(idx, 1);
if (popped.length == 0)
{
clearInterval(timer);
} else
{
trace(r);
}
}

timer = setInterval(addNumber, 100);


Thanks,
Stephen.

View Replies !    View Related
Get Rid Of Undefined...
hey, I want to trace all the names, and I have this code:

function detectAllNames() {
var all:Number = new Number();
for (all=0; all<=100; all++) {
var totalNames = new Array();
totalNames[all] = "flash"+all;
trace(totalNames);
}
}

when executed I get:

flash0
undefined,flash1
undefined,undefined,flash2
undefined,undefined,undefined,flash3
undefined,undefined,undefined,undefined,flash4
...

while I oonly want to get

flash0
flash1
flash2
flash3
...

how do I get rid of these undefined and can anyone explain me why it is that it seems to do the loop all over?

tnx

View Replies !    View Related
Undefined
hey guys im going insane with this one. can anyone tell me why mc is undefined? i used almost the same script in another frame and it works?

stop();

import mx.transitions.Tween;
var easeType:Function = mx.transitions.easing.None.easeNone;
var time:Number = 1;
var currentpos = selectedMC._x;
var startpos = 197;

new Tween(selectedMC, "_x", easeType, currentpos, startpos, time, true);

// reorder items

var startingPoint = startpos;
var previousWidth = selectedMC._width;
var gap = 30;
var menuItems:Array = ["profile", "whyus", "products", "contactus", "catalogue"];

for (i=0; i<5; i++) {
if (i != selectedNumber) {
var mc:MovieClip = this._parent[menuItems[i]];
mc._x = startingPoint+previousWidth+gap;
startingPoint = mc._x;
trace(mc);

previousWidth = mc._width;
}
}

for (i=0; i<5; i++) {
var mc:MovieClip = this._parent[menuItems[i]];
mc._alpha = 100;
}

View Replies !    View Related
Undefined Value
Hi guys...
Maybe it's too late, that's why nothing work for me...
I dont know why the nSize in following code give me an undefinded value...


Code:
class common.Card{

private var nSize:Array = new Array();
private var tFace:Array = new Array();

function Card(){
var xmlReader:XML=new XML();
xmlReader.ignoreWhite = true;
xmlReader.load("cardproperties.xml")
xmlReader.onLoad = function(bSuccess:Boolean):Void{
var xnRoot:XMLNode = xmlReader.firstChild;
var xnItem:XMLNode;
for (var i:Number = 0; i < xnRoot.childNodes.length; i++){
xnItem = xnRoot.childNodes[i];
for (var j:Number = 0 ; j < xnItem.childNodes.length; j++){
var xnSubItem:XMLNode = xnItem.childNodes[j];
if (xnItem.nodeName == "size"){
nSize.push(xnSubItem.attributes.x);
nSize.push(xnSubItem.attributes.y);
}else
tFace.push(xnSubItem.attributes.src);
}
}
trace(nSize);
}
}
}

View Replies !    View Related
Xml Undefined?...never
any thoughts why the xmlLang would read undefined?

Code:
function makeButtons() {
menuBox = this.createEmptyMovieClip("menuBox", newDep++);
menuBox.swapDepths(bg);
menuBox._x = 20;
menuBox._y = 20;
nX = 0;
nY = 0;
for (i=0; i<4; i++) {
menuBs = menuBox.attachMovie("button", "button"+i, i);
menuBs._x = nX;
menuBs._y = nY;
nY += menuBs._height;
effect.roll(menuBs);
}
makeFrame();
loadLanguage("eng");
}
makeButtons();
////////////////////////////////////////
/////////////XML////////////////
////////////////////////////////////////
var xmlLang:XML = new XML();
xmlLang.ignoreWhite = true;
function loadLanguage(lang) {
trace(lang)//works well
xmlLang.onLoad = function() {
printText(this);
};
if (lang=="itl") {

xmlLang.load("xml/italiano.xml");
} if(lang=="eng") {
xmlLang.load("xml/english.xml");
}
trace(xmlLang);// traces undefined
}
a_modified_dog....i should have listened to your 2c's on this bi-ligual project!

View Replies !    View Related
Please Help With Undefined.
I have a flash file that is not performing the way it used to.

The web page is http://www.anytimeinc.com.

As you can see, the news section says undefined. I know it pulls it's information from a txt file on the server, which I have checked does exist and is in the proper format (the file is called news.txt and is does exist in the txt directory just as all the other txt files do that work correctly), but yet I am still getting this error.

Here is the link to the fla file: http://www.hyphenpipe.com/anytime_012.fla

Can anyone take a look and see if they can find something I am missing?

Thanks!

View Replies !    View Related
Copyright 2005-08 www.BigResource.com, All rights reserved