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




Flaw / Bug In ComboBox Component



I found an infinite loop that causes a script abort in both MX03 and MX04 comboBox components. To duplicate the problem in MX04, drag a comboBox on the stage, name it and pase this code:

code: for (i=0; i<15; i++) {
myComboBox_cb.addItem(i)
}
myComboBox_cb.selectedItem = undefined;
// replace with "MyComboBox_cb.setSelecedIndex(null)" in MX03

Now, test the movie and click the comboBox once so the drop down shows then press the "a" key.

poof! infinite loop time.

Does anyone know of another way to hide the contents of a comboBox so this infinite loop does not occur?

Cheers!

Sleeve



FlashKit > Flash Help > Flash ActionScript
Posted on: 01-25-2004, 04:38 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Content To Appear In Textarea Component Based Off Of ComboBox Component Selection?
Hello all:

I have a comboBox component with different values like so:

1-10
11-19
ETC.

Depending on what value is chosen from the comboBox, a certain value needs to appear in the text area. Do I need to use a listener for this? If not, any input would be appreciated. Thanks!

JPearson311

Checkbox Component To Toggle ComboBox Component
I've got a script that dynamically generates a grid of checkboxes and combo boxes. I'm trying write a handler to toggle the Combo boxes on or off when a user clicks on the corresponding checkbox. To do this, I add a property called "bound_to" when duplicating the checkboxes. The "bound_to" property contains the instance name of the combo box that I want the checkbox to control. So here's my onChange handler:


Code:
function toggleComboBox(component) {
trace(component._name+" has been selected ");
trace("bound to "+ eval(component.bound_to));

if (eval(component.bound_to).getEnabled == true) {
trace("enabled must be true for the target");
eval(component.bound_to).setEnabled(false);
} else {
trace("enabled is false for the target");
eval(component.bound_to).setEnabled(true);
}

}
My trace actions show that the correct instance names are saved correctly and this function works to enable the combo boxes, but it won't disable them. The problem is with the IF statement I think. It always returns false so I can only toggle the combo boxes on, but not off again. Is my syntax wrong or am I doing this the wrong way?

Flash SECURITY Flaw?
Last night, my friend's website was "hacked" due to his flash intro. I have heard rumor of a security flaw that allows hackers in. Anyway the penetrator redirected all traffic that went to that site to a new url. Anyone heard of this or had an experience? Any knowlege of this? - Thanks - EnSanity

Nice Little Login Flaw...
HI! Attached the .fla for better understanding...
Jus' created a nice Login field that works quite fine, if it wasn't for one little bug: once you enter the correct Login-name but the wrong password (or no password at all), the Status-textfield, instead of returning "Login failed." (or "Forgot to fill in?"), remains silent.
Here's the code on the "OK" - button:
code: on (release) {
if (user == "user") {
if (pass == "pass") {
gotoAndStop(2);
security = 1;
}
} else {
_root.Status = "Login failed.";
}
if (user eq "" || user eq "undefined") {
_root.Status = "Forgot to fill in?";
}
if (pass eq "" || pass eq "undefined") {
_root.Status = "Forgot to fill in?";
}
}

Any ideas?
Thanks for your help!
aut.

Flaw With Transition Tutorial
Hi I have been using Voetsjabba's transition tutorial, its very good but i've been testing it with my own website and there is a serious problem.

If you try running voetsjabba's transition example, it works fine, however try this

click on section 1 button,

now (whilst the transition movie for section 1 playing hit section 2 button )

nothing happens, you may argue that this is meant to happen, but the main problem is that if you try hitting the section 2 button whilst everything has stopped nothing will happen, it will stay on the current movie.

Try the example and you'll find out.

However there must be a solution to this problem, the following is the code used for the buttons,

on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "temp";
content.loadMovie("temp.swf");
} else if (_root.currMovie != "temp") {
if (content._currentframe>=content.midframe) {
_root.currMovie = "temp";
content.play();
}
}
}


There must be a way where u can alter this code so that everytime a button is pressed something will definately happen.

I'd be grateful for help.

Flaw With Transition Tutorial
Hi I have been using Voetsjabba's transition tutorial, its very good but i've been testing it with my own website and there is a serious problem.

If you try running voetsjabba's transition example, it works fine, however try this

click on section 1 button,

now (whilst the transition movie for section 1 playing hit section 2 button )

nothing happens, you may argue that this is meant to happen, but the main problem is that if you try hitting the section 2 button whilst everything has stopped nothing will happen, it will stay on the current movie.

Try the example and you'll find out.

