(menu) buttons change with MOUSE_OVER textColor

Hello

I do a menu xml (AS3), but I'm having problems to make the color change when the mouse it is over the menu textfield. I can just change the last textfield, how do I reference the textfield object that the user is finished?

for (var i: Number = 0; i < total_nodes; i ++) {}
(...)
My textfield
textoMenuFooter.textColor = 0 x 666666;
addChild (textoMenuFooter);

var bt_textoMenuFooter = new MovieClip();
bt_textoMenuFooter.addChild (textoMenuFooter);
(...)
addChild (bt_textoMenuFooter);
bt_textoMenuFooter.buttonMode = true;

bt_textoMenuFooter.addEventListener (MouseEvent.MOUSE_OVER, funcaoOverMenuCGA);

}

function funcaoOverMenuCGA(evt:MouseEvent):void {}
var verConteudoCGA:String = evt.target.name;

It works only in the last textfield
if(textoMenuFooter.Text == verConteudoCGA) {}
textoMenuFooter.textColor = 0xFF0000;
}
}

is there an easy way to see that bt/textfield and change properties?

for any help or suggestion would be great, I just can't find the solution from anywhere
Thanks in advance

I suggest you to change the makeButton function so that it accepts the name of the button that comes from XML and making mouse listeners agnostic name (independent). For example:


for (var i:int = 0; i < 5; i++) {
     // here you can pass the label from XML     var button:Sprite = makeButton("Button Label " + i);
     // note - no button name any longer     button.addEventListener(MouseEvent.ROLL_OVER, onRollOver);
     button.addEventListener(MouseEvent.ROLL_OUT, onRollOut);
     addChild(button);
     button.x = i * button.width + 10;
     button.y = 20;
}

function onRollOut(e:MouseEvent):void
{
     var doc:DisplayObjectContainer = DisplayObjectContainer(e.currentTarget);
     for (var i:int = 0; i < doc.numChildren; i++ ) {          // it will change color of anythins that is text field                    if (doc.getChildAt(i) is TextField) {
               TextField(doc.getChildAt(i)).textColor = 0x0000FF;
          }
     }
}

function onRollOver(e:MouseEvent):void
{
     var doc:DisplayObjectContainer = DisplayObjectContainer(e.currentTarget);
     for (var i:int = 0; i < doc.numChildren; i++ ) {
          // it will change color of anythins that is text field          if (doc.getChildAt(i) is TextField) {
               TextField(doc.getChildAt(i)).textColor = 0xFF0000;
          }
     }
}

function makeButton(labelText:String):Sprite {
     var label:TextField = new TextField();
     label.text = labelText;
     var btn:Sprite = new Sprite();
     btn.addChild(label);
     return btn;
}


And because you're new to AS3 - it does not mean that you should take shortcuts. Except if they make your application works best, of course. Otherwise you will make your life much more difficult :-)

Tags: Adobe Animate

