• FLASH组件样式修改 [返回文章列表]     发表于: 2007-8-3  675人(次)浏览
  • 自己经常碰见这样的麻烦,所以想了个办法,正好经典有人问到,就在上面解答了,自己顺便帖回来,增加文章数,呵呵!

    如果你不知道一个组件里有些什么方法或属性
    你就把他trace()出来
    然后再尝试
    比如这个ComboBox
    在 场景里拉个ComboBox
    取个名字 box
    for(dd in box){
     trace(dd)
    }

    结果就出来了:
    drawRoundRect
    embedFonts
    textDecoration
    fontSize
    marginRight
    marginLeft
    fontStyle
    textIndent
    fontFamily
    fontWeight
    textAlign
    dispatchQueue
    dispatchEvent
    removeEventListener
    __origAddEventListener
    addEventListener
    adjustFocusRect
    dropDownBorderStyle
    wrapDownArrowButton
    downArrowDisabledName
    downArrowOverName
    downArrowDownName
    downArrowUpName
    drawFocus
    rollOverColor
    getValue
    childrenCreated
    initializing
    selected
    __dropdownWidth
    lastSelected
    focusTextField
    __border
    stylecache
    data
    def_data
    __height
    __width
    _minWidth
    _minHeight
    enabled
    __rowCount
    onEnterFrame
    invalidateFlag
    invUpdateControl
    __dataProvider
    __labels
    tabChildren
    tabEnabled
    _editable
    downArrow_mc
    text_mc
    border_mc
    boundingBox_mc
    //===================
    然后就可以变量的名字去尝试了
    比如
    四楼是这样写的:
    my_cd.setStyle("rollOverColor",0x0099ff);//这个设置鼠标滑过时的颜色.....
    my_cd.setStyle("selectionColor",0x00ccff);//这个设置鼠标选中时的颜色......

    假设我不知道,那我就会这样写:
    my_cd.selectionColor="0xcccccc"
    测试得到结果 这样写是可以的

    希望大家可以举一反三 呵呵

FLASH组件样式修改 [返回文章列表]