Buttons inside ItemRenderers

Hi all

Working on my first Flex application and encountered a small problem:

I have a converter of custom element I have buttons inside (in fact labels with click events). These work well, but the problem comes when I want to add another click eventlistener for the entire element converter itself, so when users click on this point, he does something and when users click buttons (labels) inside the element Converter it's something else. What I don't want past is the renderer event point to raise when I click on the label on the inside. Now when I click on the label on the inside I get two events triggering (the click event on the Label and the other on the element converter) which makes sense, but I don't want the click event of renderer point to trigger when I click on the labels, but a click any else on the rendering of the element triggers the click event of the item renderer.

How can I solve this problem?

Appreciate your help on this...

When you click on the button/label, the event is dispatched to the registered label event listeners, then the event propagates to parent components (i.e. the look of Dispatcher of events in each parent of the label if the click event is registered, it is the case for your element converter).

You should stop the spread is made in the event of the label listener, for example using event.stopPropagation ().

Propagation is well described here: http://www.adobe.com/devnet/flex/videotraining/xml/fiaw_v2_02.html

Tags: Flash Builder

Similar Questions

  • How empy and replace the buttons inside the Manager of horizontal management.

    Hello! So basically, I have 2 buttons at the top of the screen and a set of buttons inside a HorizontalFieldManager (let's call is Set 1 and 2). Now, when I click on the first button it should appear a Set 1 and then appear Set 2 and remove the Set1 on screen. How can I do this? Thank you!

    -Ryan

    The details in the referenced thread, you should get going.

    Basically, you add and remove fields.

    I suggest that you have a Manager to Set 1 and a Manager for value 2.  Add the two managers to the screen, with nothing in it,

    Make sure that Manager 2 is empty (deleteAll) and add fields associated with the value 1 to the Manager for the value 1, when they should be displayed - i.e. trigger it by pressing button 1.

    Remove the fields in Manager 1 and add the fields associated with the value 2 to the Manager for Set 2, when they should be displayed - i.e. trigger this by pressing button 2.

    I hope this helps.

  • AS3 button inside a movieclip

    I only started to learn AS3, I have a very simple question, but I can't understand it.

    I have a movieclip with instance name mcChange, and it has a button inside btnBack. When the button is clicked, I want to debut at the first image on the main stage.

    I would appreciate if you could help me with this one.

    where is the code?

    Chronology of mcChange when the button exists in case:

    btnBack.addEventList...

    If during the kinship of mcChange chronology after mcChange and btnBack exist:

    mcChange.btnBack.addEventList...

    the code that must be in the listener function depends on where the code is located and where the main stage is relative to the location of the code, if someone is bound to suggest any MovieClip (root) to the main timeline, which is always bad coding but will often work of reference.

  • How to put a button * inside * a trigger

    Hi people.

    I was directed to a good tutorial on how to put a button inside a target in a composition, but for some reason that I am not able to do the same thing when I try to put a button inside a trigger.

    I want to do is to have the icon of the trigger to change a bit (just get bigger) when you ride on it.   But I'm having a hell of a time.   Anyone know a work around?

    Thank you!

    No workaround but functionaloty normal:

    1. Select the trigger.

    2. open the States Panel.

    3, select 'Normal' in the States Panel.

    4. click on the word "fill" in the control strip above.

    5. a dialog box will open. Here, select an image to fill the trigger.

    6. click on other States in the States Panel and complete relaxation with a different version of your image.

  • Command button inside the column heading in the table of the ADF

    Hi all
    I want to insert two command buttons inside the column header of a table of the ADF.
    In my mind these buttons should replace the buttons two default (triangles) to sort the column in ascending or descending order.
    You know a solution? Because it's 2 days I'm trying, but no way.

    Thanks in advance
    Stefano

    have you tried facet the af pane header: column?

    
      
        
        
          
            
            
          
        
      
    ...
    
  • Button inside symbols

    Hello

    I have a button inside a symbol and I want to when you click on this symbol to play.

    The symbol is 'Anim_Perso '.

    https://creative.Adobe.com/file/47b82617-3124-4eab-9482-ac94b30674c4


    https://creative.Adobe.com/file/47b82617-3124-4eab-9482-ac94b30674c4

    Thank you

    Stéphane

    Hello

    Thanks, it works well

    Steph

  • Why a button inside a symbol does not work?

    Hello

    I create a button, when you click with this command:

    SYM. Play ("mylabel");

    you go into the editing of the scene to the "mylabel" label... .the everything ok

    but If I have to save my button as a symbol when I press it, it do not go to the label on the stage called "mylabel."

    What I write if I whan my button inside anoter simbol work?

    Thank you

    Use this code if you want to add it to an element within a symbol to play the label on the timeline

    sym.getComposition () .getStage () .play ("spinBlock");

    Use this code if you want to add it to oppose within a symbol to control another symbol on the stage.

    sym.getComposition () .getStage ().getSymbol("star").play ();

    Use this code if you want to add to an object within a symbol to control a symbol within a symbol

    sym.getComposition () .getStage ().getSymbol("starB") .getSymbol ("starCenter") .play ();

  • Buttons inside frames with scroll

    I have a series of photographs which act as buttons that go to a page number. In an article, I've grouped these buttons and put them inside a floating frame. They work very well.

    Now, in another article (both of these items are part of the same FOLIO) these buttons just go to WHO. The MSOs have pan and zoom enabled (many current interactivity). I have cut and paste these buttons inside of a framework and made scroll, but the buttons are non-functional. Why the buttons functional within a framework and non-functional in another?

    There is a problem with buttons now. You can try to rename the buttons with all lowercase letters and without spaces or wait for the fix.

    Bob

  • Check the status of MSO 2 by a button inside the OSM 1

    Hello world

    This is my problem:

    1. I have two objects of State Multi (I'll call her MSO 1 and 2 of the WHO)

    2. I need a button inside the OSM 1 States to control 2 MSO

    the problem is when I create the button inside the OSM 1 and choose "go to State" action, I can't choose the 2 MSO (MSO 2 name is not displayed)

    is there a limitation of dps for that kind of interaction? If this is the case, is there a solution for this?

    Thanks in advance

    F.

    This is actually a limitation of InDesign. You cannot add a button to a MSO that points to a different MSO.

  • Trying to create a button inside a clip that will return to scene 1

    I am trying to create a button inside a clip that will go back to scene 1.

    Here is my code

    Stop();

    sback1_btn.addEventListener (MouseEvent.Click, Film1);

    function film1(event:MouseEvent):void {}

    gotoAndStop ("shorts");

    }

    I get access of undefined property error.

    Can anyone help?

    Thank you.

    Try

    sback1_btn.addEventListener (MouseEvent.Click, Film1);

    function film1(event:MouseEvent):void {}

    MovieClip (root) .gotoAndStop ("shorts");

    }

    or

    MovieClip (root). VideoMask.sback1_btn.addEventListener (MouseEvent.CLICK, film1);

    function film1(event:MouseEvent):void {}

    MovieClip (root) .gotoAndStop ("shorts");

    }

    The problem is the path

  • Cannot click on buttons inside draggable movieclip.

    I have a removable clip, mc_PI on the stage in which I have another movieclip, mc_PIcontainer in which I load an image.  Then, I place a few buttons, btn_Ant1, btn_Ant2, etc. inside mc_PI.

    mc_PI hangs out just fine within the limits that I said, but I can't click the buttons that are inside mc_PI.  I need the buttons inside the mc_PI, because I need them to drag as well as the image in mc_PI.mcPIcontainer.  My code is:

    ///////////////////
    Dragging.
    ///////////////////
    var container: MovieClip = mc_PI.mc_PIcontainer.createEmptyMovieClip ("container", 1);
    var mcLoader:MovieClipLoader = new MovieClipLoader();
    mcLoader.addListener (this);
    mcLoader.loadClip ("images/PI.jpg", mc_PI.mc_PIcontainer.container);

    function onLoadInit(mc:MovieClip)
    {
    mc.forceSmoothing = true;
    MC._quality = "BEST";
    }

    mc_PI.useHandCursor = false;
    mc_PI.onPress = function (): Void
    {
    startDrag (this, false,-910,-1769, 1, 36);
    }

    mc_PI.onRelease = mc_PI.onRollOut = function (): Void
    {
    stopDrag();
    }


    /////////////////////////
    Buttons.
    /////////////////////////
    mc_PI.btn_Ant1.useHandCursor = true;
    mc_PI.btn_Ant1.onRelease = function (): Void
    {
    trace ("clicked mc_Ant1");
    }

    to check click parent1 child1, use:

    {parent1.onRelease = Function ()}

    {if (parent1.child1.HitTest (_xmouse, _ymouse))}

    do everything.  the user has clicked Child1

    }

    }

  • How to keep the buttons inside a DataGrid

    Is it possible to have buttons inside a DatGrid?

    For example, I want to Add, Delete, Update buttons inside a DataGrid control.

    Please tell me how to do this?

    For global buttons as you describe, I place them in a container as well as the data grid.

  • AS3 putting the buttons inside the Movie Clip

    I'm practicing AS3 (after years of AS2) and can't have a button inside of a clip speaks to another clip on the main timeline. Here is the code:

    OneButton.addEventListener (MouseEvent.CLICK, OneButtonClicked);

    function OneButtonClicked(event:MouseEvent):void

    {

    MovieTarget.gotoAndStop (1);

    MovieDescription.gotoAndStop ("One");

    }

    TwoButton.addEventListener (MouseEvent.CLICK, TwoButtonClicked);

    function TwoButtonClicked(event:MouseEvent):void

    {

    MovieTarget.gotoAndStop (2);

    MovieDescription.gotoAndStop ("Two");

    }

    The code above works, but if I put OneButton and channels within a clip, I know can target the MovieTarget and MovieDescription. The reason that I want to put OneButton and strings inside it's own MC is so I can dim each hit after top by switching the playhead within this MC help. ? Thank you!

    Start from the beginning

    Press f8 and choose movieClip, then draw your button movie untoggled call then create another movie and create your button toggled or grayed button and call it greyedButton.  Go to the main stage add 2 instances of button and 2 greyedButton (just drag the library).  you have 4 instances on stage.  give the name of the instances of appeal and place them one over the other so you can see 2 buttons on the stage.  put the button greyed under the button.

    now with action script

    Button1.addEventListener (MouseEvent.CLICK, OneButtonClicked);

    function OneButtonClicked(event:MouseEvent):void

    {

    MovieTarget.gotoAndStop (1);

    MovieDescription.gotoAndStop ("One");

    Button1.visible = false; Here the button greyed will show

    }

    Button2.addEventListener (MouseEvent.CLICK, TwoButtonClicked);

    function TwoButtonClicked(event:MouseEvent):void

    {

    MovieTarget.gotoAndStop (2);

    MovieDescription.gotoAndStop ("Two");

    Button1.Visible = true; Here button1 will return to its orignal State

    Button2.visible = false / / here will show the button greyed

    }

  • Access to the button inside Movieclip/ScrollPane

    Hi all

    I'm trying to understand how to create a button inside a movieclip.  I have a model that has movieclips in movieclips, and when I create a button (while using AS2) the button works if I test the stage, but in the whole flash movie it does not work.  I have also a few buttons inside a ScrollPane who also do not call correctly.

    I use this code for my button:

    facebookbtn.on (release) {}

    getURL ("http://www.facebook.com/", "_blank", "GET");

    }

    ↑ This is placed on the button "facebookbtn". I also tried to use: _root.bgPages.pg1.facebookbtn.on (release), does not.

    For the one inside a ScrollPane I try to call a javascript function:

    {We (Release)}

    to import flash.external.ExternalInterface;

    ExternalInterface.call("saveglobalscore",score) ("GroupDelegate", "dayone1");

    }

    ↑ This does not work, with or without the name of the button before it (release).

    I put the FLA here so that if someone has the time, could help me with this problem quickly. Thank you!

    FLA: download FLA

    Different code depending on how you assign it. what you show seems to be mixing up both ways...

    If you place this code on the button, use:

    on (release) {}

    getURL ("http://www.facebook.com/", "_blank", "GET");

    }

    If you place this code in the script that contains the button, do not forget that you gave this name of the instance to the button (in the properties, not the library panel), and then copy the following code:

    facebookbtn.onRelease = function() {}

    getURL ("http://www.facebook.com/", "_blank", "GET");

    }

  • access a button inside a movieclip

    Hey...

    IM pretty new to Flash, I have a problem that took hours, only not to get sorted, so I'll try my luck here...

    I basically made a substitution menu that is nested within a movieclip. the movieclip is placed on 1 st. on the main Timeline frame and I want the buttons inside the clip to the user of a different image on the main timeline, but no matter what I do, it's just does not...

    Here are some of it solutions I've tried to do:

    function work1(e:Event)

    {

    //MovieClip(parent.parent).gotoAndStop ("work1")

    //gotoAndStop ("work1")

    //this.gotoAndStop ("work1")

    //parent(gotoAndStop ("work1"))

    //MovieClip(this.parent).gotoAndStop ("work1")

    //MovieClip(parent.gotoAndStop ("work1"))

    //this(gotoAndStop ("work1"))

    //main.gotoAndStop ("work1")

    //root.gotoAndStop ("work1")

    //MovieClip(root).gotoAndPlay ("work1")

    //MovieClip(stage).gotoAndPlay ("work1")

    MovieClip (root.parent.parent) .gotoAndStop ("work1");

    }

    work1_btn.addEventListener (MouseEvent.CLICK, Group1);

    I hope someone can help...

    Of course, LOL and thanks, glad that I can help you.

    for future things, (which didn't need to wait for a rendering as this project), if you want to get specific with your listeners (instead of a listener to the stage), you can add the following:

    var buttons: Array = new Array (btn1_name, btn2_name, btn3_name);

    for each {(var btn in buttons)

    btn.addEventListener (MouseEvent.CLICK, clickHandler);

    }

    That will restrict the event to those buttons... but use your button names in the table of course.

Maybe you are looking for

  • ChnDiv

    I'm putting the loop For to replace 1,2,3,..., but has the misfortune to call ChnDiv with the arguments. Can you show me how to replace 1,2,3,... by variable based on the ChnDiv? Thank you Alexander. Call ChnDiv ("[1] /In rpm", "[1] / Out rpm","/ Rat

  • Win runing XP two monitors in DualView mode and not remembering the last size and location of the records? How to solve this problem?

    I am running WinXP SP3 with two monitors running in DualView Mode and everything worked as expected until I installed the latest NViDIA drivers. After the update of the pilot, all windows and folders open centered on the main display and all pop-up w

  • My adapter does not work to charge my battery upward.

    My adapter does not have to recharge my battery even though she always. The computer says it works fine, but it's not now recognize. I tried to plug in different places in the House. Blue light works on the adapter, so I know it's on.

  • BlackBerry smartphones restore contacts BBM BB7 after using the BB10

    After testing a device BB10 (hot stuff!), I am now switching to my old camera BB7 (Bold 9900). I activated my Blackberry ID on the original device, but my BBM contacts are not restored. It's the same BB9900 that I used before, so all existing contact

  • Why 8 Captivate is always crashing on Windows?

    We run Adobe Captivate 8 on Windows computers. We also open run as administrator.Adobe Captivate 8 is on our C: drive.Why it runs so slow?Why is it always break? Several times a dialog box Monte that says "waiting for application application/close.»Y