Similar Questions

  • The menu buttons changing size and position for the navigation of the site.

    Hello world.

    The menu buttons appear fine in preview mode, but as soon as I download on Business Catalyst all going PEAR - buttons decrease in size and change position!

    I tried everything I can think of, including the re-doing the menu from scratch and upload whenever I make a change. Whenever I duplicate the menu on another page is when the problem occurs, but as I said that's no problem at all in preview mode browser.

    The site link is: home

    I would appreciate your help, its driving me crazy I have to show to the client as soon as possible

    Thank you very much

    I've been clicking since the menu buttons and a few times, but always without strangely shaped or placed images.

    I think you can be assured that this is just a bug in your browser, probably some old picture caching that is too persistent to get deleted automatically. Refresh your page or clear the cache of your browser manually. That could help.

  • Replace the Actions menu button on interactive report (Apex 4.1)

    I replaced the the menu button actions with an image in the report attributes section. The interactive report is to halfway to the bottom of the screen.

    The image is automatically included in an anchor with href = tag "#", which makes the page jump to the top every time the button is clicked. This changes a "false javascript:return"; it'll work out, but I don't know what to change to make this happen.

    Anyone know if there is a css or some model that I can change to fix this problem in the world?

    Thank you!
    John

    Found a solution using Jquery:
    Create an HTML region below 0 with the following content:

    
    

    or with an image

    
    

    Eric.

  • Problems of blackBerry Smartphones with the BBkey (also known as the menu button)

    Sometimes when I'm in an application and want to click on one of the list of the menu items (for example, delete), when I click on the menu button, which appears are some of the icons on the home page.  (I'm really tired of looking at this little Penguin...).  If I persist, I can usually get the pop-up menu option, but it's boring.  I'm sure it's a software problem.  I had this problem after a while on my first lap.  I had to replace the one because of other problems.  I used the switch device Wizard to transfer everything, so I guess he also transferred everything that is causing this issue.

    Everyone knows about this problem?  Any ideas on what to do?  I don't want to reinstall the OS - I'd rather upward with the problem.  Thank you.

    Liz

    Hi again!

    The BBKey/Menu button has two functions.

    (1) to bring up a context menu of the application, you are

    (2) to bring up the Ribbon app-switcher (a list of all your applications in the course of execution so that you can change quickly from a different application...)

    The difference is how long you hold down the key. For 1, it is a support and quick release. For 2, it is down. Sometimes it gets bad, but with practice, you'll be able to get what you want most of the time (not 100% but... I always get a wrong result sometimes).

    Hope that helps!

  • I want to create a dynamic field which changes with a pull down menu in one of our forms.

    Hi guys,.

    First post so forgive me for breaks of OCD.

    Would anyone be able to help me, I want to be able to modify the send e-mail button so that when you click on submit will invest in a custom subject line, but this must change with a menu drop-down I have the form as well.

    If it is could is it possible you let me know?

    Thanks again

    p.s. If I don't clear my request made me know

    You should have mentioned that earlier... LCD forms are very different compared to PDF Forms.

    You should ask your question here: LiveCycle Designer

  • How to change the image of menu button?

    Hello

    How can I change the image (or the 'framework of film') which appears in the menu buttons sub-chapter (those that point directly to the different movies) to Encore CS5? By dedfault, it appears the first image of the sequence which in my case is black, I start my sequences with dissolved "fade to black". So all my buttons of menu subchapter have black pictures after that. I don't want to animate, I want to know is how to choose an image from the sequence and turn it into an image of menu button.

    Thank you

    Click on the chapter marker in the timeline to make it red.

    The value of the ICT on the image of the scenario that you want to use for the button.

    Click right red chapter and put the poster frame.

    Do the same for other chapter markers.

  • My new Menu button that came with the last update is now gone.

    I removed the button because it bothers me thinking it would have no impact, but now I can't, because it contained the customization menu. I searched through the other options in the menu, but the only path to the customization is now hidden in the button now gone.

    Do you use the extension classic restaurateur theme?

    • You can check the settings of the extension of the CTR through the Options/preferences button on the page "Firefox/tools > Modules > Extensions.
    • You can find additional toolbar buttons and additional toolbar settings in customize (Firefox 3-bar menu button > customize)

    See also:

    In current Firefox released (29 and following), which are have a UI Australis, the orange Firefox menu button has been replaced by the three button bar of Menu of Firefox at the far right of the Navigation bar and this button is always visible, if you have the bar of menus visible or hidden
    A consequence of this situation, it is that you can no longer hide the Navigation toolbar

    • There is a star as the button next to the search bar on the Navigation toolbar to bookmark the current web page and a "Show bookmarks" button next to it to open bookmarks in a menu drop-down.
      You can find "Show all bookmarks" to open the bookmarks (library) at the bottom of the drop-down list manager
    • If bookmark you a page, then 'Bookmark this Page' in the bookmarks menu replaces it with "edit this bookmark".
    • You can make the bar visible title via the "Title bar" button at the bottom left in the palette to customize window

    It is still possible to have the bar of menus visible via the menu popup of a toolbar for menus as the file menu to print (Ctrl + P) and preview before printing and the bookmarks menu available.

  • Replace the IR Actions menu button with image

    Apex 4.2.3

    Grid reactive theme 25

    Oracle 11g

    I would like to replace the default Actions with my image menu button. Someone knows how to do this.

    Its same as this thread, the menu button replace the Actions of interactive report (Apex 4.1)

    But it does not work for me.

    Kind regards.

    Hello

    If you want to replace all button by image - how you suppose handle clicks on this image?

    If you don't want the image - you can do this in the properties of IR report:

  • Is it possible with CSS menu that appears when you click the menu button on a menu bar of style?

    I'm trying the menu that appears when a menu button is enabled in the style menu bar. I am able to style the menu bar and menu button in the action bar very well.

    However, I was completely unable to style from the Menu that appears.

    I asked the same question over to StackOverflow.com, but have not yet received a reply.

    Basically I have a menu that is set up as a bar:

    <MenuBar VBox.vgrow="NEVER">
      
    <menus>
      
    <Menu mnemonicParsing="true" text="_File">
      
    <items>
      
    <MenuItem mnemonicParsing="true" text="_New Project"/>
      
    <MenuItem mnemonicParsing="true" text="_Open…"/>
      
    <MenuItem mnemonicParsing="false" text="Quit"/>
      
    </items>
      
    </Menu>
      
    </menus>
    </MenuBar>

    I was completely unable to style the MenuItem or container here when they are indicated. I have dug through CSS of the skin of the Caspian Sea, but was unable to find out what anyone who specifically the. I tried to substitute the values of the ContextMenu, Menu, menu button and MenuItem that is located in the Caspian Sea, but nothing seemed to affect this menu.

    The menu is clearly inconsistent with the menu system, so why am I unable to style it?

    Isn't this possible? It will be possible in the future?

    Thank you for answer two. Unfortunately, what was proposed was not enough to solve the problem by itself. I didn't know that .menu - the point has had a child of .label who could bear the title, but that alone was not enough to correct the problem.

    Fortunately, Uluk Biy on StackOverflow.com was able to answer the question. He stressed that wanted me the property - fx-skin. I realize that I did not provide enough information here for users to come to this conclusion, so I wanted to thank you for helping with the little information you had.

    It seems that, once I've added the property - fx-skin .context-menu, I am able to style menus.

    Thanks again guys.

  • Creating a button that changes with images in a slide show in Adobe Muse?

    You are able to create a new button inside or outside of a slideshow that changes with the images?  I want to have the images change and contain a title and a link to the project that they are linked to.  Whenever the image changes, so automatically or someone clicks the "Next/previous" buttons, the button link and title will change with it.

    You can use the part of the legend of slideshows. Since the text in a changes of legend as well as the image in the slideshow, you can add your own text to images.

  • How paste an accordion MENU navigation on a mobile scrollbar page and make it work properly? Like I can't pin, I keep it at the top of the page with scroll effect 0. It collapse, shows the menu buttons but does not close back up once reached the

    How paste an accordion MENU navigation on a mobile scrollbar page and make it work properly?

    Like I can't pin, I keep it at the top of the page with scroll effect 0.

    It collapse, shows the menu buttons but does not close back once it reaches the anchorpoint.

    Appreciate your help. Thanks.Guess I need to find another solution. Am an artist and don't know anything about coding.

  • Change the color of main menu button

    How can I change the color of the main menu button - the color of the text in the menu/Entertainment/life nocturne.  I am able to change the color of the previous buttons and following, but not the main menu button.  I looked at both the tab layers and tried to edit in photoshop.

    Thank you

    Steve

    Go to the PS, twirl down the fx for the text layer and die the eyeball for layering of colors.

    -Jeff

  • Nexus 7 with Android 4.2 haw not the menu button. What to do when the instruction requires that action?

    Nexus 7 do not have the menu button!

    Hello

    The menu is at the top right (next to the tab) on Nexus 7. Thus, any statement that uses instead, and has no button 'more '.

    Hope this helps,
    Michelle

  • Help with Acrobat js created the menu button

    I have to use a short javascript that creates a menu button. The js script is in the correct Acrobat JavaScripts folder. I use Acrobat Pro 8.1.2

    var oButObjAddSigningPage =
    {cName: "AddSignPage"}
    cEnable: «event.rc = (app.doc!» (= null)",
    cExec: "AddSigningPage()."
    cLabel: "add a signature Page."
    cTooltext: "add signature page in the current document."
    };

    Try
    {
    app.addToolButton (oButObjAddSigningPage);
    {catch (e) {console.println (e) ;}

    The AddSigningPage() function"is in the same script file.

    Problem: The button loads and displays correctly (dimmed) If Acrobat is launched. If a pfd file is then loaded the button comes alive and the function works OK.

    But button is not displayed if Acrobat is launched by clicking on a pdf file.

    Help please.

    The entrance that fits the function 'app.removeToolButton' is the name of the button of the toolbar, not has been used to create.  Try this:

    app.removeToolButton ("AddSignPage");

    The first thing you should check is the toolbar "add-on".  After loading your document, and when the toolbar button does not appear.  Right-click on an empty part of the Acrobat toolbar to display a list of all individual toobars.  Is there a bar of modules?  Is it verified?

    To determine if your folder level script has been loaded and executed, test the function created in this script.

    Run it from the console window

    AddSigningPage

    The code for the function will be returned if it is has been defined.

    To determine if your toolbar button has been loaded, run this code in the console window.

    lst var = app.listToolbarButtons)
    for (var i = 0; i)<>
    If (.cName lst [i] is "JSAppToolBar")
    Console.println (LST [i]);
    }

    the "JSAppToolBar" is the internal name of the toolbar "add-on".

    However, from what you described, it seems that if you've hit a bug.  Probably a timing issue.  What are the characteristics of this file?

    Thom Parker
    WindJack Solutions
    The source for PDF Scripting Info
    http://www.pdfScripting.com

    The Acrobat JavaScript Reference, use it early and often
    http://www.Adobe.com/devnet/Acrobat/JavaScript.html

  • Cannot access the page customize or see the menu button!

    I had two modules different twitter (Twitbin and App Twitter). The first was one that I enabled again, because I wanted to see if it has improved for some time. After restarting my browser, however, most of my toolbars have been on different parameters. I managed to get my bookmarks toolbar, showing once again. However, now:
    -I can click on "Customize" under the tools, but the page appears empty (if any)
    -the orange "firefox" button at the top left disappeared
    -menu button (three horizontal lines) disappeared

    In addition, restarting somehow messed up my manager's Session module. It lists my tabs/windows have saved, but they never load.

    I searched everywhere, but have not found any real answers (page customize and SM have been the most frustrating of all this). I completely remove the add-on twitter, I chose not to use, but it changed nothing about how it was.

    Thank you
    -A

    Hello

    The reset Firefox feature can solve a lot of problems in restaurant Firefox to its factory default condition while saving your vital information.

    Note: This will make you lose all the Extensions and preferences.

    • Sites Web open is not recorded in less than 25 versions of Firefox.

    To reset Firefox, perform the following steps:

    For Firefox versions prior to 29,0:

    1. Go to Firefox > help > troubleshooting information.
    2. Click on the "Reset Firefox" line

      button.

    3. Firefox will close and reset. After Firefox is finished, it will display a window with the imported information. Click Finish.
    4. Firefox opens with all the default settings applied.

    For Firefox 29,0 and above:

    1. Click the menu button

      click Help

      and select troubleshooting information. Now, should open a new tab containing your troubleshooting information.

    2. At the top right of the page, you should see a button that says "Reset Firefox"

      . Click on it.

    3. Firefox will close and reset. After Firefox is finished, it will display a window with the imported information. Click Finish.
    4. Firefox opens with all the default settings applied.

    Information can be found in the article Firefox Refresh - reset the settings and Add-ons .

    This solve your problems? Please report to us!

    Thank you.

Maybe you are looking for

  • Qosmio F20 MXM Support

    Hello is there someone who could tell me if the Qosmio F20-149 supports MXM II? I would like to replace the go 6600 with go 7600 MXM II, is this possible? THX for the help!

  • HP Officejet 4355 all-in-one: scanning problems

    The Scan option does not appear on my computer despite having installed the all-in-one HP Officejet 4355 printer. I also tried to download the latest drivers for the printer but the Scanner does not work. Yet on other laptops (I have a Gateway laptop

  • BlackBerry Smartphones running large icons for 8310 4.5 os

    Please please can someone tell if there are topics there with large icons compatible with the 4.5 os...

  • Disappearance of Smartphones blackBerry e-mails, which has a * permanent solution?

    Every week or two, my Blackberry just up and decides to remove 80-90% of my Inbox. Now, I am well aware that this is happening because my integrated device memory ate, and I took the steps as much as I can to fix it, for example delete apps I don't u

  • Cisco configuration professional

    Hi I downloaded configuration cisco professional, but did not find any installer in the zip file I downloaded from cisco. Zip files included only html files. I have read the information on the professional page of cisco configuration file I downloade