Adding a mask in a datagrid

The first code block is an item renderer that is used to
place a button into a datagrid. The second code block is a class
that adds some interactivity to the button. The second code block
also contains two commented out lines where I have attempted to add
a mask to the button. My problem is that at present I am adding the
mask inside the button, whereas I would like the mask to be outside
the button (i.e. in the datagrid so I can animate the button to a
different state when it is clicked). I cannot figure out where I
should put the mask (I assume that it should go in the button
renderer) but have no idea where or how to place it. Can anyone
point me in the right direction?
Thanks!

"SiHoop" <[email protected]> wrote in
message
news:gd0vg1$5or$[email protected]..
> The first code block is an item renderer that is used to
place a button
> into a
> datagrid. The second code block is a class that adds
some interactivity to
> the
> button. The second code block also contains two
commented out lines where
> I
> have attempted to add a mask to the button. My problem
is that at present
> I am
> adding the mask inside the button, whereas I would like
the mask to be
> outside
> the button (i.e. in the datagrid so I can animate the
button to a
> different
> state when it is clicked). I cannot figure out where I
should put the mask
> (I
> assume that it should go in the button renderer) but
have no idea where or
> how
> to place it. Can anyone point me in the right direction?
The masking object would need to be in the canvas (outside of
the button).
HTH;
Amy

