How make a button enable property "true" while i am clicking a row from datagrid in mxml flex4 app

hi friends,
i am new to flex, i am doing flex4 web application with mxml tags.
i have struck in this place,please give some idea.
i have one data grid with 5 rows and 4columns,and also i am having one button (property enable is false).
while i am click a particular row from datagrid that time the button property enbale should be change to true.
where i have to write code.
any suggession or snippet code,
Thanks in advance.
B.venkatesan.

Hi,
You can take help of following code :
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   xmlns:s="library://ns.adobe.com/flex/spark"
   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var Arr:ArrayCollection = new ArrayCollection([{a:"AAA",b:"BBB"} , {a:"111" , b:"222"}]);
public function enable():void{
Btn.enabled=true;
]]>
</fx:Script>
<mx:DataGrid x="91" y="36" dataProvider="{Arr}" click="enable()">
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="a"/>
<mx:DataGridColumn headerText="Column 2" dataField="b"/>
</mx:columns>
</mx:DataGrid>
<s:Button x="210" y="237" id="Btn" label="Button" enabled="false"/>
</s:Application>
Thanks and Regards,
Vibhuti Gosavi | [email protected] | www.infocepts.com

Similar Messages

  • How to generate PDF using selcted row from datagrid in mxml flex4 web application

    hi friends.
    i am using flex4 web application with mxml tabs.
    i am having one datagrid and one button outside the grid ,
    i   am having one datagrid in that i am having 5 records if i click a   record from the datagrid then click that button means that particular   record will save as PDF in my local PC.
    How to do that,
    Any suggession or examples.
    Thanks in advance
    B.venkatesan.

    Thanks Vibhuti,
    i got some idea abt PDF save bt please tell .i have some doubts in this code
    var bytes:ByteArray = claimPDF.save(Method.LOCAL);
    var f:FileReference = new FileReference();
    f.save(bytes,"tourdeflex-pdf-sample.pdf");
    what is claimpdf and Method? it show undefiened probery error
    and f and bytes also show the same error.
    what header files i have to import for file reference concepts;
    i am using FLASH PLAYER 10;
    tell what i will do
    Thanks
    B.venkatesan

  • How to set button disabled property based on backing bean method

    JDeveloper 12c
    I have a table and a button on the page. When user selects certain table row I want to enable/disable the button.
    My backing bean (which has backing bean scope in the task flow where the page is) is
    package view.backing;
    public class Studybrowse {
        public Studybrowse() {
        public String b1_action() {
              //Do something here
            return null;
       public boolean b1_user_auth(){
           // Do something here to return true or false
            return true;
    My button is something like this:
    <af:button text="Do something" id="b4" action="#{backingBeanScope.Studybrowse.b1_action}"
                   disabled="#{backingBeanScope.Studybrowse.b1_user_auth THIS DOES NOT WORK}"
                   partialTriggers="t1"/>  
    The first problem is in design time, it says: "Reference backingBeanScope.Studybrowse.b1_user_auth not found"
    and in runtime, desired behavior does not work.
    Any help is appreciated

    Timo:
    I changed my backing bean method like this:
        public Boolean isUserAuthorized(){
            // some code here that will return true or false, hardcode to true for now
            return true;
    and the button disabled property like this:
               <af:button text="Go to Reports!" id="b5" action="#{backingBeanScope.Studybrowse.b1_action}"
                           disabled="#{backingBeanScope.Studybrowse.isUserAuthorized}"
                           partialTriggers="t1"/>                   
    Still same problem in design time there is a warning and 500 error in runtime.
    <Jan 22, 2014 11:36:15 AM CST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /studyBrowse URI: /studyBrowse.jsf actual-URI: null.
    javax.el.PropertyNotFoundException: //C:/Documents and Settings/rade/Application Data/JDeveloper/system12.1.2.0.40.66.68/o.j2ee/drs/ADFOracleReports/ViewControllerWebApp.war/studyBrowse.jsff @41,46 disabled="#{backingBeanScope.Studybrowse.isUserAuthorized}": The class 'view.backing.Studybrowse' does not have the property 'isUserAuthorized'.
      at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:111)
      at org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:73)
      at oracle.adfinternal.view.faces.renderkit.rich.ButtonRenderer.getDisabled(ButtonRenderer.java:436)
      at oracle.adfinternal.view.faces.renderkit.rich.ButtonRenderer.encodeAll(ButtonRenderer.java:270)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:1085)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
      at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:455)
      at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$1600(PanelGroupLayoutRenderer.java:30)
      at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:761)
      at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:653)
      at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:195)
      at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:326)
      at oracle.adfinternal.view.faces.taglib.region.IncludeTag$FacetWrapper.processFlattenedChildren(IncludeTag.java:683)
      at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:171)
      at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:326)
      at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:291)
      at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:366)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:1085)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
      at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3195)
      at oracle.adfinternal.view.faces.renderkit.rich.PageTemplateRenderer.encodeAll(PageTemplateRenderer.java:68)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:1085)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
      at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3195)
      at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer._encodeChildren(RegionRenderer.java:417)
      at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer.encodeAll(RegionRenderer.java:228)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:1085)
      at oracle.adf.view.rich.component.fragment.UIXRegion.encodeEnd(UIXRegion.java:288)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
      at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3195)
      at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:275)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:1085)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
      at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3195)
      at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1473)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:1085)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
      at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:102)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
      at org.apache.myfaces.trinidad.view.ViewDeclarationLanguageWrapper.renderView(ViewDeclarationLanguageWrapper.java:101)
      at org.apache.myfaces.trinidad.view.ViewDeclarationLanguageWrapper.renderView(ViewDeclarationLanguageWrapper.java:101)
      at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:338)
      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
      at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:170)
      at oracle.adfinternal.view.faces.lifecycle.ResponseRenderManager.runRenderView(ResponseRenderManager.java:52)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1104)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:389)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:255)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:341)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:192)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:478)
      at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:478)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:303)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:208)
      at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:137)
      at java.security.AccessController.doPrivileged(Native Method)
      at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
      at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
      at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:120)
      at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:217)
      at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:81)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:225)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3367)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3333)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
      at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2220)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2146)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2124)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1564)
      at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)
    >
    <Jan 22, 2014 11:36:15 AM CST> <Error> <javax.enterprise.resource.webcontainer.jsf.application> <BEA-000000> <Error Rendering View[/studyBrowse]
    javax.el.PropertyNotFoundException: //C:/Documents and Settings/rade/Application Data/JDeveloper/system12.1.2.0.40.66.68/o.j2ee/drs/ADFOracleReports/ViewControllerWebApp.war/studyBrowse.jsff @41,46 disabled="#{backingBeanScope.Studybrowse.isUserAuthorized}": The class 'view.backing.Studybrowse' does not have the property 'isUserAuthorized'.
      at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:111)
      at org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:73)
      at oracle.adfinternal.view.faces.renderkit.rich.ButtonRenderer.getDisabled(ButtonRenderer.java:436)
      at oracle.adfinternal.view.faces.renderkit.rich.ButtonRenderer.encodeAll(ButtonRenderer.java:270)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      Truncated. see log file for complete stacktrace
    >

  • How do I make a button NOT take focus when it is clicked?

    I am trying to create a virtual keypad and the problem is that when I have a Robot make a KeyEvent for a certain number when a certain button is pressed, the TextField loses focus and the focus is placed on the button that was pressed, so nothing appears in the TextField.
    How can I make a button NOT take the focus when it is pressed?
    Edited by: tox0tes on Nov 28, 2008 8:06 PM

    great. another way is to have a call to myTextField.requestfocus() in the button's actionlistener actionPerformed method, but that leads to tight coupling.

  • How make a button open a .swf file in a new window?

    How do I make a button open a swf file in a seperate window
    new window (like if i opened to swf file seperately)
    Anyone know ?

    well you can publish the the other FLA, which would give you
    an HTML file, upload that and the SWF then link to the SWFs' HTML
    page.

  • How make a button inactive after the click ?

    Hi,
    how can i make a button inactive after i clik on it ? I need it becasue i have one button which play my symbol (made with this nice course https://blogs.adobe.com/edge/2012/07/18/tutorial-leveraging-independent-symbol-timelines/) but it's not working when the button is in the symbol where there is animation, it's only working when the buttons is a symbol on the stage and on the top of all over symbols, so when i clik on it works and play the symbol that i want but after is still active so i can't place another button at the exact same place of the first because it will play the first button and i need to put 20 buttons, anyone can help me please ? My buttons is just an empty rectangle so i don't talk about turn of the visibility but turn of th "activity"
    Thanks a lot

    If you prefer you can put the code in compositionReady
    Here is a sampe on how to use a next and prev buttons to change data.I have some other examples I will add later but this one could give you an idea on how to do it.
    This one uses data from an array and then moves through the info:
    https://app.box.com/s/78ya0labbydgwogxra2a
    If you are playing symbols then use the rigth scope to get to them.
    I would make a array of the symbol names and use it the same way like I did the array for the info.
    sym.getSymbol(mysymbolArray[i]).play();

  • How to delete a selected row from datagrid and how to create a datagrid popup

    hi friends,
                  I am new to flex.i am doing a flex4 application,i need help for this.
                i am having a data grid with columns.i have two questions.
               Ques 1: when  i selected a partiuclar row from a datagrid and click delete button  means that record will delete from the datagrid and DTO from the cloud  tables also.
                Ques 2: when i save  the data grid values using save button means that data will store in  respective cloud DTO which is related to the datagrid,
                     My requirement is i am using a search button when i click the search  button it will show a datagrid that datagrid will contain the previous  datagrid datas which is saved in the cloud.
    REQUIREMENT example: first screen:           i am using with data grid 3 columns (Student Roll number ,Student Name,Student pecentage)---->save--->data will store in cloud DTO.
    Second screen:                search button ----> it need show  datagrid popup.it will have data which we saved in the first screen with same columns(Student Roll number ,Student Name,Student pecentage).
    This is my requirement.
    Any suggession welcome.
    Thanks in advance.
    B.Venkatesan

    Lets break the problem statement in multiple steps
    1. We need a way to know the selection on all rows.
    2. We need the association of the checkBox with the data
    The  solution is to use a arrayCollection/array that holds all the instances  created for checkbox.This collection should be a property of component  containing the datagrid. We need to use a custom component  implementation or inline ItemRenderer. The way you have used is called  dropinItemRenderer. Preferaly use custom component implementation and  add the instance to the arrayCollection at CreationComplete. Make sure  you use addItemAt so that you add the instance in the same row as the  data. To get rowIndex the custom Checkbox should implement  IDropInListItemRenderer. You could iterate this collection to check all  the instances that are checked.
    Note: This is the approach considering your dataprovider doesnt have a selection field.
    Nishant

  • How to delete a Selected row from datagrid and how to create a datagrid popup with saved values

    hi friends,
                  I am new to flex.i am doing a flex4 application,i need help for this.
                i am having a data grid with columns.i have two questions.
               Ques 1: when i selected a partiuclar row from a datagrid and click delete button means that record will delete from the datagrid and DTO from the cloud tables also.
                Ques 2: when i save the data grid values using save button means that data will store in respective cloud DTO which is related to the datagrid,
                    My requirement is i am using a search button when i click the search button it will show a datagrid that datagrid will contain the previous datagrid datas which is saved in the cloud.
    REQUIREMENT example: first screen: i am using with data grid 3 columns (Student Roll number ,Student Name,Student pecentage)---->save--->data will store in cloud DTO.
    Second screen: search button ----> it need show  datagrid popup.it will have data which we saved in the first screen with same columns(Student Roll number ,Student Name,Student pecentage).
    This is my requirement.
    Any suggession welcome.
    Thanks in advance.
    B.Venkatesan

    Lets break the problem statement in multiple steps
    1. We need a way to know the selection on all rows.
    2. We need the association of the checkBox with the data
    The  solution is to use a arrayCollection/array that holds all the instances  created for checkbox.This collection should be a property of component  containing the datagrid. We need to use a custom component  implementation or inline ItemRenderer. The way you have used is called  dropinItemRenderer. Preferaly use custom component implementation and  add the instance to the arrayCollection at CreationComplete. Make sure  you use addItemAt so that you add the instance in the same row as the  data. To get rowIndex the custom Checkbox should implement  IDropInListItemRenderer. You could iterate this collection to check all  the instances that are checked.
    Note: This is the approach considering your dataprovider doesnt have a selection field.
    Nishant

  • How do I make all buttons on stage unclickable, while a certain movie clip is visible?

    Hi,
    I have a button on stage which opens a popup (movie clip is popup + several other buttons). The movie clip and the buttons on it take up most of the stage.
    The problem is that the buttons which are on the stage, and are behind the movie clip, remain clickable (you can click through the movie clip!). How may I disable this?
    Basically, I need to make it that you cannot click through the movie clip.
    Thanks in advance!
    PS I am using CS5 and AS2.

    One way would be to make the movieclip clickable.  That would make it block the other objects behind it...
         mc.onRelease = function(){ }
         mc.useHandCursor = false; // to hide the hand cursor
    Another way would be to disable the buttons while the movieclip is present...
         btn.enabled = false;
    Another way would be to build conditional code into the button clicking code to not work if the movieclip is visible.
         btn.onRelease = function(){
              if(!mc._visible){
                    // okay to do stuff

  • How make menu button with unrolling thumbnails in as 3.0??

    Hello
    I need help with doing a menu with unrolling and rolling up buttons with thumbnails;  now I have someting like that (attachments) this was made by as 2.0 but I need help with changing this on as 3.0.
    if samobody have some ideas how can I do this or somting similar using as 3.0 I will be grateful

    The only way to convert it to AS3 is to go thru it and replace the code as needed.  While some code may not have to change, quite a bit of it will.  Your best bet for getting thru it is to build it up from scratch one object at a time and get each coded as you go.  Otherwise you will be overwhelmed with error messages.  Here's a few pointers.
    All code is AS3 has to be placed on the timeline.  You cannot place code "on()" objects.  So each object needs an instance name.
    Any interaction or event handling such as mouse controls and file loading involve event listener/event handler pairs.  So you will want to start with looking into the addEventListener() method, which is pretty much used globally for any/all event processing.
    When it comes to loading external swf files, you want to use the Loader class.
    To determinine how to make the code work, I recommend using a practice file.  A file that you can implement one codig sequence in at a time just to determine what works.
    Converting this to AS3 will be a good exercise for you on the road to learning it.  When I wanted to start learning AS3 that's pretty much what I did, though with the sole purpose of the learning as my goal.  I took a fairly complicated menu design that I had created first in AS2, and then rebuilt it from the ground up using AS3.

  • How make menu button with unrolling and rolling up thumbnails

    Hello
    I need help with doing a menu with unrolling and rolling up buttons woth thumbnails;  now I have this made by as 2.0 but I need help with changing this on as 3.0. or if samobody have some ideas how can I do this using as 3.0 I will be grateful

    The only way to convert it to AS3 is to go thru it and replace the code as needed.  While some code may not have to change, quite a bit of it will.  Your best bet for getting thru it is to build it up from scratch one object at a time and get each coded as you go.  Otherwise you will be overwhelmed with error messages.  Here's a few pointers.
    All code is AS3 has to be placed on the timeline.  You cannot place code "on()" objects.  So each object needs an instance name.
    Any interaction or event handling such as mouse controls and file loading involve event listener/event handler pairs.  So you will want to start with looking into the addEventListener() method, which is pretty much used globally for any/all event processing.
    When it comes to loading external swf files, you want to use the Loader class.
    To determinine how to make the code work, I recommend using a practice file.  A file that you can implement one codig sequence in at a time just to determine what works.
    Converting this to AS3 will be a good exercise for you on the road to learning it.  When I wanted to start learning AS3 that's pretty much what I did, though with the sole purpose of the learning as my goal.  I took a fairly complicated menu design that I had created first in AS2, and then rebuilt it from the ground up using AS3.

  • How Make A button point me to other window in Gui with java

    hello .i try to make a program,i creat button it's name Next, i wanna when user press Next go To other Panel Or another Window .
    plz help me for this problem try to code me the function or somthing help

    Make each page a JPanel with a master JPanel (using a CardLayout) holding all the pages . Each page will then have a button for which the associated Action will be to move to the next page of the msater JPanel. See http://java.sun.com/docs/books/tutorial/uiswing/layout/card.html .

  • Can I make a button respond to Touch while using Gestures?

    Hi, I've recently discovered I'm unable to use Touch Points and Gestures at the same time on mobile apps.
    I would rather use Gestures so I'm wondering if anyone can help with making buttons respond to the user when they are touched.
    Here's what I'm trying to do but the buttons are not changing alpha values:
    mainMenu.menuPres.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    mainMenu.menuPres.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
    function mouseDownHandler(event:TouchEvent):void {
    TweenLite.to(mainMenu.menuPres, .2, {alpha:.5});
    function mouseUpHandler(event:TouchEvent):void {
    TweenLite.to(mainMenu.menuPres, .2, {alpha:1});
    Is there another way I can do this or can this method be refined?
    Thanks

    Hi Mike,
    That's right, MultiTouch and Gestures can not be used at the same time, but you should always be able to receive mouse events for 1st touch point.
    Could you try changing your code as below.
    function mouseDownHandler(event:MouseEvent):void {
    TweenLite.to(mainMenu.menuPres, .2, {alpha:.5});
    function mouseUpHandler(event:MouseEvent):void {
    TweenLite.to(mainMenu.menuPres, .2, {alpha:1});
    please sprinkle some trace statements in event handler to see if they get triggered.
    Also, did you try just adding event listener for MouseEvent.CLICK, instead of MOUSE_DOWN and MOUSE_UP.
    -Thanks
    Pahup

  • How to get multiple row values in one text box while clicking one row from grid?

    hi friends,
               i am working on flex4 web application i am using  one datagrid ,it have two records(bills),one button and one text box.
    ex:
    customername      salesrepname   receipt no      amount
    venkat                         raj                         1102          10000
    ramu                          ramesh                   1102         20000
    here both receipt no is same.now i want to select one of this receipt and click pay button which is place in outside the grid.
    now my need is after click the pay button in text box i need 10000+20000=30000,after click that button i want both receipts should be invisible...'
    how i will do this,
    any suggession,
    Thanks
    B.venkatesan

    One way with 10g:
    select mgr,
           rtrim(xmlagg(xmlelement(empno,empno||',').extract('//text()')),',')  emps
    from emp
    where mgr is not null
    group by mgr;10g:
    -- define this function:
    create or replace
    function concatenate(c Sys_refcursor, sep varchar2 default null) return varchar2
    as
      val varchar2(100);
      return_value varchar2(4000);
    begin
    --  open c;
      loop
      fetch c into val;
      exit when c%notfound;
      if return_value is null then
        return_value:=val;
      else
        return_value:=return_value||sep||val;
      end if;
      end loop;
      return return_value;
    end;
    select mgr,
           concatenate(cursor(select empno from emp e where e.mgr=emp.mgr order by empno),',')
    from emp
    where mgr is not null
    group by mgr;With 11g:
    select mgr,
           listagg(empno,',') within group (order by empno) emps
    from emp
    where mgr is not null
    group by mgr;

  • How can I set a property when an event happens? (selection changed on datagrid)

    I have a datagrid, I would like to change the backgrund of the datagrid when the selection changed event is fired.
    I can not use data trigger, because is in the case that I expected a value, but in this case is when change, to any value.
    An option is to use an event trigger, but all the examples that I have found is to use with an actions, and I just want to set a property.
    How could I do that?
    I am using MVVM pattern, so I would like to avoid the use in code-behind.
    Thank so much.

    You could use an event trigger and implement your own TriggerAction<T> that sets the background property. There is an example of how to create a custom TriggerAction available here:
    http://stackoverflow.com/questions/942548/setting-a-property-with-an-eventtrigger.
    The following example sets the Background property of the DataGrid to a red SolidColorBrush when the SelectionChanged event is fired. It should give you the idea:
    <DataGrid x:Name="dgrid"
    xmlns:local="clr-namespace:WpfApplication22">
    <i:Interaction.Triggers>
    <i:EventTrigger EventName="SelectionChanged">
    <local:SetPropertyAction PropertyName="Background" TargetObject="{Binding ElementName=dgrid}">
    <local:SetPropertyAction.PropertyValue>
    <SolidColorBrush>Red</SolidColorBrush>
    </local:SetPropertyAction.PropertyValue>
    </local:SetPropertyAction>
    </i:EventTrigger>
    </i:Interaction.Triggers>
    <DataGrid.Columns>
    namespace WpfApplication22
    public class SetPropertyAction : TriggerAction<FrameworkElement>
    public string PropertyName
    get { return (string)GetValue(PropertyNameProperty); }
    set { SetValue(PropertyNameProperty, value); }
    public static readonly DependencyProperty PropertyNameProperty
    = DependencyProperty.Register("PropertyName", typeof(string),
    typeof(SetPropertyAction));
    public object PropertyValue
    get { return GetValue(PropertyValueProperty); }
    set { SetValue(PropertyValueProperty, value); }
    public static readonly DependencyProperty PropertyValueProperty
    = DependencyProperty.Register("PropertyValue", typeof(object),
    typeof(SetPropertyAction));
    public object TargetObject
    get { return GetValue(TargetObjectProperty); }
    set { SetValue(TargetObjectProperty, value); }
    public static readonly DependencyProperty TargetObjectProperty
    = DependencyProperty.Register("TargetObject", typeof(object),
    typeof(SetPropertyAction));
    protected override void Invoke(object parameter)
    object target = TargetObject ?? AssociatedObject;
    PropertyInfo propertyInfo = target.GetType().GetProperty(
    PropertyName,
    BindingFlags.Instance|BindingFlags.Public
    |BindingFlags.NonPublic|BindingFlags.InvokeMethod);
    propertyInfo.SetValue(target, PropertyValue);
    For more information about how to hook up event triggers and handle events in MVVM, please refer to my blog post:
    http://blog.magnusmontin.net/2013/06/30/handling-events-in-an-mvvm-wpf-application/
    Please also remember to mark helpful posts as answer.

Maybe you are looking for

  • Select more than one photo for an mms upload

    I am trying to send more than one photo (by mms) to [email protected]  It will only let me select one at a time to upload.  I know how to select more than one (capital button), but it does not work.  any body know how to select more than one photo to

  • Does Exchange Server 2003 use M$SQL Server?

    Hi All, I have a new customer with SBS 2003 running as an Exchange Server.  He have four workstations and one server.  He is also running M$SQL Server 2005.  Does Exchange Server use M$SQL Server?  (Need to know for backup considerations.) Many thank

  • Why we go for DP & SNP

    I m new to this field my question is why we go for DP and SNP when there is MRP in R/3. Can any one explain me & solve this problem. Thanks in advance

  • Need hints to bring BC400(ABAP) knowledge to BW update rules/routines.

    Hi, I have just completed the BC400 (ABAP) course at SAP but the instructor had no clue about BW. From se80, he thought how to create packages, programs, functions modules, classes/Interfaces, etc. but whenever, I asked how these fit into the BW upda

  • Message sending options

    I have Blackberry Q5 phone. The issue I am facing is, when send a text message to one of contacts it goes as MMS and as a Text message. And the issue is with only one contact, for rest there is no issues. Please help.