However there must be a solution to this problem, the following is the code used for the buttons,

on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "temp";
content.loadMovie("temp.swf");
} else if (_root.currMovie != "temp") {
if (content._currentframe>=content.midframe) {
_root.currMovie = "temp";
content.play();
}
}
}


There must be a way where u can alter this code so that everytime a button is pressed something will definately happen.

I'd be grateful for help.

Cool Preloader With A Minor Flaw?
Could someone please let me know what is wrong with this preloader? It appears to work however I recently discovered, it is only about 98% accurate so even though it appears to work, any component that required your web page to be 100% preloaded will fail.



http://www.flashkit.com/movies/Scrip...5463/index.php


I like this one because it only takes one frame of your movie and a lot of people have commented on the nice readout.

Dynamic Content Flaw Or Geocities Problem?
ok fellas. quick question, but a little background first. my web page is set up so that i am showing different projects within a window on my page. all the projects are in another .swf movie that i am calling 'library.swf'. in my library.swf i have nothing on the main timeline, but am loading all the project MC's from the library of library.swf into the main page. all goes well when i load test my movies on IE 5.5 local. but when i upload and test my site on geocities, the projects dont show up in the window most of the time. i have everything organized exactly as it is in my local file folders. i dont think i am doing anything wrong, but it just doesnt load sometimes. is this a scripting problem or a typical geocities free interenet space problem?

Data Encapsulation FLAW On Arrays In Actionscript 2.0?
I have been programming in Actionscript 2.0 using the class constructs and I have run into something which is kind of curious which I would like to share with you all. It would seem that Actionscript 2.0 has a flaw in handling data encapsulation in dealing with Arrays.
Try this: create a class, say Car, and define it this manner:

ActionScript Code:
class Vehicle {
   private var numberOfWheels:Number;
   private var vehicleName:String;
   private var occupants:Array = new Array();
   public function Car (vName:String, nWheels:Number) {
      vehicleName=vName;
      numberOfWheels=nWheels;
   }
   public function addOccupant (occ:Occupant):Void {
      occupants.push(occ);
   }
   public function numberOfOccupants():Number {
      return occupants.length;   
   }
   public function listOccupants():Void {
      for (var i:Number=0; i<occupants.length;i++) {
      trace(occupants[i].getName());   
      }
   }
}
Now create the class to hold the occupants as follows:

ActionScript Code:
class Occupant {
   private var nameOfOccupant:String;
   private var ageOfOccupant:Number;
   private var isDriver:Boolean;
   public function Occupant (oName:String, oAge:Number, oIsDriver:Boolean) {
      nameOfOccupant=oName;
      ageOfOccupant=oAge;
      isDriver=oIsDriver;    
   }   
   public function getName():String {
    return nameOfOccupant;   
   }
}
Finally, create this code at the movie root:

ActionScript Code:
// create a new vehicle and fill it with 3 occupants
var car:Vehicle= new Vehicle("Jeep", 3)
// now fill it up with 3 passengers
var occ:Occupant =new Occupant ("Marco", 46, true);
car.addOccupant(occ);
occ=new Occupant ("Mary", 42, false);
car.addOccupant(occ);
occ=new Occupant ("John", 12, false);
car.addOccupant(occ);
// now the car has three passengers
// you can confirm it here:
trace(car.numberOfOccupants());
// now let's create a completely different vehicle:
var bike:Vehicle= new Vehicle("bicicle", 1)
// and let's add the passsenger for the bike
occ=new Occupant ("Tom", 16, true);
bike.addOccupant(occ);
// NOW watch this:
trace(car.numberOfOccupants());
// returns 4 and not 3!
trace(bike.numberOfOccupants());
// returns 4 and not 1!
// both arrays, instatiated as private variables in separate instances, point to the same data!
bike.listOccupants()
// you get:
//Marco
//Mary
//John
//Tom
It seems as though Actionscript is not properly encapsulating the arrays. All the other private data items (names, number of wheels, and so on) are being dealt with correctly but arrays are not.

As I am not an expert on Actionscript I may be misunderstanding the nature of the Array type but I would expect it to have created two completely independent arrays and not be addressing the same one!
Am I doing something wrong? What do you think?
BTW: I have tried this with Flash MX 2004 Professional and with Flash 8 with the same results.

Advanced: Question About Image Loader Problem (flaw?)
Hi all,

I'm struggling with this annoying thing which I think is a bug or some kind of flaw in Flash MX (Pro 2004).

