Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 4th, 2003, 03:50 PM
stranger2all stranger2all is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: buckeye, az
Posts: 6 stranger2all User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to stranger2all
problems with setChangeHandler() for comboBox in MX

I need to populate a dynamic text field with the data property of the selected item in the comboBox component which is an alphebetical list of US states, with the data values being those states' two letter abbreviations. The code is in an included .as file. Everything else in the movie works just fine. Here's the code:

_root.mcFields.stateSelector._visible=false;
function fillState(){
_root.mcFields.stateSelector.getSelectedItem().data;
_root.mcFields.stateSelector._visible=false;
}
_root.mcFields.stateSelector.setChangeHandler("fillState");
_root.mcFields.dtfState.onSetFocus=function(){
_root.mcFields.stateSelector._visible=true;
}

Is this right?

Reply With Quote
  #2  
Old June 5th, 2003, 02:20 PM
freddydoesphp freddydoesphp is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2000
Posts: 669 freddydoesphp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
What is it you want to do with the state put it in a text field right.

Code:
function fillState(what){
   _root.textfieldInstance.text = what.getSelectedItem().data;
   what._visible=false;
}

Reply With Quote
  #3  
Old June 5th, 2003, 04:16 PM
stranger2all stranger2all is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: buckeye, az
Posts: 6 stranger2all User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to stranger2all
yes. that is it exactly. thank you. But what is the syntax for setting the comboBox change handler to said function if it is nested in a movie clip?

Reply With Quote
  #4  
Old June 5th, 2003, 04:22 PM
freddydoesphp freddydoesphp is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2000
Posts: 669 freddydoesphp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
If whats nested in a movie clip the function fillState()

As long as its in the same movie clip as the combobox, its fine, I would suggest putting the function in the main timeline. setChangeHandler takes a second optional parameter which points to the location of the function if its not in the same movie clip.

So if the function was in a mc named myMc off the root level.
Code:
_root.mcFields.stateSelector.setChangeHandler("fillState", _root.myMc);



Notice there is no quotes around it.

Reply With Quote
  #5  
Old June 6th, 2003, 02:09 PM
stranger2all stranger2all is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: buckeye, az
Posts: 6 stranger2all User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to stranger2all
Thumbs up

You've been most helpful. Thank you very much. It's good to know that there are indeed other flash users out there. I live in buckeye, arizona, which if you know nothing about it, is just about as far away from a programmer haven as anything can be. I just can't seem to find anyone else that knows flash! Thanks again, man!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > problems with setChangeHandler() for comboBox in MX


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway