FWDٷgہpactions sur fcb_background_pressed: Image 1 du calque READMEvar component = _parent._parent; //::: don't delete the above //::: SKIN ELEMENT REGISTRATION /* To add styleFormat properties to your skins : 1) Break up your skin into individual movie clips (skinElements) 2) add a registerSkinElement line of code for each skinElement component.registerSkinElement(skinElement, propertyName) // makes the skinElement Listen to the propertyName specified (eg: "background") n*/ component.registerSkinElement(background_mc, "backgroundDisabled"); pp }actions sur FUIComponent: Image 1 (Etiqueté Symbol_36) du calque Actions: Class#initclip 0 /*============= FUIComponentClass The base class for all FUI controls in flash6. ==============*/ function FUIComponentClass() { this.init(); } FUIComponentClass.prototype = new MovieClip(); FUIComponentClass.prototype.init = function() { this.enable = true; this.focused = false; this.useHandCursor = false; //accessibility :: hide non accessible components from screen reader this._accImpl = new Object(); this._accImpl.stub = true; this.styleTable = new Array(); if (_global.globalStyleFormat==undefined) { _global.globalStyleFormat = new FStyleFormat(); globalStyleFormat.isGlobal = true; _global._focusControl = new Object(); _global._focusControl.onSetFocus = function(oldFocus, newFocus) { oldFocus.myOnKillFocus(); newFocus.myOnSetFocus(); } Selection.addListener(_global._focusControl); } if (this._name!=undefined) { this._focusrect = false; this.tabEnabled = true; this.focusEnabled = true; this.tabChildren = false; this.tabFocused = true; if (this.hostStyle==undefined) { globalStyleFormat.addListener(this); } else { this.styleTable = this.hostStyle; } this.deadPreview._visible = false; this.deadPreview._width = this.deadPreview._height = 1; this.methodTable = new Object(); this.keyListener = new Object(); this.keyListener.controller = this; this.keyListener.onKeyDown = function() { this.controller.myOnKeyDown(); } this.keyListener.onKeyUp = function() { this.controller.myOnKeyUp(); } for (var i in this.styleFormat_prm) { this.setStyleProperty(i, this.styleFormat_prm[i]); } } } // ::: PUBLIC METHODS FUIComponentClass.prototype.setEnabled = function(enabledFlag) { this.enable = (arguments.length>0) ? enabledFlag : true; this.tabEnabled = this.focusEnabled = enabledFlag; if (!this.enable && this.focused) { Selection.setFocus(undefined); } } FUIComponentClass.prototype.getEnabled = function() { return this.enable; } FUIComponentClass.prototype.setSize = function(w, h) { this.width = w; this.height = h; this.focusRect.removeMovieClip(); } FUIComponentClass.prototype.setChangeHandler = function(chng,obj) { this.handlerObj = (obj==undefined) ? this._parent : obj; this.changeHandler = chng; } // ::: PRIVATE METHODS FUIComponentClass.prototype.invalidate = function(methodName) { this.methodTable[methodName] = true; this.onEnterFrame = this.cleanUI; } FUIComponentClass.prototype.cleanUI = function() { // rules of invalidation : setSize beats everyone else if (this.methodTable.setSize) { this.setSize(this.width, this.height); } else { this.cleanUINotSize(); } this.methodTable = new Object(); delete this.onEnterFrame; } // EXTEND this method to add new invalidation rules. FUIComponentClass.prototype.cleanUINotSize = function() { for (var funct in this.methodTable) { this[funct](); } } FUIComponentClass.prototype.drawRect = function(x, y, w, h) { var inner = this.styleTable.focusRectInner.value; var outer = this.styleTable.focusRectOuter.value; if (inner==undefined) { inner = 0xffffff; } if (outer==undefined) { outer = 0x000000; } this.createEmptyMovieClip( "focusRect", 1000 ); // this.focusRect._alpha = 50; // uncomment out this line if you want focus rect with alpha this.focusRect.controller = this; this.focusRect.lineStyle(1, outer); this.focusRect.moveTo(x, y); this.focusRect.lineTo(x+w, y); this.focusRect.lineTo(x+w, y+h); this.focusRect.lineTo(x, y+h); this.focusRect.lineTo(x, y); this.focusRect.lineStyle(1, inner); this.focusRect.moveTo(x+1, y+1); this.focusRect.lineTo(x+w-1, y+1); this.focusRect.lineTo(x+w-1, y+h-1); this.focusRect.lineTo(x+1, y+h-1); this.focusRect.lineTo(x+1, y+1); } FUIComponentClass.prototype.pressFocus = function() { this.tabFocused = false; this.focusRect.removeMovieClip(); Selection.setFocus(this); } // OVERWRITE THIS METHOD FOR YOUR OWN RECTANGLES FUIComponentClass.prototype.drawFocusRect = function() { this.drawRect(-2, -2, this.width+4, this.height+4); } FUIComponentClass.prototype.myOnSetFocus = function() { this.focused =true; Key.addListener(this.keyListener); if (this.tabFocused) { this.drawFocusRect(); } } FUIComponentClass.prototype.myOnKillFocus = function() { this.tabFocused = true; this.focused =false; this.focusRect.removeMovieClip(); Key.removeListener(this.keyListener); } FUIComponentClass.prototype.executeCallBack = function() { this.handlerObj[this.changeHandler](this); } // An FUIComponentClass Helper for the styleFormat : // puts a styleFormat value into the component's styleTable, // updates the component (the coloredMCs that make up a skin) FUIComponentClass.prototype.updateStyleProperty = function(styleFormat, propName) { this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal); } FUIComponentClass.prototype.setStyleProperty = function(propName, value, isGlobal) { if (value=="") return; var tmpValue = parseInt(value); if (!isNaN(tmpValue)) { value = tmpValue; } var global = (arguments.length>2) ? isGlobal : false; if (this.styleTable[propName]==undefined) { this.styleTable[propName] = new Object(); this.styleTable[propName].useGlobal=true; } if (this.styleTable[propName].useGlobal || !global) { this.styleTable[propName].value = value; if (this.setCustomStyleProperty(propName, value)) { // a hook for extending further styleProperty reactions. } else if (propName == "embedFonts") { this.invalidate("setSize"); } else if (propName.subString(0,4)=="text") { if (this.textStyle==undefined) { this.textStyle = new TextFormat(); } var textProp = propName.subString(4, propName.length); this.textStyle[textProp] = value; this.invalidate("setSize"); } else { for (var j in this.styleTable[propName].coloredMCs) { var myColor = new Color(this.styleTable[propName].coloredMCs[j]); if (this.styleTable[propName].value==undefined) { var myTObj = { ra: '100', rb: '0', ga: '100', gb: '0', ba: '100', bb: '0', aa: '100', ab: '0'}; myColor.setTransform(myTObj); } else { myColor.setRGB(value); } } } this.styleTable[propName].useGlobal = global; } } /* Another styleFormat helper -- / A skin mc calls up to this to register its existence and the / styleTable property it wants to listen to */ FUIComponentClass.prototype.registerSkinElement = function(skinMCRef, propName) { if (this.styleTable[propName]==undefined) { this.styleTable[propName] = new Object(); this.styleTable[propName].useGlobal = true; } if (this.styleTable[propName].coloredMCs==undefined) { this.styleTable[propName].coloredMCs = new Object(); } this.styleTable[propName].coloredMCs[skinMCRef]=skinMCRef; if (this.styleTable[propName].value!=undefined) { var myColor = new Color(skinMCRef); myColor.setRGB(this.styleTable[propName].value); } } // ============ styleFormat Class =========== // _global.FStyleFormat = function() { this.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true}; this.listeners = new Object(); this.isGlobal = false; if (arguments.length>0) { for (var i in arguments[0]) { this[i] = arguments[0][i]; } } } _global.FStyleFormat.prototype = new Object(); // ::: PUBLIC FStyleFormat Methods FStyleFormat.prototype.addListener = function() { for (var arg=0; arg0) { for (var j=0; j4}d4}4}4}4}4}4}5}5}#5}E5}]5}5}5}5}6}>6}e6}6}6}7}N7}7}7}7}7}8}-8}F8}8}8}8}8}8} 9}&9}79}H9}g9}9}9}9}9}.:}_:}q:}v:}:}:}:}:};}*;}H;}u;};};};};};}$<};<}Y<}<}<}<}<}&=}J=}=}=}=} >}5>}S>}x>}>}>}>} ?} 0?} J?}y?}?}?}@}@}5@}b@}@}#@}%@}&@}' A}(*A})JA}*jA}0A}2A}3A}4B}5/B}6[B}7yB}8B}>B}@B}AB}B#C}C0) ? enabledFlag : true; this.tabEnabled = this.focusEnabled = enabledFlag; if (!this.enable && this.focused) { Selection.setFocus(undefined); } } FUIComponentClass.prototype.getEnabled = function() { return this.enable; } FUIComponentClass.prototype.setSize = function(w, h) { this.width = w; this.height = h; this.focusRect.removeMovieClip(); } FUIComponentClass.prototype.setChangeHandler = function(chng,obj) { this.handlerObj = (obj==undefined) ? this._parent : obj; this.changeHandler = chng; } // ::: PRIVATE METHODS FUIComponentClass.prototype.invalidate = function(methodName) { this.methodTable[methodName] = true; this.onEnterFrame = this.cleanUI; } FUIComponentClass.prototype.cleanUI = function() { // rules of invalidation : setSize beats everyone else if (this.methodTable.setSize) { this.setSize(this.width, this.height); } else { this.cleanUINotSize(); } this.methodTable = new Object(); delete this.onEnterFrame; } // EXTEND this method to add new invalidation rules. FUIComponentClass.prototype.cleanUINotSize = function() { for (var funct in this.methodTable) { this[funct](); } } FUIComponentClass.prototype.drawRect = function(x, y, w, h) { var inner = this.styleTable.focusRectInner.value; var outer = this.styleTable.focusRectOuter.value; if (inner==undefined) { inner = 0xffffff; } if (outer==undefined) { outer = 0x000000; } this.createEmptyMovieClip( "focusRect", 1000 ); // this.focusRect._alpha = 50; // uncomment out this line if you want focus rect with alpha this.focusRect.controller = this; this.focusRect.lineStyle(1, outer); this.focusRect.moveTo(x, y); this.focusRect.lineTo(x+w, y); this.focusRect.lineTo(x+w, y+h); this.focusRect.lineTo(x, y+h); this.focusRect.lineTo(x, y); this.focusRect.lineStyle(1, inner); this.focusRect.moveTo(x+1, y+1); this.focusRect.lineTo(x+w-1, y+1); this.focusRect.lineTo(x+w-1, y+h-1); this.focusRect.lineTo(x+1, y+h-1); this.focusRect.lineTo(x+1, y+1); } FUIComponentClass.prototype.pressFocus = function() { this.tabFocused = false; this.focusRect.removeMovieClip(); Selection.setFocus(this); } // OVERWRITE THIS METHOD FOR YOUR OWN RECTANGLES FUIComponentClass.prototype.drawFocusRect = function() { this.drawRect(-2, -2, this.width+4, this.height+4); } FUIComponentClass.prototype.myOnSetFocus = function() { this.focused =true; Key.addListener(this.keyListener); if (this.tabFocused) { this.drawFocusRect(); } } FUIComponentClass.prototype.myOnKillFocus = function() { this.tabFocused = true; this.focused =false; this.focusRect.removeMovieClip(); Key.removeListener(this.keyListener); } FUIComponentClass.prototype.executeCallBack = function() { this.handlerObj[this.changeHandler](this); } // An FUIComponentClass Helper for the styleFormat : // puts a styleFormat value into the component's styleTable, // updates the component (the coloredMCs that make up a skin) FUIComponentClass.prototype.updateStyleProperty = function(styleFormat, propName) { this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal); } FUIComponentClass.prototype.setStyleProperty = function(propName, value, isGlobal) { if (value=="") return; var tmpValue = parseInt(value); if (!isNaN(tmpValue)) { value = tmpValue; } var global = (arguments.length>2) ? isGlobal : false; if (this.styleTable[propName]==undefined) { this.styleTable[propName] = new Object(); this.styleTable[propName].useGlobal=true; } if (this.styleTable[propName].useGlobal || !global) { this.styleTable[propName].value = value; if (this.setCustomStyleProperty(propName, value)) { // a hook for extending further styleProperty reactions. } else if (propName == "embedFonts") { this.invalidate("setSize"); } else if (propName.subString(0,4)=="text") { if (this.textStyle==undefined) { this.textStyle = new TextFormat(); } var textProp = propName.subString(4, propName.length); this.textStyle[textProp] = value; this.invalidate("setSize"); } else { for (var j in this.styleTable[propName].coloredMCs) { var myColor = new Color(this.styleTable[propName].coloredMCs[j]); if (this.styleTable[propName].value==undefined) { var myTObj = { ra: '100', rb: '0', ga: '100', gb: '0', ba: '100', bb: '0', aa: '100', ab: '0'}; myColor.setTransform(myTObj); } else { myColor.setRGB(value); } } } this.styleTable[propName].useGlobal = global; } } /* Another styleFormat helper -- / A skin mc calls up to this to register its existence and the / styleTable property it wants to listen to */ FUIComponentClass.prototype.registerSkinElement = function(skinMCRef, propName) { if (this.styleTable[propName]==undefined) { this.styleTable[propName] = new Object(); this.styleTable[propName].useGlobal = true; } if (this.styleTable[propName].coloredMCs==undefined) { this.styleTable[propName].coloredMCs = new Object(); } this.styleTable[propName].coloredMCs[skinMCRef]=skinMCRef; if (this.styleTable[propName].value!=undefined) { var myColor = new Color(skinMCRef); myColor.setRGB(this.styleTable[propName].value); } } // ============ styleFormat Class =========== // _global.FStyleFormat = function() { this.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true}; this.listeners = new Object(); this.isGlobal = false; if (arguments.length>0) { for (var i in arguments[0]) { this[i] = arguments[0][i]; } } } _global.FStyleFormat.prototype = new Object(); // ::: PUBLIC FStyleFormat Methods FStyleFormat.prototype.addListener = function() { for (var arg=0; arg0) { for (var j=0; j this.width){ w = 0; } else { w = this.width - frame._width; } this.fLabel_mc.setSize(w); if (pos == "right" || pos == undefined){ this.labelPlacement = "right"; this.fcb_states_mc._x = 0; this.fLabel_mc._x = checkWidth; this.txtFormat("left"); } else if (pos == "left"){ this.labelPlacement = "left"; this.fLabel_mc._x = 0; this.fcb_states_mc._x = this.width - checkWidth; this.txtFormat("right"); } this.fLabel_mc._y = vertCenter; this.fcb_hitArea_mc._y = vertCenter; } FCheckBoxClass.prototype.txtFormat = function( pos ) { var txtS = this.textStyle; var sTbl = this.styleTable; txtS.align = (sTbl.textAlign.value == undefined) ? txtS.align = pos : undefined; txtS.leftMargin = (sTbl.textLeftMargin.value == undefined) ? txtS.leftMargin = 0 : undefined; txtS.rightMargin = (sTbl.textRightMargin.value == undefined) ? txtS.rightMargin = 0 : undefined if(this.flabel_mc._height > this.height){ super.setSize(this.width,this.flabel_mc._height); }else{ super.setSize(this.width,this.height); } this.fLabel_mc.labelField.setTextFormat(this.textStyle); this.setEnabled(this.enable) } FCheckBoxClass.prototype.setHitArea = function(w,h) { var hit = this.fcb_hitArea_mc; this.hitArea = hit; if ( this.fcb_states_mc._width > w ){ hit._width = this.fcb_states_mc._width; }else{ hit._width = w; } hit._visible = false; if(arguments.length > 1){ hit._height = h; } } FCheckBoxClass.prototype.setSize = function(w) { this.setLabel(this.getLabel()); this.setLabelPlacement(this.labelPlacement); if(this.fcb_states_mc._height < this.flabel_mc.labelField._height){ super.setSize(w,this.flabel_mc.labelField._height); } this.setHitArea(this.width,this.height); this.setLabelPlacement(this.labelPlacement); } FCheckBoxClass.prototype.drawFocusRect = function() { this.drawRect(-2, -2, this._width+6, this._height-1); } FCheckBoxClass.prototype.onPress = function() { this.pressFocus(); _root.focusRect.removeMovieClip(); var states = this.fcb_states_mc; if (this.getValue()) { states.gotoAndStop( "checkedPress" ); } else { states.gotoAndStop( "press" ); } } FCheckBoxClass.prototype.onRelease = function() { this.fcb_states_mc.gotoAndStop( "up" ); this.setValue(!( this.checked )); } FCheckBoxClass.prototype.onReleaseOutside = function() { var states = this.fcb_states_mc; if (this.getValue()) { states.gotoAndStop( "checkedEnabled" ); } else { states.gotoAndStop("up"); } } FCheckBoxClass.prototype.onDragOut = function() { var states = this.fcb_states_mc; if (this.getValue()) { states.gotoAndStop( "checkedEnabled" ); } else { states.gotoAndStop("up"); } } FCheckBoxClass.prototype.onDragOver = function() { var states = this.fcb_states_mc; if (this.getValue()) { states.gotoAndStop( "checkedPress" ); } else { states.gotoAndStop("press"); } } FCheckBoxClass.prototype.setValue = function( checkedValue ) { if ( checkedValue || checkedValue == undefined) { this.setCheckState( checkedValue ); } else if (checkedValue == false){ this.setCheckState( checkedValue ); } this.executeCallBack(); if(Accessibility.isActive()){ Accessibility.sendEvent( this, 0, this.EVENT_OBJECT_STATECHANGE,true ); } } FCheckBoxClass.prototype.setCheckState = function( checkedValue ) { var states = this.fcb_states_mc; if ( this.enable ) { this.flabel_mc.setEnabled(true); if ( checkedValue || checkedValue == undefined) { states.gotoAndStop( "checkedEnabled" ); this.enabled = true; this.checked = true; } else { states.gotoAndStop("up"); this.enabled = true; this.checked = false; } } else { this.flabel_mc.setEnabled(false); if ( checkedValue || checkedValue == undefined) { states.gotoAndStop( "checkedDisabled" ); this.enabled = false; this.checked = true; } else { states.gotoAndStop( "uncheckedDisabled" ); this.enabled = false; this.checked = false; this.focusRect.removeMovieClip() } } } FCheckBoxClass.prototype.getValue = function() { return (this.checked); } FCheckBoxClass.prototype.setEnabled = function( enable ) { if(enable == true || enable == undefined){ this.enable = true; Super.setEnabled(true); } else { this.enable = false; Super.setEnabled(false); } this.setCheckState(this.checked); } FCheckBoxClass.prototype.getEnabled = function() { return(this.enable); } FCheckBoxClass.prototype.setLabel = function( label ) { this.fLabel_mc.setLabel(label); this.txtFormat(); // ACCESSIBILITY if(Accessibility.isActive()){ Accessibility.sendEvent( this, 0, this.EVENT_OBJECT_NAMECHANGE ); } } FCheckBoxClass.prototype.getLabel = function() { return (this.fLabel_mc.labelField.text); } FCheckBoxClass.prototype.setTextColor = function( color ) { this.fLabel_mc.labelField.textColor = color; } FCheckBoxClass.prototype.myOnKeyDown = function( ) { if (Key.getCode() == Key.SPACE && this.pressOnce == undefined && this.enabled == true) { this.setValue(!this.getValue()); this.pressOnce = true; } } FCheckBoxClass.prototype.myOnKeyUp = function( ) { if (Key.getCode() == Key.SPACE) { this.pressOnce = undefined; } } // START ACCESSIBILITY METHODS FCheckBoxClass.prototype.get_accRole = function(childId) { return this.master.ROLE_SYSTEM_CHECKBUTTON; } FCheckBoxClass.prototype.get_accName = function(childId) { return this.master.getLabel(); } FCheckBoxClass.prototype.get_accState = function(childId) { if (this.master.getValue()) { return this.master.STATE_SYSTEM_CHECKED; }else{ return 0; } } FCheckBoxClass.prototype.get_accDefaultAction = function(childId) { if ( this.master.getValue() ){ return "UnCheck"; }else{ return "Check"; } } FCheckBoxClass.prototype.accDoDefaultAction = function(childId) { this.master.setValue( !this.master.getValue() ); } // END ACCESSIBILITY METHODS ::mr:: #endinitclip boundingBox_mc._visible = false; deadPreview._visible = false; vNvNv Nv Ov OvGOvfOvOvOvOvOvPv)Pv=PvjPvPvPvPvPv Pv!Qv""Qv#6Qv$JQv%bQv&yQv'Qv(Qv)Qv*Qv.Rv0-Rv1ZRv2uRv3Rv4Rv5Rv6Rv7Rv8Sv:Sv;7Sv=NSv?mSvASvBSvCSvDSvESvFTvG*TvH;TvIYTvJ~TvLTvMTvPTvRTvSTvT UvUVUvVUvWUvXVvZWVv\Vv]Vv`VvbVvcWvdWve3WvgVWvihWvjyWvkWvoWvqWvrWvsXvtAXvvtXvwXv{Xv}Xv,YvEYv^Yv}YvYvYvYvYvZv ZvCZv\ZvnZvZvZvZvZvZv[v.[vI[vb[vt[v[v[v[v[v\v0\vB\v]\vv\v\v\v\v]v]v7]vU]vo]v]v]v]v]v]v]v^v/^v@^vV^vp^v^v^v^v^v^v^v_v._vM_v^_vx_v_v_v_v_v`v`v8`vl`v`v`v `v `v`vPav~avavavavav bv#bv%7bv(Wbv*xbv+bv-bv1bv3bv4cv6cv:cv<:cIkactions sur fcb_frame: Image 1 du calque READMEvar component = _parent._parent; //::: don't delete the above //::: SKIN ELEMENT REGISTRATION /* To add styleFormat properties to your skins : 1) Break up your skin into individual movie clips (skinElements) 2) add a registerSkinElement line of code for each skinElement component.registerSkinElement(skinElement, propertyName) // makes the skinElement Listen to the propertyName specified (eg: "background") n*/ component.registerSkinElement(shadow_mc, "shadow"); component.registerSkinElement(darkshadow_mc, "darkshadow"); component.registerSkinElement(highlight_mc, "highlight"); component.registerSkinElement(highlight3D_mc, "highlight3D"); Ik"Ik 4IkTIktIkHactions sur FBoundingBox: Image 1 du calque READMEvar component = _parent; //::: don't delete the above //::: SKIN ELEMENT REGISTRATION /* To add styleFormat properties to your skins : 1) Break up your skin into individual movie clips (skinElements) 2) add a registerSkinElement line of code for each skinElement component.registerSkinElement(skinElement, propertyName) // makes the skinElement Listen to the propertyName specified (eg: "background") n*/ component.registerSkinElement(boundingBox, "background"); stop();H. H : HZ 7zactions sur FLabel: Image 1 du calque Class Methods#initclip 0 _global.FLabelClass = function() { if (this.hostComponent==undefined) { this.hostComponent = (this._parent.controller==undefined) ? this._parent : this._parent.controller; } if (this.customTextStyle==undefined) { if (this.hostComponent.textStyle==undefined) { this.hostComponent.textStyle= new TextFormat(); } this.textStyle = this.hostComponent.textStyle; this.enable = true; } } FLabelClass.prototype = new MovieClip(); Object.registerClass("FLabelSymbol", FLabelClass); //::: PUBLIC METHODS FLabelClass.prototype.setLabel = function(label) { var val = this.hostComponent.styleTable.embedFonts.value; if (val!=undefined) { this.labelField.embedFonts = val; } this.labelField.setNewTextFormat(this.textStyle); this.labelField.text = label; this.labelField._height = this.labelField.textHeight + 2; } FLabelClass.prototype.setSize = function(width) // note that height is textFormat-based. { this.labelField._width = width; } FLabelClass.prototype.setEnabled = function(enable) { this.enable=enable; var tmpColor = this.hostComponent.styleTable[ (enable) ? "textColor" : "textDisabled" ].value; if (tmpColor==undefined) { tmpColor = (enable) ? 0x000000 : 0x888888; } this.setColor(tmpColor); } FLabelClass.prototype.getLabel = function() { return this.labelField.text; } FLabelClass.prototype.setColor = function(col) { this.labelField.textColor = col; } #endinitclip actions sur fcb_states: Image 2 du calque actions: framestop();  <actions sur fcb_states: Image 6 du calque actions: framestop(); <vactions sur CheckBox: Image 1 du calque Actions: Class#initclip 1 function FCheckBoxClass() { this.init(); } FCheckBoxClass.prototype = new FUIComponentClass(); Object.registerClass("FCheckBoxSymbol", FCheckBoxClass); FCheckBoxClass.prototype.init = function() { super.setSize(this._width,this._height); this.boundingBox_mc.unloadMovie(); this.attachMovie("fcb_hitArea","fcb_hitArea_mc",1); this.attachMovie("fcb_states", "fcb_states_mc",2); this.attachMovie("FLabelSymbol","fLabel_mc",3); super.init(); this.setChangeHandler(this.changeHandler); this._xscale = 100; this._yscale = 100; this.setSize(this.width,this.height); if ( this.initialValue == undefined ) { this.setCheckState(false); } else { this.setCheckState(this.initialValue); } if(this.label != undefined){ this.setLabel(this.label); } // ACCESSIBILITY DEFINED :: _accImpl object defined in base class this.ROLE_SYSTEM_CHECKBUTTON = 0x2c; this.STATE_SYSTEM_CHECKED = 0x10; this.EVENT_OBJECT_STATECHANGE = 0x800a; this.EVENT_OBJECT_NAMECHANGE = 0x800c; this._accImpl.master = this; this._accImpl.stub = false; this._accImpl.get_accRole = this.get_accRole; this._accImpl.get_accName = this.get_accName; this._accImpl.get_accState = this.get_accState; this._accImpl.get_accDefaultAction = this.get_accDefaultAction; this._accImpl.accDoDefaultAction = this.accDoDefaultAction; } FCheckBoxClass.prototype.setLabelPlacement = function( pos ) { this.setLabel(this.getLabel()); this.txtFormat( pos ); var halfLabelH = this.fLabel_mc._height/2; var halfFrameH = this.fcb_states_mc._height/2; var vertCenter = (halfFrameH - halfLabelH ); var checkWidth = this.fcb_states_mc._width; var frame = this.fcb_states_mc var label = this.fLabel_mc; var w = 0; if (frame._width > this.width){ w = 0; } else { w = this.width - frame._width; } this.fLabel_mc.setSize(w); if (pos == "right" || pos == undefined){ this.labelPlacement = "right"; this.fcb_states_mc._x = 0; this.fLabel_mc._x = checkWidth; this.txtFormat("left"); } else if (pos == "left"){ this.labelPlacement = "left"; this.fLabel_mc._x = 0; this.fcb_states_mc._x = this.width - checkWidth; this.txtFormat("right"); } this.fLabel_mc._y = vertCenter; this.fcb_hitArea_mc._y = vertCenter; } FCheckBoxClass.prototype.txtFormat = function( pos ) { var txtS = this.textStyle; var sTbl = this.styleTable; txtS.align = (sTbl.textAlign.value == undefined) ? txtS.align = pos : undefined; txtS.leftMargin = (sTbl.textLeftMargin.value == undefined) ? txtS.leftMargin = 0 : undefined; txtS.rightMargin = (sTbl.textRightMargin.value == undefined) ? txtS.rightMargin = 0 : undefined if(this.flabel_mc._height > this.height){ super.setSize(this.width,this.flabel_mc._height); }else{ super.setSize(this.width,this.height); } this.fLabel_mc.labelField.setTextFormat(this.textStyle); this.setEnabled(this.enable) } FCheckBoxClass.prototype.setHitArea = function(w,h) { var hit = this.fcb_hitArea_mc; this.hitArea = hit; if ( this.fcb_states_mc._width > w ){ hit._width = this.fcb_states_mc._width; }else{ hit._width = w; } hit._visible = false; if(arguments.length > 1){ hit._height = h; } } FCheckBoxClass.prototype.setSize = function(w) { this.setLabel(this.getLabel()); this.setLabelPlacement(this.labelPlacement); if(this.fcb_states_mc._height < this.flabel_mc.labelField._height){ super.setSize(w,this.flabel_mc.labelField._height); } this.setHitArea(this.width,this.height); this.setLabelPlacement(this.labelPlacement); } FCheckBoxClass.prototype.drawFocusRect = function() { this.drawRect(-2, -2, this._width+6, this._height-1); } FCheckBoxClass.prototype.onPress = function() { this.pressFocus(); _root.focusRect.removeMovieClip(); var states = this.fcb_states_mc; if (this.getValue()) { states.gotoAndStop( "checkedPress" ); } else { states.gotoAndStop( "press" ); } } FCheckBoxClass.prototype.onRelease = function() { this.fcb_states_mc.gotoAndStop( "up" ); this.setValue(!( this.checked )); } FCheckBoxClass.prototype.onReleaseOutside = function() { var states = this.fcb_states_mc; if (this.getValue()) { states.gotoAndStop( "checkedEnabled" ); } else { states.gotoAndStop("up"); } } FCheckBoxClass.prototype.onDragOut = function() { var states = this.fcb_states_mc; if (this.getValue()) { states.gotoAndStop( "checkedEnabled" ); } else { states.gotoAndStop("up"); } } FCheckBoxClass.prototype.onDragOver = function() { var states = this.fcb_states_mc; if (this.getValue()) { states.gotoAndStop( "checkedPress" ); } else { states.gotoAndStop("press"); } } FCheckBoxClass.prototype.setValue = function( checkedValue ) { if ( checkedValue || checkedValue == undefined) { this.setCheckState( checkedValue ); } else if (checkedValue == false){ this.setCheckState( checkedValue ); } this.executeCallBack(); if(Accessibility.isActive()){ Accessibility.sendEvent( this, 0, this.EVENT_OBJECT_STATECHANGE,true ); } } FCheckBoxClass.prototype.setCheckState = function( checkedValue ) { var states = this.fcb_states_mc; if ( this.enable ) { this.flabel_mc.setEnabled(true); if ( checkedValue || checkedValue == undefined) { states.gotoAndStop( "checkedEnabled" ); this.enabled = true; this.checked = true; } else { states.gotoAndStop("up"); this.enabled = true; this.checked = false; } } else { this.flabel_mc.setEnabled(false); if ( checkedValue || checkedValue == undefined) { states.gotoAndStop( "checkedDisabled" ); this.enabled = false; this.checked = true; } else { states.gotoAndStop( "uncheckedDisabled" ); this.enabled = false; this.checked = false; this.focusRect.removeMovieClip() } } } FCheckBoxClass.prototype.getValue = function() { return (this.checked); } FCheckBoxClass.prototype.setEnabled = function( enable ) { if(enable == true || enable == undefined){ this.enable = true; Super.setEnabled(true); } else { this.enable = false; Super.setEnabled(false); } this.setCheckState(this.checked); } FCheckBoxClass.prototype.getEnabled = function() { return(this.enable); } FCheckBoxClass.prototype.setLabel = function( label ) { this.fLabel_mc.setLabel(label); this.txtFormat(); // ACCESSIBILITY if(Accessibility.isActive()){ Accessibility.sendEvent( this, 0, this.EVENT_OBJECT_NAMECHANGE ); } } FCheckBoxClass.prototype.getLabel = function() { return (this.fLabel_mc.labelField.text); } FCheckBoxClass.prototype.setTextColor = function( color ) { this.fLabel_mc.labelField.textColor = color; } FCheckBoxClass.prototype.myOnKeyDown = function( ) { if (Key.getCode() == Key.SPACE && this.pressOnce == undefined && this.enabled == true) { this.setValue(!this.getValue()); this.pressOnce = true; } } FCheckBoxClass.prototype.myOnKeyUp = function( ) { if (Key.getCode() == Key.SPACE) { this.pressOnce = undefined; } } // START ACCESSIBILITY METHODS FCheckBoxClass.prototype.get_accRole = function(childId) { return this.master.ROLE_SYSTEM_CHECKBUTTON; } FCheckBoxClass.prototype.get_accName = function(childId) { return this.master.getLabel(); } FCheckBoxClass.prototype.get_accState = function(childId) { if (this.master.getValue()) { return this.master.STATE_SYSTEM_CHECKED; }else{ return 0; } } FCheckBoxClass.prototype.get_accDefaultAction = function(childId) { if ( this.master.getValue() ){ return "UnCheck"; }else{ return "Check"; } } FCheckBoxClass.prototype.accDoDefaultAction = function(childId) { this.master.setValue( !this.master.getValue() ); } // END ACCESSIBILITY METHODS ::mr:: #endinitclip boundingBox_mc._visible = false; deadPreview._visible = false; vD vE 7zactions sur FLabel: Image 1 du calque Class Methods#initclip 0 _global.FLabelClass = function() { if (this.hostComponent==undefined) { this.hostComponent = (this._parent.controller==undefined) ? this._parent : this._parent.controller; } if (this.customTextStyle==undefined) { if (this.hostComponent.textStyle==undefined) { this.hostComponent.textStyle= new TextFormat(); } this.textStyle = this.hostComponent.textStyle; this.enable = true; } } FLabelClass.prototype = new MovieClip(); Object.registerClass("FLabelSymbol", FLabelClass); //::: PUBLIC METHODS FLabelClass.prototype.setLabel = function(label) { var val = this.hostComponent.styleTable.embedFonts.value; if (val!=undefined) { this.labelField.embedFonts = val; } this.labelField.setNewTextFormat(this.textStyle); this.labelField.text = label; this.labelField._height = this.labelField.textHeight + 2; } FLabelClass.prototype.setSize = function(width) // note that height is textFormat-based. { this.labelField._width = width; } FLabelClass.prototype.setEnabled = function(enable) { this.enable=enable; var tmpColor = this.hostComponent.styleTable[ (enable) ? "textColor" : "textDisabled" ].value; if (tmpColor==undefined) { tmpColor = (enable) ? 0x000000 : 0x888888; } this.setColor(tmpColor); } FLabelClass.prototype.getLabel = function() { return this.labelField.text; } FLabelClass.prototype.setColor = function(col) { this.labelField.textColor = col; } #endinitclip7zF7z'F7z>F7z F7z F7z F7z F7zF7zG7z/G7zOG7znG7zG7zG7zG7z G7z!G7z%)H7z'HH7z*aH7z,H7z-H7z.H7z/H7z1I7z4#I7z6