A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: styling a combo box.

  1. #1
    Senior Member
    Join Date
    Sep 2006
    Posts
    125

    styling a combo box.

    Hi

    I have an instance on the stage of a combo box called cb1 I want to alter the formatting of it. I have gone into the library and copied the ComboBox_upSkin mc and called it upSkinBlue, set its class to upSkinBlue, exported it for action script.

    Here's my complete action script:

    Code:
    import fl.controls.ComboBox;
    cb1.setStyle("upSkin","upSkinBlue");
    cb1.addItem({label:"Apples"});
    cb1.addItem({label:"Oranges"});
    cb1.addItem({label:"Banana"});
    cb2.addItem({label:"Spinach"});
    cb2.addItem({label:"Salad"});
    cb2.addItem({label:"Cucumber"});
    When I run I get
    Code:
    TypeError: Error #2007: Parameter child must be non-null.
    	at flash.display::DisplayObjectContainer/addChildAt()
    	at fl.controls::BaseButton/drawBackground()
    	at fl.controls::BaseButton/draw()
    	at fl.core::UIComponent/drawNow()
    	at fl.controls::ComboBox/drawLayout()
    	at fl.controls::ComboBox/draw()
    	at fl.core::UIComponent/callLaterDispatcher()
    I guess I am doing something wrong, but can't work out what. If you're interested I a using a tutorial here - scroll down to "Changing AS3 component styles with AS.

    Any pointers very greatfully received

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Are you sure you did not delete the button? You would get such error message. Click on the combobox on the stage and check it.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Senior Member
    Join Date
    Sep 2006
    Posts
    125
    Hi

    Thanks for the reply. I checked, and it looks like the button is still there.

    Also, if I comment out the line thus:

    Code:
    //cb1.setStyle("upSkin","upSkinBlue");
    the drop down works fine.
    I have put an image in of my library and symbol properties in case I have missed something there.

    Thanks again

    E
    Attached Images Attached Images

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I am not sure what the problem is, so I have included a fla at the end of the blog, which you can download:

    http://flashscript.biz/flblogger/?cat=5
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Senior Member
    Join Date
    Sep 2006
    Posts
    125
    thanks for the reply

    Downloaded your fla and made my own using yours - works now

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