PDA

View Full Version : flash bug in components?


eggnogg
05-07-2003, 03:23 PM
heya

i found a bug! probably it's just a script thing but who cares? i do!

I got a comboBox with a few items on the list, in _root.form and a dynamic text box to display the item's price. I had a button that:
on (Click) { _root.form.mcInstance.getSelectedItem().data; }
but i had to change the way the price was showed, so that on ("over item, from drop down list, of component") { _root.form.mcInstance.getSelectedItem().data; }

//so that when i roll the mouse on an item it automaticly returnas the price of it, without having to click any buttons to do so.

.

To do this i just created a new MC inside the form clip to be used as a loop, with two frames. on the first frame i put this code:


_parent.b1 = (_parent.processador.getSelectedItem().data);
//this gets the value of the "selected" item and iquals b1 (which is the dynamic text box's variable) to the selected item's data (price)


...leaving the second frame empty.!This makes the dynamic price text box return the price on the item that the mouse in on, every 0.01 seconds. so far so good? :D

now, the component has the first item set to blank, with "- - -" as the value and "zero" being the data associated. this leads me to The problem! : [u]when i drop down the menu and i put the mouse over an item, the price appears, (cool!) but if i do this and move the mouse out of the component's area and click anywhere on the stage, the menu will go up (drop up!), the item where the mouse was over does'nt stay select ( the top item "- - -" is "auto-selected" ), BUT the price of the previous item i was about to click remains in the dynamic text box, and does NOT update to the data "zero"! :/

summary: if you drop down a D.D. menu, select an item without actually clicking on it, flash recognizes it as being selected, but in reality what the component shows is that it IS NOT selected!!

i dunno what the hell's wrong with this! the script is correct (it works, although there might be a more appropriate script for this) but still, i call that a bug, dont you?!

i hope someone can gimme a hint on a more reliable script for this!

regards,
eggnogg :cool:

zoomfreddy
05-08-2003, 05:39 AM
what about making it auto selected:


_root.form.mcInstance.setSelectedIndex(this.getSel ectedItem());
//feels buggy, but may work;


...i don't think it is a bug, the components have a way to detect stuff happening, if you change some behavior, it may lead to unspected things.

eggnogg
05-08-2003, 09:04 AM
heya freddycodes

err..what is the this. in this.getSelectedItem() ?

regards
eggnogg

zoomfreddy
05-08-2003, 10:51 PM
hehe, not Freddycodes...Zoomfreddy...

didnīt read well your post (wrong path i guess):)
You are using a mc to pull the selected stuff on the combobox, but the combobox does not get a clue about what was selected, so you need to force the selection in a way the combo gets the info:



//if you use this path to get the data:
_root.form.mcInstance.getSelectedItem().data;
//i assume you set the selected item(index) with the same path then...
_root.form.mcInstance.setSelectedIndex(_root.form. mcInstance.getSelectedItem());


:p

eggnogg
05-09-2003, 09:27 AM
heya zoomfreddy! sorry bout dat, i was brain-fried with to much coding. hehe ;)

thx man!
i got this script working fine! :D

_parent.processador.setSelectedIndex(_parent.proce ssador.getSelectedItem());
_parent.b1 = _parent.processador.getSelectedItem().data;

- this script is in (_root.form.priceList);
- processador is a comboBox in form MC;
- b1 is the dynamic box associated with processador, and displays the price (of the type of computer processor).

The problem is that i have 24 comboBoxes in form MC and the priceListCheck MC has the above piece of code running every 0.01 seconds, for all 24 comboBoxes, which makes the movie run really slow! :/ i was thinking on creating a MC with that piece of code, for each comboBox, but i don't know if i can use a onClipEvent handler on a comboBox...a comboBox is a movie clip right? is so, i was thinking on running a MC with that piece of code, when the mouse rolls over each component movie clip!
got any ideas? :D

(check the "flash bgus in components? part 2" to see how the whole code is)

regards
eggnogg :cool:

zoomfreddy
05-09-2003, 11:44 AM
mmm...haven't made something like your stuff yet, but maybe you can solve the prob by using "watch", search for it on the reference panel, and letme know how it goes :)

buggedcom
05-09-2003, 10:16 PM
*unreleated*

i like you avatar eggnog, not seen a naked lady avatar b4 :D *dirty grin*

Ricod
05-10-2003, 08:40 AM
lol ! And here I thought it was problem related ... :rolleyes:

eggnogg
05-10-2003, 09:18 AM
lol :D

naked women are the best ones ;)


er...how about a hint on my question pls? :p :D i promisse i'll get a better avatar if so! hehe

regards!
eggnogg