In this huge website, I've implemented a variable image loader (9 images aligned in a horiz. row, loaded by loader component, mouseover results in different loaderinstances to become visible - coloured versions of original) Howeverm, in one in 20 times one image doesn't quite load as it should, it moves itself (the image in a loaderinstance) 1 mm to the left or right and upwards or downwards...

This can happen once, and when I reload the same page, it's not there anymore.. So it is not that the mouseover/mouseout images different in size, it's just some kind of ... who knows what ...

Has anyone encountered the same problem or knows about this flaw ? Or am I just doing something amazingly wrong...

Thanks in advance !!!!!
Roel

ComboBox Component
Anybody know how to use this thing? (comboBox)
i've been messin around with is and have gotten nowhere, all i want to do is have 4 or 5 labels in it that simply do a getUrl, if anyone could show me a sample script to do this, or maybe some tutorials or something, i'd really apreciate it.

Help Me With ComboBOX Component PLEASE
WTF man I dont get it HOW THE **** do I add items to this drop down menu!? where, how WHAT THE HELL DO I DO PLEASE HELLLLLLLLLLLLLLLLLP!

PLEASE HELP ComboBox Component Is Beyond Me
OK! To start with, I'm an animator, not a coder. So, for whatever reason, I'm an idiot and can't figure this out.

I've used the Flash MX Tutorials and AS Dictionary, but still need a more simplified explanation.

All I need is a few different ComboBoxes that work with an existing Dynamic Text Field. One ComboBox changes the text's size, another changes the font, another change's the font color, another changes it to bold/italic, and another changes the background of the font.

I know how to set up the ComboBoxes so the labels, data, and handler are OK. But I know I'm messing up with the AS for the first frame of the movie. How do I write (the function?) so if someone selects different labels of any ComboBox, it automatically changes the Dynamic Test field appropriately?

Thank you!

--Darcie

ComboBox Component Help
I want to use the combo box component as a jump menu. I made a function and assigned that function to the event handler. How do I determine what data is used in that function? My function looks like this:

function jumpSwitch (newPalette) {
for (j=0; j < 1024; j++) {
var movieName = "sampleMovie" + j;
var miniPixel = "miniMovie" + j;
var frameNumber = getProperty (_root[movieName], _currentframe) + (15 * (currentPaletteNumber - lastPaletteNumber));
var miniFrameNumber = getProperty (_root[miniPixel], _currentframe) + (15 * (currentPaletteNumber - lastPaletteNumber));
_root[movieName].gotoAndStop(frameNumber);
_root[miniPixel].gotoAndStop(miniFrameNumber);
getProperty(_root[movieName], _currentframe);
lastPaletteNumber = getProperty(this, _currentframe);
currentPaletteNumber = newPalette;
}
}

I want the data that is to be place in there to replace newPalette in the function parameters. How do I do this? Thanks for the help.

ComboBox Component
I want to use a comboBox like a group of buttons each seletion in the box will tell the movie to goto or move selection in a bounding box to a new section. I have never used the components before and I have tried to enter in all sorts of stuff in the property inspector for the component but no go. So all I want is the different selections in the comboBox to tell an object to do something with AS.

Combobox Component
hi,
i am trying to send the values selected from a combobox to a php file, how can I do that?

thank you

ComboBox Component
Where can I change the color of the text in the combobox components?
I tried searching in the components skin library but without succes.

Can someone tell me specificly where I can change the boring black characters into some nice catchy colored ones?

Thanx in advance.

Combobox Component
i have a combobox and have a bunch of things listed in it, but I need to make it so when they click one of the options, it acts like a button and goes to somewhere. How do I do this?!?!

Regarding Combobox Component
I add the labels in the Combobox but don't now how to open the websites on selecting of labels. Please tell me how to do it in flashMX.

ComboBox (Component)
How can you dynamically add things to the combo box and add their data? I tried doing
code:
usernameselect_cb.labelField = [];

