
Forthemostpartyoucan’tremovea propertyalltogetherbeca usethe toolhasregistereditas
‘requiredford raw’butyoucanremoveitfromtheuser.Foralistofrequiredfieldsforeachtool
seethetoolinfoatthebottomofthisdocume nt.
Fortheexampleofonlyhaving1fontinthetexttool,openthe_menuText.mxmlfrom
Whiteboard/tools/menuBarsanddeletethefontcom bobox.
Whiteboardmenubarsimplement2methodsgetValueandsetValue.getValueiscalledwhenthe
whiteboardneedsthecurrentva luefromthe menu,suchasforanewshape beenc reated,itwill
callgetValuewiththepropertyname,youmustthenreturnwh atthevalueis.Inourcasewecan
re place:
elseif(valueID=="font")
{
re turnfontCombo.value;
withreturn“Verdana”orwhi cheverfixedfontwewishtou se.
ThesetValuemethod is calledwhenashape isselectedsothemenubarcanupdateitselftohave
allthevaluesoftheselectedshape.Wecanremoveentirelythestatementforsettingthefont.
MenubarscanalsoinformthewhiteboardaboutachangebycallingupdateValue(“valueID”,
value);youcanremoveallinstancesofupdateValue(“font”also.
Fadinginthedrawingcanvaswhenthepageloads
Thisisasimpleeffecttomakethepageloading lessharshandinstant.Addafadetagtoyour
Whiteboard.mxmlandconfigureithowever youwant:
<mx:Fadeid="fadeEffect"duration="500"alphaFrom ="0.0"alphaTo="1.0"></mx:Fade>
Theninthedraw ingAreacanvassettheshowEffecttoyoureffect:
showEffect="fadeEffect"
Thenintheinitfunctionregister2eventswhichyouwillusetomakethecanvasvisibleand
invisible:
pageController.addEventListene r(PageEvent.PAG E_CHANGE,function(){drawingArea.visible=
false;});
pageController.addEventListene r(PageEvent.PAG E_CHANGED,function(){drawingArea.visible
=true;});
PAGE_CHANGEi scalledasapageisabouttoconnecttoge tsitsdataand PAGE_CHANGEDis
calledwhenthefirstdataisinwhichisaftertheshapesonthepagehavebeendrawn.
Commentaires sur ces manuels