button with textfield with as3

Hi all, I am having a little problem, I did a movieClip who use as a button (activate the cursor hand with buttonMode = true) and create a textfield to be used inside the object, at this stage, everything works very well, but whenever the cursor is over the text, changue that forms to make the text selectable.

Ever tried to use "miText1.selectable = false" with in this case don't select anything when is on.

There is a way to disable selectable text property, but keeping the buttonMode on?

This is part of the script

var miBut1:but = new but();

var miText1:TextField = new TextField();

var miFormat1:TextFormat = new TextFormat();
miFormat1.font = "Times New Roman";
miFormat1.bold = true;
miFormat1.color = 0xFFFFFF;
miFormat1.size = 25;
miFormat1.align = 'center';

miText1.text = "item 1";

addChild (miBut1);

miBut1.addChild (miText1);

miText1.setTextFormat (miFormat1);

miText1.selectable = false;

miBut1.buttonMode = true;

Thanks in advance for the help!

See if the addition of this line helps:

miBut1.mouseChildren = false;

Tags: Adobe Animate

Similar Questions

  • Adding function onRelease of instance of a button with AS3

    I am trying to add a simple navigation to an instance of a button on my stage through the AS3. my code is below... I used the same code in AS2, but I have to leave something out in AS3... can someone help me?

    Thank you!

    Pat

    btn_arrow_TL.onRelease = function()
    {
    gotoAndPlay ("flyout_default");
    }

    Compiler errors:

    1120: access of undefined property, click.

    This isn't code as3.  in as3, this would be:

    btn_arrow_TL.addEventListener (MouseEvent.Click, f);

    function f (e: Event) {}

    gotoAndPlay ("flyout_default");

    }

  • Help with AS3 and buttons

    I need urgent help for a college project, I drew a map and I have a few photos that appear in terms of the timeline, one after the other. I want the timeline to be activated when I press a button on the sheet where I've been on vacation, but I have no idea of how to put together.

    While I can offer some ideas, you will need to spend time to find out how to use Flash... maybe get formal training with her.

    For photos, create each set as a movieclip and give to each movieclip an instance name so that you can control its visibility by using code.  Initially, you will want to set the visible property of them all to false, made probably in the first frame of the timeline (ex: imageGrp1.visible = false;).  Then, you use your buttons so that they are visible.

    Code on one of the buttons, you must assign an instance as well name.  Then, you must assign an event listener for this button to detect when it is selected and a function handler to go with the event listener, the listener calls the function in action when the event occurs.

    ex:

    the event listener for a button with an instance name of imgGrp1Button...

    imgGrp1Button.addEventListener (MouseEvent.CLICK, showGrp1);

    and function of event handler for the CLICK listener

    function showGrp1(evt:MouseEvent):void {}

    imageGrp1.visible = true;

    }

    If you want to hide any visible game when you select a new, then you can create a function that defines them all visible = false and the call that work well at first in 1 frame and each key event handler function (before setting the selected to be visible).

  • Button with random time and pictures at random

    With as3, I would create a button with photos randomly changing random time.

    Any advice?

    Thank you.

    Try to use: this.addChild (this ["image" + String (i)]);

  • Change the text with AS3 makes the invisible text

    Hi all

    Even for a total n00b like me, this is awkward: I can't even change a text on the stage with as3.

    I place a text on my stage, assign the dynamics, incorporate the police and give it an instance name. When I change the text, he evacuated the scene or if it remains invisible, I don't know.

    I thought it would be as simple as this: myText.text = "new text";   but apparently I am doing something wrong. When I put a trace (myText.text);  before and after, I see the old and the new text in the output window. Then he changes correctly, but why he disappears it? Also tried in a new white project, to ensure that it was not something somewhere.

    I'm totally distraught...

    BTW I use Flash CS5.5 on Win7

    do not enter text in the ide.  Use actionscript to assign the original text of your textfield and also change.

  • How to write Save function based on the drop-down list box selection data in app mxml flex4 with as3

    Hi all

    I'm working on the application web flex4 with as3.

    I have a doubt, I've created a mxml it has two text boxes, except the button and a combo box that is has two option as a percentage and the amount.

    my needs are I gave here.

    need 1: when I choose option amount that two text boxes does not have to be editable.when I select text tat box two percentage option will be editable.

    need 2: when I select the percentage in combox option and two text boxes are empty, and then click the button Save-> I want to display warning msg

    need 3: when I select the option amount combox and the two boxes are emptu click the button Save-> I don't want any warning messages.

    How to validate it and how to write backup for this function.

    This is my sample code:

    list box ID = baseAmtPer

    ID TextBox1 = maxCommAmt.text

    ID = baseAmtPer.text text box

    If (((baseAmtPer.editable!=true) & & (maxCommAmt.editable! = true)) & & ((baseAmtPer.text=="") & &(ma xCommAmt.text=="")) |) (baseAmtPer.text == "") | (maxCommAmt.Text=="")) -> This condition not allowing while I'm selecing amount in combo box. How the TWO TEXT BOX WILL BE EMPTY for this problem

    {

    Alert.Show ("enter in all areas", "Information");

    }

    on the other

    {

    some encodings

    }

    Hello

    Please go through the following Code:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" minHeight >

    Import mx.collections.ArrayCollection;

    Import mx.controls.Alert;

    Import spark.events.IndexChangeEvent;

    protected function button1_clickHandler(event:MouseEvent):void

    {

    If (comboBox.selectedItem == "Percentage" & textBox1.text == "" & textBox2.text == "") {}

    Alert.Show ("enter the values");

    }

    }

    protected function comboBox_changeHandler(event:IndexChangeEvent):void

    {

    {if(ComboBox.SelectedItem=="Amount")}

    textBox1.editable = false;

    textBox2.editable = false;

    }

    else {if(comboBox.selectedItem=="Percentage")

    textBox1.editable = true;

    textBox2.editable = true;

    }

    }

    ]]>

    Amount

    Percentage

    Thank you and best regards,

    ------------------------------------------------------------------------------------------ --

    Vibhuti Gosavi . [email protected] | www.infocepts.com

    ------------------------------------------------------------------------------------------ --

  • How to validate and save the values to a combo box and two text boxes in flex4 mxml application with as3

    helllo all,.

    I'm working on the application web flex4 with as3.

    I have a doubt, I've created a mxml it has two text boxes, except the button and a combo box that is has two option as a percentage and the amount.

    my needs are I gave here.

    need 1: when I choose option amount that two text boxes does not have to be editable.when I select text tat box two percentage option will be editable.

    need 2: when I select the percentage in combox option and two text boxes are empty, and then click the button Save-> I want to display warning msg

    need 3: when I select the option amount combox and the two boxes are emptu click the button Save-> I don't want any warning messages.

    How to validate it and how to write backup for this function.

    any suggession or extract code is welcome.

    Thanks in advance,

    B.Venkatesan

    Looks like you are trying to do too much at once. Try to hang the events correctly

    The close event of the comboBox can do something like this

    protected function toggleTextEditing(event:DropDownEvent):void

    {

    If (this.optionCmb.selectedItem.label is "Percentage")

    {

    This.Text1.editable = true;

    This.Text2.editable = true;

    }

    Else if (this.optionCmb.selectedItem.label == "Number")

    {

    This.Text1.editable = false;

    This.Text2.editable = false;

    }

    }

    The button's click event can do something like

    protected function save(event:MouseEvent):void

    {

    If (this.optionCmb.selectedItem.label is "Percentage")

    {

    If (this.text1.text == "" & this.text2.text == "")

    {

    Alert.Show ("text is empty");

    return;

    }

    on the other

    {

    }

    }

    Else if (this.optionCmb.selectedItem.label == "Number")

    {

    }

    }

    If you can put in your entire code, maybe I can have a look to see if I can find something wrong with that.

    -Pramod

    http://www.flexmycode.com

  • How to access a State of buttons with code

    Hello

    I already have a few buttons which I planned on using as a menu for the difficulty, easy, medium, hard. The buttons are already made with all States and graphics, then I wanted to add an event listener so that when you click on a button for example simple, if the middle button was to its state of success I have he would return back to upward, for example:

    easyButton.addEventListenere (MouseEvent.CLICK, function(e:event) {mediumButton.gotoAndStop ("up") or mediumButton.up

    but then I realized there no properties or function in the simpleButton class to change the State of the button, I know I can do a movieclip and I Stop at the top image, but is there a way to make it work like a button?

    Buttons in Flash back a long long way. In previous versions you could not access by name buttons and they were really shaking and odd. Users of dropped and developed more serious Flash from buttons of the movieclips.

    I don't really know why they did not set them when they have updated the AS3, but there you go! I guess it has something to do with the idea of keeping them simple.

    With respect to visibility, be sure that you set the visible property and not the alpha. A button with zero threshold alpha will be rolloverable, clickable, etc..

  • Parental and child control with AS3

    Hello

    I am new to AS3 and although I can see some good practices and functionality, I'm constantly stuck and can still do the things I would do if easily with AS2 - I almost it relearn from scratch!. I would still appreciate little help and advice on this...

    I did a class that creates a "sort" menu with data from an XML file, and basically is what he does when he is called to create an emptyMC (a container), add a childMC (a square) and add another child (a text label). When I create the container, I am trying to add a MouseEvent that can act on each instance of container, but all I can get is a MouseEvent on the object that contains all the MCs added. The code follows.

    Can someone enlight me with that issue or explain what I am doing wrong.

    I do not understand the parental dynamics with AS3 and the absence of the use of instance names and parenting dot does not help.

    Thanks in advance.

    Note to Adobe: previous versions of Flash and as a reference Help files were far more useful than in CS4!

    In the timeline:

    Import assets.myDynMenu;

    var theMenu:myDynMenu = new myDynMenu ("menu.xml");
    stage.addChild (theMenu)

    Stop();

    In the class:

    package assets

    {

    import flash.display. *;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.text.TextField;
    flash.net import. *;

    public class myDynMenu extends Sprite {}

    LOADING EXTERNAL INIT DATA

    public void myDynMenu (theData) {}

    LOADS MENU DATA FROM PREFORMATTED XML
    var loader: URLLoader = new URLLoader();
    var url: URLRequest = new URLRequest (theData);
    loader.addEventListener (Event.COMPLETE, buildTheMenu);
    Loader.Load (URL);
    }

    FULL CHECK LOAD XML MENU DATA - OBJECT BUILDING AND CHILDREN

    public void buildTheMenu(event:Event):void {}

    var xml = new XML (event.target.data);

    for (var i = 0; I < xml.menuData.menuItem.length (); i ++) {}

    ADDS A CONTAINER

    var itemContainer:MovieClip = new MovieClip();
    itemContainer.name = "menu" + i;
    //

    THE NEXT LINE IS NOT DO WHAT I WANTED?
    IN THE FUNCTION BEING CALLED, I NEED TO CONTROL THIS ELEMENT AND ITS CHILDREN

    itemContainer.addEventListener (MouseEvent.MOUSE_OVER, onMouseOver);

    //

    itemContainer.x = 100 * i;
    itemContainer.y = 0;
    itemContainer.mouseEnabled = true;
    itemContainer.mouseChildren = false;
    addChild (itemContainer);

    ADDS A CHILD OF CONTAINER (a square)

    var itemBase:MovieClip = new MovieClip();
    itemBase.graphics.beginFill (xml.menuData.mConfig.mainItemColor);
    itemBase.graphics.drawRect (0,0,xml.menuData.mConfig.mainItemW,xml.menuData.mConfig.mainIt emH);
    itemBase.graphics.endFill ();
    itemBase.name = "basic" + i;
    itemBase.mouseEnabled = false;
    itemBase.mouseChildren = false;
    itemContainer.addChild (itemBase);

    ADDS a CHILD OTHER to CONTAINER (a text label)

    var theLabel:TextField = new TextField();
    theLabel.x = 5;
    theLabel.y = 5;
    theLabel.selectable = false;
    theLabel.mouseEnabled = false;
    theLabel.border = true;
    theLabel.text = xml.menuData.menuItem [i] .mName;
    itemContainer.addChild (theLabel);

    }

    }

    It IS THE MOUSE ON WHICH I NEED law to EACH itemContainer (AND CHILDREN)
    private void onMouseOver(event:MouseEvent):void {}

    event.stopPropagation ();
    trace ("you're on" + myIdName);
    }


    }

    }

    use:

    package assets

    {

    import flash.display. *;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.text.TextField;
    flash.net import. *;

    public class myDynMenu extends Sprite {}

    LOADING EXTERNAL INIT DATA

    public void myDynMenu (theData) {}

    LOADS MENU DATA FROM PREFORMATTED XML


    var loader: URLLoader = new URLLoader();
    var url: URLRequest = new URLRequest (theData);
    loader.addEventListener (Event.COMPLETE, buildTheMenu);
    Loader.Load (URL);
    }

    FULL CHECK LOAD XML MENU DATA - OBJECT BUILDING AND CHILDREN

    public void buildTheMenu(event:Event):void {}

    var xml = new XML (event.target.data);

    for (var i = 0; i)

    ADDS A CONTAINER

    var itemContainer:MovieClip = new MovieClip();
    itemContainer.name = "menu" + i;
    //

    THE NEXT LINE IS NOT DO WHAT I WANTED?
    IN THE FUNCTION BEING CALLED, I NEED TO CONTROL THIS ELEMENT AND ITS CHILDREN

    itemContainer.addEventListener (MouseEvent.MOUSE_OVER, onMouseOver);

    //

    itemContainer.x = 100 * i;
    itemContainer.y = 0;
    itemContainer.mouseEnabled = true;
    itemContainer.mouseChildren = false;
    addChild (itemContainer);

    ADDS A CHILD OF CONTAINER (a square)

    var itemBase:MovieClip = new MovieClip();
    itemBase.graphics.beginFill (xml.menuData.mConfig.mainItemColor);
    itemBase.graphics.drawRect (0,0,xml.menuData.mConfig.mainItemW,xml.menuData.mCon fig.mainItemH);
    itemBase.graphics.endFill ();
    itemBase.name = "basic" + i;
    itemBase.mouseEnabled = false;
    itemBase.mouseChildren = false;
    itemContainer.addChild (itemBase);

    ADDS a CHILD OTHER to CONTAINER (a text label)

    var theLabel:TextField = new TextField();
    theLabel.x = 5;
    theLabel.y = 5;
    theLabel.selectable = false;
    theLabel.mouseEnabled = false;
    theLabel.border = true;
    theLabel.text = xml.menuData.menuItem [i] .mName;
    itemContainer.addChild (theLabel);

    }
      
    }

    It IS THE MOUSE ON WHICH I NEED law to EACH itemContainer (AND CHILDREN)
    private void onMouseOver(event:MouseEvent):void {}

    event.stopPropagation ();
             trace ("you're on" + event.currentTarget.name);
    }

    }

    }

  • button with the custom numbers, ordered regular not

    I don't know if this is the right place to ask this question!

    in any case

    I need to make the button with the numbers of entry as

    1 2 5 10 20 40 80

    I wonder if there is a way to do

    GoTo properties of the button and the text for markers of scale labels

  • Is it possible to connect my Application ' Stop' button with the "Run" button of LabVIEW?

    Problem - one of my clients recently tested my new LabVIEW application and asked how the arrested LabVIEW application can be restarted without clicking on the "Run" (right arrow) button.

    Is possible solution - possible to connect my Application ' Stop' button with the "Run" button of LabVIEW?

    Thank you!

    Barry

    The big problem is in your Acquistion to stop audio event. You run the LabVIEW stop sign which is the equivalent of hitting the Cancel button in the toolbar.  (See contextual help on that).  You can stop the acquisition, but you don't want to stop your LabVIEW program.  You need this case in the event your computer to transition state in a sleep mode when you do not make any purchase.  Then hit the purchase button to start again transitions the machine state in the acquisition.

    In your case of program output, you want really to leave LabVIEW it.  You want to run and stop commands like closing the com port and one of these activeX references.  Then allow it to stop the while loop.  Turn the LabVIEW out outside the loop so that once everything is cleaned, your application may close.  You probably want to wrap this command in a case structure so that if you are in the execution environment, it leaves your application.  But if you are in the development environment, you don't want to cause your LabVIEW environment stop.  Another thing is that right now, you actually have a race condition in the Exit event.  The com port will close first or LabVIEW will come out.  There is no defined order of execution.

    Alternatively, you can have an event to close panel? in this way, you haven't accidentally short circuit all your program by pressing the X key.  You want to capture this event, discard it.  And if you want to not actually closed, did trigger the Exit Program button so that you can gracefully shutdown.

  • How to configure a button with alignment fixed points on a logorithmic scale?

    My question is quite simple, but after rooting in the button/gauge proteries, I can't find a way to do what I would like to:

    I would like a simple button with 4 possible values control: 0.0125,0.125,1.25,12.5

    I would like that they also spaced and I want the button to engage only in one of these four values

    I can get it at least to the point of having four values there by placing arbitrary markers (scale-> add the marker), but I can't figure out how to align them, or even if it is the way of Paris to follow on that.

    Thank you!

    See example LV86 attached. Open the Properties dialog box for the button for more information on its configuration.

  • APEX 4.2 - theme 25 - model extra button with red background

    Hello

    I am relatively new to APEX and just building my first application.

    In this application I often forms with save, cancel, and delete buttons.

    While I create registration button type "to hot' and the button cancel as 'normal' I want to highlight the button on a red background. I tried several stylesheet changes, but did not get the result I want. Compatibility between browsers should stay.

    Could someone lead me to the place I need to change the css? I assumed that the addition of a new model of button (for example "button - Red") with another class in the 'Normal' model should do the trick, but I can't make it work.

    Currently, I use the following model "Normal":

    <button class="uButton_red" onclick="#JAVASCRIPT#" #BUTTON_ATTRIBUTES# id="#BUTTON_ID#" type="button"><span>#LABEL#</span></button> 
    

    But no idea what css style I should change to get a red background

    The result should look like this screenshot manipulated:

    button.jpg

    Any help is highly appreciated

    Kind regards

    Martin

    Thanks InoL. I finally managed to get a red button:

    1. create a copy of the 'Button' model (I named it "Red - button") and replace the normal template in the button definition by the following text

    
    

    2. change your default page template (in my case its 'a level tabs - No. Sidebar') and add the following lines in the Style sheet cascading - Inline:

    .uButton.uRedButton, .uRedButton.uButtonLarge {
        -moz-border-bottom-colors: none;
        -moz-border-left-colors: none;
        -moz-border-right-colors: none;
        -moz-border-top-colors: none;
        background-color: #A62D2D;
        border-color: #A62D2D #A62D2D #7E2222;
        border-image: none;
        border-style: solid;
        border-width: 1px;
        border: 1px solid #A62D2D;
        border-bottom-color: #7E2222;
    }
    
    .uButton.uRedButton span, .uRedButton.uButtonLarge span {
        -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
        background-color: #E55B5B;
        background-image: -moz-linear-gradient(center bottom , #A53131 0%, #E55B5B 75%, #F25454 100%);
        background-image: -webkit-linear-gradient(bottom, #A53131 0%,#E55B5B 75%,#F25454 100%);
        background-size: 100% auto;
        box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
        color: #fff;
        font-weight: bold;
        text-shadow: 0 -1px 0 rgba(0,0,0,0.35);
    }
    

    3. create a new button with the attributes according to

    ==> Result is just what I wanted

    Hope this helps some other institutions ;-)

    Someone at - it an idea if the joint CSS for FF and Chrome could lead to problems?

    Thank you

    Martin

  • I have a button with the icon text. Is it possible to increase the space between the text and icon?

    Mr President.

    I have a button with the icon text. Is it possible to increase the space between the text and icon?

    adf button text image space.png

    adf button text image space.jpg

    Concerning

    Have you tried it as directed by the other thread?

    
    

    See you soon

    AJ

  • How can I run script jsx button with photoshop, I been tried more (HTML 5)

    How can I run script jsx button with photoshop, I tried, but I get no results please someone help me in this issue that I can continue my extension and gives me the good code that I can use it.

    Thank you very much

    In the index.html file, you will need to create a button and call the function when button by clicking on:

    "button" id ="button" onclick = "getDucumentFormatFun ()" > name of the Document:

    In the js file you must set the getDucumentFormatFun() function:

    function getDucumentFormatFun() {}

    fileFormat var = "get_fileFormat()";

    evalScript (fileFormat, fileFormatCallback);

    }

    define the callback function: fileFormatCallback

    function fileFormatCallback (res) {}

    Alert ("the name of the active document is:" + res);

    }

    In jsx file:

    get_fileFormat = fileFormatFun;

    function fileFormatFun()

    {

    Return app.activeDocument.name;

    }

  • How to create a button with rollover that appears in a different place than the button when you move?

    Hello

    How to create a button with rollover that appears in a different place than the button when you move by using only the Muse (reversal may be a different shape and color of the button). I managed to do it using Photoshop and the separate layers and import it, but it is not a good solution. All suggestions will be welcome.

    Thank you

    You can try to use the widget of the Composition of the ToolTip. In this way, the trigger area is isolated and a "State of reversal" can be placed anywhere on the screen (compared to the trigger).

    • Remove the two triggers additional default
    • Set to display the targets on working capital
    • Select hide all initially.

Maybe you are looking for

  • Why the mail client doesn't know that I replied to a message?

    I have finally confirmed that if I answer an e-mail filed, or forward a message, the message is not saved on my sent mail, nor is it marked as responding to / transmitted. All other IMAP clients that I use (OSX Mail, Thunderbird, the Squirrel Mail, K

  • Download the album which has divided into two parts to consolidate

    I bought an album containing 14 tracks from the iTunes Store.  After downloading, my music screen showed 2 copies of the work from the album. 13 titles have been listed under a copy of the work and the remaining runway is under the other copy of the

  • How can I reset 'default' browser / navigator / telephone number selector?

    I discovered that the selection of a default option apparently cannot be changed after the selection. I found this to be true in the quick contact applet - I checked the area and then quickly selected the wrong telephone number. I had to remove that

  • Wireless spent

    I have a HP pavilion dv5000 running XP. I recently had to use the recovery partition to restore to factory State, but now it is wireless. I checked in the Device Manager, and it's as if she never existed, I can use only hooked to my router by cable.

  • Desktop icon text boxes are blue highlighted

    original title: the desktop icon text box The text under my desktop icons are highlighted in a blue rectangle.  How do I get the highlighted blue and rectangle to disappear?  It was clear a few days ago.