and in the [] there are variables. But that didn't work.
(Also, the vars are called username and a number (such as username1). There are diff amounts of these. How can I make it only show the number of usernames there are without it saying undefined when one doesn't exist? (They go up in order, there will never be a missing one)

Combobox Component
Hi,
I have a combobox component with two labels,.. correct and incorrect. my data is 0,1

meaning 0= incorrect and 1 = correct. I am trying to get my main movie(level1) to look at the data in the combobox, to see what the value is, and from their depending on the value, it either sends it to a frame label in the main movie for "correct" or incorrect" does anyone know what the code would be for this? the name of the combo box instance is "answer1".

thanks in advance.

Mike

ComboBox Component
Hi. I want to make a combobox with a rounded button. OK, I got it. But now I want to change the color of the stripe over the itnes. It's green by default. I looked for on the documentation and did not find: how to change it? Does it has to do with themes or skinning?
tnx

ComboBox Component?
any good tutorials on using the ComboBox component to create a drop down list, where your selection becomes text with an instance name and can then be sent on as a variable?

any help appreciated...thanks!

Please Help, ComboBox Component?
i need help badly!!! i am pulling my hair out from this. i am using the new flash 8 and am trying to put a "comboBox" component in. i want to make it so when they click on the item in the list it opens a browser window to the deminsions i specify and load a URL.

please help.
thanks,
mike

ComboBox Component
I'm playing around with the comboBox Component and getting a list of items in it with success.

How do i use a ahref link to load a new browser window and website from the dropdown list i'm creating?

sure this is not too hard but i'm still unfamiliar to the way it all works.

Rat

Combobox Component Help
I need for the combobox to default its selection to a variable that I pass in. Currently each time the user opens up the window with the combobox it goes back to the first position and the person has to redo his selection.

Does anybody know how to do this?

Thanks!

Colby

ComboBox Component
Hi,
I am trying to get my CombBox component to display values opening from the bottom up versus top down. Is there a way to configure that? Is it a skin element. Any help would be greatly appreciated.

Thanks in advance,
Mike

A Bug In AS3 Combobox Component
Hi,
i'm working in flash 9/AS 3, and added to one of my swf (which loads into
the main one) a combo-box component. when its data provider property is
empty, and i play the main swf - the combo box is there, empty of-course,
and nothing happens when i click it. however, when i add data manually to
the data provider property of the component (single item), and then play the
main swf - the combo-box is still empty, and when clicked (doesn't matter
where on the component), i get the following error:
TypeError: Error #1009: Cannot access a property or method of a null object
reference.
at
fl.containers::BaseScrollPane/fl.containers:BaseScrollPane::drawBackground()
at fl.controls::List/fl.controls:List::draw()
at fl.core::UIComponent/drawNow()
at fl.controls::List/scrollToIndex()
at fl.controls::SelectableList/scrollToSelected()
at fl.controls::ComboBox/open()
at fl.controls::ComboBox/fl.controls:ComboBox::onToggleListVisibility()

and when clicked again, this error pops:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of
the caller.
at flash.display::DisplayObjectContainer/removeChild()
at fl.controls::ComboBox/close()
at fl.controls::ComboBox/fl.controls:ComboBox::onToggleListVisibility()

when i tested the inner swf, there was no problem, and when i made another
test, with an empty movie, containing only the following code:

var ur:URLRequest = new
URLRequest("C:\Users\eRez\Documents\AllOfMe\Timeline019\swf\balloon.swf");
var loader:Loader = new Loader();
loader.load(ur);
this.addChild(loader);

there were no problems at all.

does anybody have any idea where all of this comes from?
thanks in advacne,
eRez
www.AllofMe.com

Help With Combobox Component...please
I cannot figure this one out, I have two comboboxes, type_cb and loc_cb. Whenever I click them, they steal focus from all the other movieclips.

How do I remove focus from them???
I tried doing this:

type_cb.drawFocus = null;
type_cb.dropdown.drawFocus = null;
loc_cb.drawFocus = null;
loc_cb.dropdown.drawFocus = null;

and also tried setting the focus to the movieclips. The first one did nothing, and the second put an ugly yellow box around my movieclips....any ideas as to whats causing this??? Thanks alot

ComboBox Component
Where can I change the color of the text in the combobox components? I tried searching in the components skin library but without succes.

Can someone tell me specificly where I can change the boring black characters into some nice catchy colored ones?

Thanx in advance.

ComboBox Component
Hi, there!

I have a question about a problem I just got into!

