home *** CD-ROM | disk | FTP | other *** search
- // Copyright (c) 1999 Macromedia. All rights reserved.
-
- // Ask for the picture-frame size
- var newPictureFrame = prompt("Enter the width of picture frame in pixels:","25");
- if (newPictureFrame != null && newPictureFrame > 0)
- {
- // Figure out the new canvas size
- var leftSide = fw.getDocumentDOM().left - newPictureFrame;
- var topSide = fw.getDocumentDOM().top - newPictureFrame;
- var rightSide = leftSide + fw.getDocumentDOM().width + newPictureFrame*2;
- var bottomSide = topSide + fw.getDocumentDOM().height + newPictureFrame*2;
-
- // Resize the canvas
- fw.getDocumentDOM().setDocumentCanvasSize({left:leftSide, top:topSide, right:rightSide, bottom:bottomSide});
-
- // New layer for frame
- fw.getDocumentDOM().addNewLayer("Picture Frame", true);
-
- // Draw the new outer frame
- fw.getDocumentDOM().addNewRectangle({left:leftSide, top:topSide, right:rightSide, bottom:bottomSide}, 0);
- var outerFrame = fw.selection[0];
-
- // Draw the new inner frame, inset from the outer frame by the newPictureFrame width
- fw.getDocumentDOM().addNewRectangle({left:leftSide + newPictureFrame, top:topSide + newPictureFrame, right:rightSide - newPictureFrame, bottom:bottomSide - newPictureFrame}, 0);
- var innerFrame = fw.selection[0];
-
- // make the new elems selected
- var newSel = [ innerFrame, outerFrame ];
- fw.selection = newSel;
-
- // punch the new frame
- fw.getDocumentDOM().pathPunch();
-
- // make sure we have no default brush applied
- fw.getDocumentDOM().removeBrush();
-
- // Add the fill
- fw.getDocumentDOM().setFillNColorNTexture(
- {
- category:"fc_Pattern",
- ditherColors:[ "#000000", "#000000" ],
- edgeType:"antialiased",
- feather:0,
- gradient:null,
- name:"fn_Normal",
- pattern:{ image:null, name:"Wood-Light" },
- shape:"pattern",
- stampingMode:"blend",
- textureBlend:0,
- webDitherTransparent:false
- },
- "#ffedf8",
- "Grain"
- );
-
- // Add the effects
- fw.getDocumentDOM().applyEffects(
- {
- category:"Untitled",
- effects:[
- {
- AngleSoftness:3,
- BevelContrast:75,
- BevelType:0,
- BevelWidth:7,
- ButtonState:0,
- DownBlendColor:"#0000003f",
- EdgeThreshold:0,
- EffectIsVisible:true,
- EffectMoaID:"{7fe61102-6ce2-11d1-8c76000502701850}",
- EmbossFaceColor:"#ffffff00",
- GlowStartDistance:0,
- GlowWidth:0,
- HiliteColor:"#ffffff",
- HitBlendColor:"#ffffff3f",
- LightAngle:135,
- LightDistance:100,
- MaskSoftness:0,
- OuterBevelColor:"#df0000",
- ShadowColor:"#000000",
- SlopeMultiplier:1,
- SlopeType:3,
- category:"Inner Bevel",
- name:"Inner Bevel"
- }
- ],
- name:"Untitled"
- }
- );
-
- }
-
-
-
-