Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / November 2004



Tip: Looking for answers? Try searching our database.

Need help with actionscript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gma216 - 30 Nov 2004 10:40 GMT
I have a combo box, dynamic text box, and a button.
I want to select an item from the combo box and on mouse release i want to
display the select item in the dynamic text box.
my current code is:

on (release) {
    quantity = quantity.getValue();
    message.text = quantity;
}

This code works for the first time the button is clicked, but if i change the
item in the combo box a second time and click the button again, the dynamic
textbox displays "undefined"
any suggestions would be appreciated.
Thanks
toddde - 30 Nov 2004 16:11 GMT
You may need to check your scope.  This is where my ignorance shows, but it
looks as if getValue is a function you wrote.  If so, on which timeline does it
reside?  If it is a different timeline than you have identified in your text,
you will need to accurately identify the path to it (i.e. quantity =
_root.getValue() ).     <br><br>Also, it just seems a little odd to me that you
have a variable by the name of 'quantity' but you attempt to invoke a call a
method/function  ('getValue') on the quantity variable.  <br>  <br> <br>
Perhaps you could say something like 'quantityText = _root.getValue();'   Also,
you might want to check the path to the dynamic text box.  I would start from
the root and work your down.  Then you can change it to a relative value.  So,
something like this:  '_root.ComboBox.message.text = quantityText;'  <br><br>
You can never go wrong using the absolute reference with each of your objects
(ie. '_root. . . .).  The only problem with the absolute references is that
they are less portable than the relative references.  Remember with the event
handlers, a reference to 'this' means the object referenced by the event
handler.  So, if your 'button' is a movie clip, 'this' would be a reference to
the button clip.  Similarly, any reference to the name of the function without
an absolute or relative path prior to the function ID, would mean that the
function resides on the timeline of your button movie clip.    <br><br> My two
cents.  I hope its accurate. todd  
kmkbe - 30 Nov 2004 16:30 GMT
I have tested the condition as urs . It works fine.
I have attached the file tested.  
http://www.karthickmohanram.com/forum/forum_q.fla

Note: if you are going to use a combonent button then u have to refer the
variables in the exact path like "_root.variable" instead
of "variable".

Karthick
gma216 - 30 Nov 2004 20:48 GMT
It works just fine now, thanks so much guys.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.