//
I am using a combobox and some list components; when you select an item from the combobox the list component will change according to that selection (that was easy)... but now when I use this script: (hotels.selectedIndex = hotels.length-anynumber the list component does not change until I "personaly" select an item from the combo!... Why when I select an item using that line-scrip my list-components does not change?
//


THANKS A LOT!!!

ComboBox Component
I am trying to use the combobox component for the first time and having a bit of trouble. All I want to do is have two choices in the drop menu. user picks one of the two choices, clicks next (component button) and goes to scene "xyz" based on the selection.

example would be... input text field and button with script like...
on (release) {
set(processname, "XSTS01");
if (processname == "XSTS01") {
gotoAndPlay("Scene 2", 1);
}
}

any help appreciated...

Combobox Component Help
HEy all,

I was wondering how many columns of data a flash combobox can have.

Explanation:

I want to associate a "name", "date1", and "date 2" into a combobox.
Where the dates would be data, and name would be a label.
I know how to call tha label and data like so.


Code:
combobox.getSelectedItem().label
combobox.getSelectedItem().data
Is there any way to have more than one "data field" for each label?


Is something like this possible:

Code:
combobox.addItem(ComboSites,ComboURLs[i], [i]ComboEnds[i]) ;
Any help or input is really appreciated.

Thanks,
Limitlis

ComboBox Component And PHP Help
hey all,

i have a combo box component and i want when you click on the option my php will load a html file which i will edit through flash but yeh...i'm just having the problem with how to click and have an action do something (i.e. load php file) from the component.

any ideas???

Cheers in advance Peeps

AS 2 Help With Combobox Ui Component
I'm working on some changes to a recently purchased flash template. One of the changes that needs to be made is to modify the dates on a year selection drop down box.



it starts at 2005 and only gives the option to select through 2007. I need to modify this to make years through 2010 selectable options. My biggest problem is that I don't know what to look for in the code.

You can take a look at the .fla here: http://projectnemeth.com/other/mvoy.fla

I would appreciate any help.

ComboBox Component
Where can I change the color of the text in the combobox components? I tried searching in the components skin library but without succes.

Can someone tell me specificly where I can change the boring black characters into some nice catchy colored ones?

Thanx in advance.

ComboBox Component
Hi, there!

I have a question about a problem I just got into!

//
I am using a combobox and some list components; when you select an item from the combobox the list component will change according to that selection (that was easy)... but now when I use this script: (hotels.selectedIndex = hotels.length-anynumber the list component does not change until I "personaly" select an item from the combo!... Why when I select an item using that line-scrip my list-components does not change?
//


THANKS A LOT!!!

Using The Combobox Component
hello all,

ok, i have a combobox component with some values: val1, val2

when user clicks a value i want to move the playhead to a frame where the contect will be shown

this would be the pseudo code for it:

===
if val1 gotoAndStop(1);
set the combobox to show val1;
===

i've set up the changeHandler and i've added my function to the first keyframe of the movie - it's just the syntax i'm struggling with

can anybody help me with the actionscript please?

cheers

ComboBox Component
I am trying to use the combobox component for the first time and having a bit of trouble. All I want to do is have two choices in the drop menu. user picks one of the two choices, clicks next (component button) and goes to scene "xyz" based on the selection.

example would be... input text field and button with script like...
on (release) {
set(processname, "XSTS01");
if (processname == "XSTS01") {
gotoAndPlay("Scene 2", 1);
}
}

any help appreciated...

Combobox Component Help
HEy all,

I was wondering how many columns of data a flash combobox can have.

Explanation:

I want to associate a "name", "date1", and "date 2" into a combobox.
Where the dates would be data, and name would be a label.
I know how to call tha label and data like so.


Code:
combobox.getSelectedItem().label
combobox.getSelectedItem().data
Is there any way to have more than one "data field" for each label?


Is something like this possible:

Code:
combobox.addItem(ComboSites,ComboURLs[i], [i]ComboEnds[i]) ;
Any help or input is really appreciated.

Thanks,
Limitlis

Using The ComboBox Component
I am working on a project where the user can click on a country (from a world map) and see if it has a missle defense system and other information about the it.

Some of the countries are so small, that I think the end user might have a problem clicking the right country, so I thought it would be cool to also include a ComboBox so that they can easily select the country they want to see.

I have all of the country names in the combobox as "labels" but how do I tell the combobox to load cuba.swf when they select cuba in the menu?

Bug With ComboBox Component?
I have included two comboBox components in my file.  After clicking on either of them then my other buttons do not work properly.

For example,
1) I have a view_cb that lists different viewing ratios such as 200, 150, 100, and 50.  (The movie then scales by the number selected).
2) I also have two buttons (dec_btn and inc_btn) that also control the scaling of the movie.  Each time one of these buttons is pushed then the movie's x/y scale decrements/increments by 10.

These two functions work fine seperately, but if I manipulate the combobox first, and then try the buttons --> After I press the buttons, I must move the mouse to another location on the buttons before I press them again.

This has to be a bug...does anyone know how to work around this?  What should I do to solve this?  Any suggestions are greatly appreciated as this has stumped me for some time now.  Thank you -
  Frank

Help With Combobox Component Pls
Hi, I need help with a comboBox on my flash to php form, everything works good on the form, except for the comoboBox. it is not sending de values.

this is what I get in the mail for the comboboxes:

Producto: [object Object]
Presentación: [object Object]

my comboBox components on stage are:

prods_cb
size_cb

so here my "firstFrameCode"

please ignore the long style code =(

///////////////////////////////////////////////////////////////////////////////////////////

fscommand ("allowscale", "false");

//------------------------------------ style code

import mx.styles.CSSStyleDeclaration;

var new_style:Object = new CSSStyleDeclaration();
_global.styles.myStyle = new_style;

new_style.setStyle("themeColor", "0xd7c57e");
new_style.setStyle("backgroundColor", "0xF0E8CA");
new_style.setStyle("fontFamily ","verdana");
new_style.setStyle("fontSize","11");
new_style.setStyle("color","0x775422");
new_style.setStyle("textAlign", "left");
new_style.setStyle("textSelectedColor", "0x775422");
new_style.setStyle("textRollOverColor", "0x775422");
new_style.setStyle("useRollOver",true);
new_style.setStyle("borderStyle", "solid");
new_style.setStyle("alternatingRowColors", [0xe6d9ad, 0xe9ddb5]);

prods_cb.setStyle("styleName", "myStyle");
size_cb.setStyle("styleName", "myStyle");

//------------------------------------ end of comboBox styles

cname1.borderColor = 0xC1A744;
cname1.backgroundColor = 0xECD78E;
bname1.borderColor = 0xC1A744;
bname1.backgroundColor = 0xECD78E;
email1.borderColor = 0xC1A744;
email1.backgroundColor = 0xECD78E;
telno1.borderColor = 0xC1A744;
telno1.backgroundColor = 0xECD78E;
canti1.borderColor = 0xC1A744;
canti1.backgroundColor = 0xECD78E;

cname1.onSetFocus = function() {
cname1.backgroundColor = 0xF0E8CA;
cname1.borderColor = 0xC1A744;
};
cname1.onKillFocus = function() {
cname1.backgroundColor = 0xEAE0B3;
cname1.borderColor = 0x775422;
};
bname1.onSetFocus = function() {
bname1.backgroundColor = 0xF0E8CA;
bname1.borderColor = 0xC1A744;
};
bname1.onKillFocus = function() {
bname1.backgroundColor = 0xEAE0B3;
bname1.borderColor = 0x775422;
};
email1.onSetFocus = function() {
email1.backgroundColor = 0xF0E8CA;
email1.borderColor = 0xC1A744;
};
email1.onKillFocus = function() {
email1.backgroundColor = 0xEAE0B3;
email1.borderColor = 0x775422;
};
telno1.onSetFocus = function() {
telno1.backgroundColor = 0xF0E8CA;
telno1.borderColor = 0xC1A744;
};
telno1.onKillFocus = function() {
telno1.backgroundColor = 0xEAE0B3;
telno1.borderColor = 0x775422;
};
canti1.onSetFocus = function() {
canti1.backgroundColor = 0xF0E8CA;
canti1.borderColor = 0xC1A744;
};
canti1.onKillFocus = function() {
canti1.backgroundColor = 0xEAE0B3;
canti1.borderColor = 0x775422;
};

//------------------------------------ end of inputText styles

//------------------------------------ tabIndex and data

cname1.tabIndex = 1;
bname1.tabIndex = 2;
email1.tabIndex = 3;
telno1.tabIndex = 4;
prods_cb.tabIndex = 5;
size_cb.tabIndex = 6;
canti1.tabIndex = 7
send_btn.tabIndex = 8;

size_cb.addItem({data:0, label:""});
size_cb.addItem({data:1, label:"1Lt"});
size_cb.addItem({data:2, label:"5Lt"});
size_cb.addItem({data:3, label:"20Lt"});
size_cb.addItem({data:4, label:"1000Lt"});

prods_cb.addItem({data:0, label:""});
prods_cb.addItem({data:1, label:"Aminolom Algas Complex"});
prods_cb.addItem({data:2, label:"Aminolom Calcio"});
prods_cb.addItem({data:3, label:"Aminolom Calcio Boro"});
prods_cb.addItem({data:4, label:"Aminolom Cebo"});
prods_cb.addItem({data:5, label:"Aminolom Cuaje"});
prods_cb.addItem({data:6, label:"Aminolom Enzimatico Foliar 12%"});
prods_cb.addItem({data:7, label:"Aminolom Enzimatico Radicular 6%"});
prods_cb.addItem({data:8, label:"Aminolom Floraci&oacute;n"});
prods_cb.addItem({data:9, label:"Aminolom Liquido 5-15-5"});
prods_cb.addItem({data:10, label:"Aminolom Liquido 12-4-6"});
prods_cb.addItem({data:11, label:"Aminolom Liquido 4-8-10"});
prods_cb.addItem({data:12, label:"Aminolom Liquido 8-4-8"});
prods_cb.addItem({data:13, label:"Aminolom Maduraci&oacute;n"});
prods_cb.addItem({data:14, label:"Aminolom Magnesio"});
prods_cb.addItem({data:15, label:"Aminolom Manganeso"});
prods_cb.addItem({data:16, label:"Aminolom Molibdeno"});
prods_cb.addItem({data:17, label:"Aminolom Multimineral"});
prods_cb.addItem({data:18, label:"Aminolom Oleico"});
prods_cb.addItem({data:19, label:"Aminolom Olivo"});
prods_cb.addItem({data:20, label:"Aminolom P H"});
prods_cb.addItem({data:21, label:"Aminolom Raiz"});
prods_cb.addItem({data:22, label:"Aminolom Super 40"});
prods_cb.addItem({data:23, label:"Aminolom TGV"});

//////////////////////////////// THIS IS WHERE I NEED HELP ////////////////////////////////

//------------------------------------ for Products comboBox


product = new Object();
product.change = function(eventObj)
{
var eventSource = eventObj.target;

var theSelectedItem = eventSource.selectedItem;
var theSelectedItemLabel = theSelectedItem.label;

trace ( "You selected "+theSelectedItemLabel+".");
}
prods_cb.addEventListener ("change", product);


//------------------------------------ for size comboBox


var cb2Listener:Object = new Object();
cb2Listener.change = function (evt_obj:Object) {
trace("Currently selected item is: " + evt_obj.target.selectedItem.label);
}

size_cb.addEventListener("change", cb2Listener);
size = cb2Listener;


// non of them work

//------------------------------------ functions

String.prototype.isNumbers = function() {
if (this.length<1) {
return false;
}
for (i=0; i<this.length; i++) {
code = this.charCodeAt(i);
if (this.charAt(i) != " " && code<48 || code>57) {
return false;
}
}
return true;
};

//------------------------------------

mailform = "mailform_cotizacion.php";
confirm = "Esperando confirmación ..."
action = "send";
Selection.setFocus("cname");
function validate (address) {
if (address.length>=7) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.lastIndexOf(".")) {
if (address.lastIndexOf(".")<(address.length-2)) {
return (true);
}
}
}
}
return (false);
}
function formcheck () {
if ((((email == null)) || (email.length<1)) || (email == "ERROR! Address not valid")) {
email = "ERROR! Address not valid";
action = "";
}
if (!validate(email)) {
email = "Dato requerido";
action = "";
}
if ((((cname == null)) || (cname.length<1)) || (cname == "ERROR! Address not valid")) {
cname = "Dato requerido";
action = "";
}
if ((((bname == null)) || (bname.length<1)) || (bname == "ERROR! Address not valid")) {
bname = "Dato requerido";
action = "";
}
if ((((size_cb.text == null)) || (size_cb.text.length<1)) || (size_cb.text == "ERROR! Address not valid")) {
error2 = "seleccione una presentación";
action = "";
}
if ((((prods_cb.text == null)) || (prods_cb.text.length<1)) || (prods_cb.text == "ERROR! Address not valid")) {
error = "seleccione un producto";
action = "";
}
if ((((telno == null)) || (telno.length<1 or telno.isNumbers() == false)) || (telno == "ERROR! Address not valid")) {
telno = "Ingrese teléfono";
action = "";
}
if ((((canti == null)) || (canti.length<1 or canti.isNumbers() == false)) || (canti == "ERROR! Address not valid")) {
canti = "ingrese un número";
action = "";
}
if ((validate(email)) && (email != "ERROR!") && (cname != "") && (bname != "") && (culti != "") && (product != "") && (canti.isNumbers() == true) && (size != "") && (telno.isNumbers() == true)) {
action = "send";
loadVariablesNum (mailform, 0, "POST");
gotoAndPlay ("wait");
}
}
stop ();


//------------------------------------ THE PHP

<?

$adminaddress = "fabrizio.piazze@gmail.com";
$siteaddress ="http://www.gcgloblacrops.com.pe";
$sitename = "GC Globalcrops";

$date = date("m/d/Y H:i:s");

if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);


if ($action != ""):
mail("$adminaddress","Solicito cotización",
"Un visitante de $sitename ha solicitado la siguiente cotización:

Nombre de contacto: $cname
Empresa: $bname
Email: $email
Teléfono: $telno

Producto: $product

Presentación: $size

Cantidad: $canti

The visitor commented:
------------------------------
$comments

Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time: $date","FROM:$adminaddress");

mail("$email","Thank You for visiting $sitename",
"Hi $cname,

Thank you for your interest in $sitename!

Cheers,
$sitename
$siteaddress","FROM:$adminaddress");

$sendresult = "Thank you for visiting <a href = "$siteaddress" target = "_blank"><u>$sitename</u></a>. You will receive a confirmation email shortly. ";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo "$send_answer";

endif;

?>

//------------------------------------ THE FILES !
Here the form http://www.gcglobalcrops.com/NwSite/cotizacion1.html

to donwload the fla, swf, html, and php clic here


Thank You so much in advance!

ComboBox Component / XML
I have a ComboBox that is populated via XML from this code:

Code:

(I left the brackets off becuse for some reason everything was getting deleted when I submit it to the forum)


menu

   item label="Select >>" data="0"

   item label="Credit cards" data="1" url="https://www.mycardstatement.com" target="_blank"

   item label="eStatement Enrollment" data="2" url="https://estatements.ffbla.com" target="_blank"

   item label="Investments" data="3" url="http://www.eprimevest.com" target="_blank"

   item label="Insurance" data="4" url="http://www.digop.com" target="_self"

/menu




Everything is working fine except the first "item" is not displayed in combo box by default... instead some funky error is there.

Error says: [type Function], [type Function],

I've tried everything I can think of and am to the point where I want to give up and make my own from scratch... sometimes I hate components!

Here is the Actionscript:
("combo" is the variable of the combo box component)

Code:

var xml:XML = new XML();
xml.ignoreWhite = true;


xml.onLoad = function() {
   combo.dataProvider = this.firstChild.childNodes;
   combo.selectedIndex = 0;
}

xml.load("menu.xml");

var comboL:Object = new Object();
comboL.change = function() {
   var item = combo.selectedItem;
   var link = item.attributes.url;
   var win = item.attributes.target;
   if(link) {
      getURL(link,win);
   }
}

combo.addEventListener("change",comboL);


Any help or insight is GREATLY appreciated! :)

ComboBox Component - Configuration
Hi there... I don't know how to do this...
I need to put the link in my combobox component and this link must open a new window (_blank), but I don't konw how. Can somebody tell me how... please...

ComboBox Component Issue
I have a movie loaded at level 30. It has a ComboBox in it. When the ComboBox is clicked, however, the drop-down list is obscured by movies loaded at levels 19 and 18.

I put a button on the movie loaded at level 30 to drag it, as a test. Sure enough, when I drag the movie, it always remains above the movies loaded at lower levels, as you would expect. However, when I click the combo box, it consistently appears below the other movies.

Can anyone help me with this one?

ComboBox Component Problems
hi
i'm looking for a way to make my ComboBox component in Flash MX to have actions assigned to it... i need to assign the loadVariables action and the gotoAndPlay. I need to have A LOT of items in this combobox, about 80 or so. When you click a choice in the combobox i want it to loadVariables and then gotoAndPlay a different frame. This is very urgent and I need a response ASAP.
Thank you
Peter

Problem With Combobox Component
Hi
How to add labels to combobox by actionscript from a database or text file.

Thanks

LoadVars + Combobox Component
I am using a LoadVars object to load variables from an ASP file. Once the data has been loaded, I am trying to use the data to dynamically populate a combobox component. The problem I am having is that the combobox is only displaying the item.

I have verified that all of the data is being loaded into my Flash movie.

The strange thing is that when I load the input from a text file it loads fine but when I load from the ASP file the combobox doesn't populate properly.

Frame 1 code:

stop();
varReceiver = new LoadVars();
varReceiver.onLoad = handleLoad;
function handleLoad(success) {
if (success) {
gotoAndPlay("interface");
}
}
varReceiver.load("http://mydomain.com/SGSelector.asp");

Frame 2 code:

aryRegionNames = varReceiver.NavListParent.split("|");
aryRegionIDs = varReceiver.NavListParentID.split("|");
for (var i = 0; i<aryRegionNames.length; i++) {
myComboBox.addItem(aryRegionNames[i], aryRegionIDs[i]);
}

Copyright © 2005-08 www.BigResource.com, All rights reserved