Similar Messages

  • [svn:fx-trunk] 12542: When adding a mask to the display list need to validate it and all its children .

    Revision: 12542
    Revision: 12542
    Author:   [email protected]
    Date:     2009-12-04 10:38:32 -0800 (Fri, 04 Dec 2009)
    Log Message:
    When adding a mask to the display list need to validate it and all its children.  Previously the children were not validated and their display list was updated before properties were committed or measure was done.  RichText was not set up to handle this.
    QE notes:
    Doc notes:
    Bugs: SDK-24511
    Reviewer:  Evtim, Deepa
    Tests run: checkintests, fxg, primitives, Group
    Is noteworthy for integration: no
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24511
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/utils/MaskUtil.as

    AFAIK, the only way to do this is to write a system modifcation.
    The BADI is executed only once at startup of the session, so that makes it merely static. (A strange point in time, I discussed it with SAP and they just shook their heads)
    I had the same problem with some other F4-Helps and it was a big hazzle. From my experience, no straight answer.

  • Adding a mask for a sprite

    I am having trouble adding a mask for a sprite, here is the
    reason why:
    After adding everything in the currect display list (i would
    hope it is), the mask area for the sprite is bkack and covers it
    rather than showing the content, and everywhere else the mask is
    not located, the sprite shows. It seems to be showing the opposite
    of what it should. If I do not use the mask, the sprites will not
    show or exist at all, and with it they appear, similar with using
    just a filled movieclip within the "other" sprite.
    Here are the conditions:
    I made a sprite with a given size and location (call it the
    main sprite). Then I added two sprites to that main sprite, and one
    of those two was the mask for the other. After that for the "other"
    sprite within the main, i made a for loop and filled it some with
    textfields using a database. Then, filled the mask sprite with
    color. Also, the main sprite was sized the same as the mask sprite
    so they are identical.
    var mainSprite:Sprite = new Sprite();
    var maskSprite = new Sprite();
    var otherSprite = new Sprite();
    mainSprite.addChild(maskSprite());
    mainSprite.addChild(otherSprite());
    otherSprite.mask = maskSprite;
    for (conditions here) {
    //textfields randomly entered here to the other sprite
    within conditions, etc.
    maskSprite.graphics.beginFill(0xFF0000);
    maskSprite.graphics.drawRect(0, 241, 530, 141);
    addChild(mainSprite);
    Note: I am using AS3

    Nevermind, i am just using movieclip object with a sprite as
    it's mask. Works fine.

  • Original picture turns black and white when adding layer masks.

    Creating a collage. Just placed a new object with a layer mask. Now I need to create a hue/saturation, levels adjustment layer and color balance adjustment layer all with masks. Ok, no problem, but when I do this, my original picture turns black and white. HELP!!! School project and has to be completed by Monday morning.
    Thanks. Dawn

    You haven't added a Hue/Saturation layer that's got Saturation turned all the way down, by chance?
    It might be helpful if you'd capture a screen grab and post it here, showing your layers and channels panels.  With a look at how things are organized knowledgeable folks here should be able to help or at least ask more direct questions.
    -Noel

  • Implicit coercion Error while Adding Dynamic Rows To Flex DataGrid

    Hi friends
    I   want to add interger for in next next rows while clicking tab   button,one i enter all the values in one row if i press tab means next   row will be editable.for making that i added the following code.i have   some error shows like this
        [Bindable]
                    private var tasks:ArrayCollection;
                    private static const ADD_TASK:int= "";
                    private function init():void
                        tasks = new ArrayCollection();
                        tasks.addItem(new Task(0.01,100000,0));
                        tasks.addItem({frmAmount:ADD_TASK});
                    private function checkEdit(e:DataGridEvent):void
                        // Do not allow editing of Add Task row except for
                        // "Click to Add" column
                        if(e.rowIndex == tasks.length - 1 && e.columnIndex != 0)
                            e.preventDefault();
            private function editEnd(e:DataGridEvent):void
                    // Adding a new task
                    if(e.rowIndex == tasks.length - 1)
                    var txtIn:TextInput =TextInput(e.currentTarget.itemEditorInstance);
                    var dt:Object = e.itemRenderer.data;
                    // Add new task
                    if(parseInt(txtIn.text) != ADD_TASK)
                        tasks.addItemAt(new Task(parseInt(txtIn.text), 0, ""), e.rowIndex);----->Multiple markers at this line:
                                                                                                                               -1067: Implicit  coercion of a value of type String to an unrelated type int.
                                                                                                                                  -txtIn
                    // Destroy item editor
                    commPlanDetGrid.destroyItemEditor();
                        // Stop default behavior
                    e.preventDefault();
            ]]>
    Please help if any suggession
    Thanks in advance
    B.Venkatesan

    Venktesan,
    You are trying compare String and int..! which is not possible try to case the txtIn.text to int using parseInt(txtIn.text).
    ORIGINAL:
    if(txtIn.text != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
                        tasks.addItemAt(new Task(txtIn.text, 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
    EDITED:
    if(parseInt(txtIn.text) != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
                        tasks.addItemAt(new Task(parseInt(txtIn.text), 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
    Thanks
    Pradeep

  • Error while Adding Dynamic Rows To Flex DataGrid

    Hi friends
    I want to add interger for in next next rows while clicking tab button,one i enter all the values in one row if i press tab means next row will be editable.for making that i added the following code.i have some error shows like this
    [Bindable]
    private static const ADD_TASK:int = 0;
    private function editEnd(e:DataGridEvent):void
                    // Adding a new task
                    if(e.rowIndex == tasks.length - 1)
                    var txtIn:TextInput =TextInput(e.currentTarget.itemEditorInstance);
                    var dt:Object = e.itemRenderer.data;
                    // Add new task
                    if(txtIn.text != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
                        tasks.addItemAt(new Task(txtIn.text, 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
                    // Destroy item editor
                    commPlanDetGrid.destroyItemEditor();
                        // Stop default behavior
                    e.preventDefault();
    Please if any suggession welcome.
    Thanks in advance.
    B.venktesan

    Venktesan,
    You are trying compare String and int..! which is not possible try to case the txtIn.text to int using parseInt(txtIn.text).
    ORIGINAL:
    if(txtIn.text != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
                        tasks.addItemAt(new Task(txtIn.text, 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
    EDITED:
    if(parseInt(txtIn.text) != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
                        tasks.addItemAt(new Task(parseInt(txtIn.text), 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
    Thanks
    Pradeep

  • Implicit coercion of a value of type String to an unError while Adding Dynamic Rows To Flex DataGrid

    Hi friends
    I  want to add interger for in next next rows while clicking tab  button,one i enter all the values in one row if i press tab means next  row will be editable.for making that i added the following code.i have  some error shows like this
        [Bindable]
                    private var tasks:ArrayCollection;
                    private static const ADD_TASK:int= "";
                    private function init():void
                        tasks = new ArrayCollection();
                        tasks.addItem(new Task(0.01,100000,0));
                        tasks.addItem({frmAmount:ADD_TASK});
                    private function checkEdit(e:DataGridEvent):void
                        // Do not allow editing of Add Task row except for
                        // "Click to Add" column
                        if(e.rowIndex == tasks.length - 1 && e.columnIndex != 0)
                            e.preventDefault();
            private function editEnd(e:DataGridEvent):void
                    // Adding a new task
                    if(e.rowIndex == tasks.length - 1)
                    var txtIn:TextInput =TextInput(e.currentTarget.itemEditorInstance);
                    var dt:Object = e.itemRenderer.data;
                    // Add new task
                    if(parseInt(txtIn.text) != ADD_TASK)
                        tasks.addItemAt(new Task(parseInt(txtIn.text), 0, ""), e.rowIndex);----->Multiple markers at this line:
                                                                                                                             -1067: Implicit coercion of a value of type String to an unrelated type int.
                                                                                                                                -txtIn
                    // Destroy item editor
                    commPlanDetGrid.destroyItemEditor();
                        // Stop default behavior
                    e.preventDefault();
            ]]>
    Please help if any suggession
    Thanks in advance
    B.Venkatesan

    The error message indicates the problem fairly clearly.  _feed_list is defined as a ComboBox in your first line of code.  You are passing that as an argument in your populate(_feed_list) line of code.  However, the populate function is expecting an XMLList object to be passed, not a ComboBox.
    You probably really mean to be using...
              populate(feed_items);
    since that is the only XMLList to be found

  • Adding a Tree into a datagrid column

    I have a requirement where I have to create a datagrid with
    one of the columns having a tree control. The problem I am trying
    to resolve is how to dynamically change the height of the datagrid
    column which has the tree when the tree is collapsed and
    dynamically increase the datagrid column height when the tree is
    expanded.
    Is is feasible ? Am I chasing a wild dream ?
    Any help will be greatly appreciated...
    Thanks

    Darin,
    Thank you for responding. I was able to get a tree display in
    a datagrid. I am going to attach all the code.
    The problem I am facing is, I need two clicks to expand a
    tree in the datagrid column so that both the tree to expand and the
    datagrid column to adjust its height. Let me know why this is so.
    May be, being a newbie, I am completely off the track here. Thanks
    in advance.
    THE MXML
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" xmlns:ns1="com.ram.flash.custom.*">
    <mx:XML id="xmlData" source="myDataWithTree.xml"/>
    <mx:HBox>
    <mx:DataGrid id="dgSource"
    dataProvider="{xmlData.person}" editable="false"
    variableRowHeight="true">
    <mx:columns>
    <mx:Array>
    <mx:DataGridColumn editable="false" sortable="false"
    resizable="true" width="400" textAlign="left" headerText="Id"
    dataField="address">
    <mx:itemRenderer>
    <mx:Component>
    <ns1:PruDataGridTreeColumn
    disclosureOpenIcon="@Embed(source='icn_minus.jpg')"
    disclosureClosedIcon="@Embed(source='icn_plus.jpg')" width="260"
    height="20" />
    </mx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    <mx:DataGridColumn headerText="Name" dataField="name"
    editable="false"/>
    <mx:DataGridColumn headerText="Age" dataField="age"
    editable="false"/>
    </mx:Array>
    </mx:columns>
    </mx:DataGrid>
    </mx:HBox>
    </mx:Application>
    THE DATA
    <?xml version="1.0" encoding="UTF-8" ?>
    <data>
    <person>
    <name>Mister</name>
    <age>36</age>
    <address>
    <Capitals label="U.S. State Capitals">
    <capital label="AL" value="Montgomery"/>
    <capital label="AK" value="Juneau"/>
    <capital label="AR" value="Little Rock"/>
    <capital label="AZ" value="Phoenix"/>
    <capital label="AL" value="Montgomery"/>
    <capital label="AK" value="Juneau"/>
    <capital label="AR" value="Little Rock"/>
    <capital label="AZ" value="Phoenix"/>
    <capital label="AL" value="Montgomery"/>
    <capital label="AK" value="Juneau"/>
    <capital label="AR" value="Little Rock"/>
    <capital label="AZ" value="Phoenix"/>
    </Capitals>
    </address>
    </person><person>
    <name>Missus</name>
    <age>28</age>
    <address>
    <Capitals label="Indian State Capitals">
    <capital label="AL" value="Montgomery"/>
    <capital label="AK" value="Juneau"/>
    <capital label="AR" value="Little Rock"/>
    <capital label="AZ" value="Phoenix"/>
    </Capitals>
    </address>
    </person>
    </data>
    THE CUSTOM ACTIONSCRIPT CLASS
    package com.ram.flash.custom
    import flash.geom.Rectangle;
    import mx.core.IDataRenderer;
    import mx.controls.listClasses.IListItemRenderer;
    import flash.display.DisplayObjectContainer;
    import flash.events.Event;
    import mx.managers.ISystemManager;
    import mx.controls.Tree;
    import flash.display.Sprite;
    import flash.display.DisplayObject;
    import mx.events.FlexEvent;
    import mx.collections.XMLListCollection;
    import flash.events.MouseEvent;
    import mx.controls.treeClasses.TreeItemRenderer;
    import mx.controls.treeClasses.TreeListData;
    import mx.core.ClassFactory;
    import mx.events.ScrollEvent;
    import mx.controls.DataGrid;
    import mx.events.CollectionEvent;
    import mx.events.CollectionEventKind;
    public class PruDataGridTreeColumn extends Tree implements
    IListItemRenderer, IDataRenderer
    private var _data : Object = null;
    private var _dataGrid:DataGrid = null;
    [Bindable("dataChange")]
    public override function get data():Object
    return _data;
    public function set myDataGrid(value:DataGrid):void
    _dataGrid = value;
    public function PruDataGridTreeColumn()
    super();
    public override function set data(value:Object):void
    this._data = value;
    this.invalidateProperties();
    var xmlDATA:XMLList = new XMLList(_data);
    this.labelField='@label';
    this.dataProvider = xmlDATA.address.Capitals;
    dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
    override public function expandItem(item:Object,
    open:Boolean, animate:Boolean=false, dispatchEvent:Boolean=false,
    cause:Event=null):void
    animate = true;
    super.expandItem(item,open,animate,dispatchEvent,cause);
    var lc:XML = new XML(item);
    var ht:Number = 20;
    var wt:Number = this.width;
    if(open)
    ht = (lc.children().length() * 20 + 40);
    this.height = (lc.children().length() * 20 + 40);
    else
    ht = 20;
    this.height = 20;
    }

  • Adding a mask to a moving still?

    I want to add a mask to a moving still picture -- the mask following the picture exactly (I want to highlight a particular form in the picture by making a semi-opaque mask around the non-essential part).
    I can make a mask easily enough, but I can't remember how to get it to track with the picture...
    Ben

    hi,
    not sure what was happening with your project, sometimes strange things do happen, but this is the expected way it works:
    add a mask to an image and animate the image and the mask will move around as well. So if you masked an image to show only a man's face, and then moved the image around you would always only see the face.
    Of course you can also animate the mask itself. so you could have a mask that moved around an image and revealed different parts as it moves. And you can animate both picture and mask at the same time.
    Now add some animation to the layer containing the image and you can get yourself into a right mess!
    hth
    adam

  • Adding vector mask as guide layer?

    I have a template that uses a vector mask as one of the layers to line up images. What I need to do is have the vector mask serve as a guide layer so when I go to export it does not appear on export. Is this possible?

    No its not. You can Action or script a deleting of your "Guide" layer before you export or Save the file. Probably your best option 

  • Problem Adding Usable Layer Mask

    I keep trying to add a reveal-all layer mask to an image,(with another image on a layer below) but can't seem to produce a mask that I can paint on to reveal the image below.  When I click the add mask icon or go to layer add a mask, I see a layer mask icon next to the image, but it is still a rectangle with a white circle in it, not an all white framed rectangle. And painting on the original image produces no effect at all on the mask. Every video tutorial I watch, adding the mask produces an all-white mask icon in the layers panel and selecting that allows for easy painting to hide or reveal.  I just can't figure out what's going on and it's driving me nuts, so any help would be greatly appreciated.

    Hello Jow333!
    I've put together this little map that might help you better understand layer masks!
    1. Add a layer mask to the layer you want to mask out and reveal the background beneath.
    2. Make sure that the Mask is selected
    3. Grab the Paint Brush tool
    4. Choose the color Black
    Then you should be able to paint right onto the layer!
    Hope this helps!
    Julia

  • Ever since I installed Snow Leopard (10.6.8), masking in QuickTime 7Pro has stopped working.  Has anybody experienced this?  Is there a work around?  Can I use FCP to add masks to video?

    Ever since I installed Snow Leopard (10.6.8) a month ago, the masking function in QuickTime 7Pro (v. 7.6.6) stopped working.  Masks disappeared in old videos where I had previously and successfully added a mask, and I could not longer use QT 7Pro to add a mask to a new video.  When I installed Snow Leopard I also installed QT X, but I found QT 7Pro in the Utilities folder, so it is still there but the masking function is definately not working.
    Has anybody else experienced this?
    Is there a remedy so I can recover my older masked videos, and make new masked videos?
    Can I make masked videos in Final Cut Pro?
    Thanks!

    Ever since I installed Snow Leopard (10.6.8) a month ago, the masking function in QuickTime 7Pro (v. 7.6.6) stopped working.  Masks disappeared in old videos where I had previously and successfully added a mask, and I could not longer use QT 7Pro to add a mask to a new video.  When I installed Snow Leopard I also installed QT X, but I found QT 7Pro in the Utilities folder, so it is still there but the masking function is definately not working.
    Has anybody else experienced this?
    Is there a remedy so I can recover my older masked videos, and make new masked videos?
    Can I make masked videos in Final Cut Pro?
    Thanks!

  • Help with Photoshop CS2 files MUCH larger than normal, possibly not compessing layer masks

    Has anyone else come across a problem where Photoshop files grow in size much faster than expected, especially when adding layer masks?
    Normally when you add a layer mask the file size grow a small amount if the layer mask is mostly all white or mostly all black. In this case it's like the file size is growing exponentially, almost as if the layer mask isn't being compressed at all.
    The file in question although large, is similar dimensions, resolution, and number of layers as other projects that have been worked on and all the usual thing have been checked like resolution, colour mode, bit depth and the image has also been cropped so there's nothing outside of the page.
    The file has been checked on 2 different macs and exhibits the same behaviour and Photoshop preferences have been deleted and re-created and we've tried copying the file by dragging layers to a new document of the same dimensions with no success.
    The only things we're certain of is that file size grows dramatically when adding layer masks in particular and layers in general.
    The file was created by someone else, if that might be a factor, though the file has been "saved as.." with no improvement.
    Any ideas?
    TIA
    Tom
    The only

    Maybe it has something to do with "Maximize Compatibility". If that's checked when you save, it might add a lot of weight to your file, even with just a simple layer mask. Don't know, haven't done any testing, just a thought.
    Edit: Just did a quick test:
    1. flat image saved as PSD = 5.2 MB
    2. same image converted to a layer with simple layer mask, saved as PSD = 5.8 MB
    3. same layer mask image saved WITH "maximize compatibility" = 10.7 MB
    So adding "maximize compatibility" nearly doubled this test file. Could be it?

  • What's the right way to add a swipe handler to a DataGrid?

    H All:
    What’s the right way to add a swipe handler to a DataGrid?
    (Target = Android, AIR using Flash IDE)
    Adding a handler to the DataGrid works; but (as expected) it only works on  the datagrid itself. Like if you swipe on the background before rows are fully  added. Adding columns over the datagrid, prevents the datagrids’ swipe handler  from firing.
    Trying to add a swipe hander to the columns themselves, results in the  below error.
    //  Below code fails with
    //  1061: Call to a possibly undefined method addEventListener through a reference with static type
    //   fl.controls.dataGridClasses:DataGridColumn.  So ... DataGridColumn doesn’t support addEventListener...
    There must be a better way(?).
    Thanks
                import fl.controls.DataGrid;
                import fl.controls.dataGridClasses.DataGridColumn;
               // Works, but only on the grid itself; as when the rows do not  fill the space tor the datagrid.
                myDataGrid.addEventListener  (TransformGestureEvent.GESTURE_SWIPE, swipeGridHandler);
                var c1:DataGridColumn = new DataGridColumn("Notes"); 
                c1.width = 90;
                c1.cellRenderer = CenterAlignCell;
                c1.addEventListener (TransformGestureEvent.GESTURE_SWIPE,  swipeGridHandler);

    Adobe list of properties and methods:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/dataGridCla sses/DataGridColumn.html

  • Why doesn't Photoshop always generate a layer mask

    I believe it was in CS4 that Adobe expanded the use of automatic layer masks ... perhaps it was with adjustment layers (I'm not quite sure)
    I don't know about others, but it would save me considerable time in the long run if every new layer, (whether it is generated as a copy, from a plug-in, as a cut, or as a new blank layer) recevied an automatic layer mask. It takes no file space, but more often than not I find myself needing one. It sure would be nice to jump right into masking rather than having to first create the layer mask. Why did they stop at adjustment layers?
    Am I alone in this?
    thanks

    Adding layers like Text, Raster and smart objects never have had automatic layers mask added.  Adding adjustment layers always came with an automatic layer mask until CS4.  Adode introduced bugs in CS4 when they added the adjustment panel these bugs have been carried forward into CS5 and CS6. Adobe added two options in the adjustment panels fly-out panel.  These options are designed to be global, not just adjustment panel options.  These options only work sometimes when changed from their default settings.  When changed from their default settings they try to change Photoshop historic default operation.  When you change Photoshop default operation Action, Scripts and Plug-ins that add adjustment layers may not work correctly.  Adobe should fix Photoshop and remove the two bad Adjustment Panel fly-out options. The Adjustment Panel fly-out menu option to not add Layer masks can not be safely set, same goes for the option to always clip added layer mask, if you use Actions, Scripts and Plug-ins that add adjustment layers.

Maybe you are looking for