place value of component input inside textfield

Posted on 2007-07-23
Last Modified: 2010-04-03
When I choose either a radio button, checkbox or a selection from dropdown, how can place the value of that data inside a textfield on mouse up using flash components?  I'm outputting as flash player 6, actionscript 2.0.
Question by:COwebmaster
    LVL 22

    Expert Comment

    well, first of all, I don't think you can even use Actionscript 2.0 in player 6...  so you need to change that...

    my recommendation is to use Flash Player 8...  it has over 95% market penetration, and is much more advanced than player 6 or 7.   So change that....

    you would use the instance name of the component with getValue()

    so if your checkbox as named "myCheckBox"  then you would use this code to set the value

    myTextBox.text = myCheckBox.getValue();



    Author Comment

    that didn't work.  So when the user clicks on the radio button (not checkbox), the data gets inputted into a textfield.  Any more suggestions?
    LVL 22

    Accepted Solution

    well, your original question asked for "either a radio button, checkbox or a selection from dropdown"...  

    so you have decided to just use radiobuttons?

    here is some code that you would need to develop...

    var rListener:Object = new Object(); = function(evnt:Object) {
          myTextBox.text = myRadioButton.__data;
    myRadioButton.addEventListener("click", rListener);

    here I am actually accessing the public property "__data"  which is what you can set in the properties box.

    I still don't know how you are building your application, so if you can give me some more details, I can give you better answers.



    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
    Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
    The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now