dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Masking ComboBox component

  1. #1
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90

    Question Masking ComboBox component

    Hi,

    I have a problem masking ComboBox component. I am using following code:

    Code:
    import fl.controls.ComboBox;
    
    var cb:ComboBox = new ComboBox();
    cb.addItem({data:1, label:"One"});
    cb.addItem({data:2, label:"Two"});
    cb.addItem({data:3, label:"Three"});
    cb.addItem({data:4, label:"Four"});
    addChild(cb);
    
    var masker:Sprite = new Sprite();
    masker.graphics.beginFill(0xFFFFFF);
    masker.graphics.drawRect(0,0,cb.width,cb.height);
    masker.graphics.endFill();
    addChild(masker);
    
    cb.mask = masker;
    And ComboBox is masked fine (as test i used masker which is half height and width of the combobox and then only half of combobox was displayed) until i click on it, then whole ComboBox opens just as if it isn't masked. It looks like it breaks the masking thing :/ Did anyone have similar problems or maybe know what am i doing wrong?

    thanks,
    best regards

  2. #2
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90
    Like it usually happens, i figured it out soon after positng problem In case someone else have the same problem, you should mask not the combo box instance but it's dropdown property so last line in my example should be:

    Code:
    cb.dropdown.mask = masker;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center