Scale9Grid & SetMask Issue
Can any of you confirm: once scale9Grid MovieClip is used to mask another MovieClip the mask won't scale properly any more.
Thanks
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 04-30-2006, 06:42 PM
View Complete Forum Thread with Replies
Sponsored Links:
Weird SetMask Issue
Hi,
Did some code using setMask, real simple example and it worked fine. Then I put that code inside another MC and it stopped working, for no apparent reason. Does setMask only work in the main timeline??
thanks for any advice.
boombanguk
View Replies !
View Related
Scale9Grid Sux
When I first heard about the Scale9Grid feature, I thought, "Wow, that's a pretty cool and practical feature."
But then I tried to use it.
The Flash Help files don't do a real good job explaining how to apply the Scale9Grid feature to a clip in the Flash authoring environment. Just to make things a little clearer, you need to check the "Enable guides for 9 slice scaling" option when converting items to symbols via Modify/Convert to Symbol. Or you can right-click the clip in your library, select "Properties" then check the "Enable guides for 9 slice scaling" option at the bottom. Even when properly enabled, you will only see the Scale9Grid guidelines ~properly~ if you edit the clip from the library; double-clicking the clip on stage won't work.
Although the Flash Help Files clearly show a charming bitmap of an orangutan right smack dab in the middle of the clip to which the Scale9Grid is being applied, the Scale9Grid functionality doesn't apply to bitmaps. That's a pretty important thing to know so I'll make it real clear, "SCALE9GRID FUNCTIONALITY DOESN'T APPLY TO BITMAPS." You see, the catch to using Adobe's bitmap monkey (I know it's an ape but I like the word monkey more, so there) is that the bitmap is fully contained within the center block of the 3X3 grid which uses 'standard' scaling. Any bitmap extending beyond the bounds of the center block will not scale in the expected Scale9Grid fashion. This means you can't import that cool picture frame with smooth gradients and photographic details from Photoshop and use it in Flash... unless of course you want to use the "trace bitmap" command and convert it to vectors.
Scaling vector shapes with Scale9Grid works as expected... well, as long as you don't expect to set your scale to negative numbers. Setting the clip's _xscale or _yscale to a negative number causes the clip to be scaled in the standard distorting fashion.
Someone else on Adobe LiveDocs has pointed out that clips also lose their scale9Grid functionality when used as masks.
MovieClips, TextFields and Buttons inside the clip you're trying to scale with Scale9Grid will NOT scale as expected, instead they will stretch and distort in the 'standard' fashion. Graphic symbols inside the clip you're scaling will "attempt" to be scaled in the expected Scale9Grid fashion but I've had some odd results such as distorted shapes around the perimeter so I don't recommend it.
I've attached a file demonstrating some of Scale9Grid's odd (buggy) behavior. First, open the file then test it. See how the frame looks like a 1970's TV screen? That's a bug, the corners should be nice and round and the edges should be straight. If you open the attached file and move the rainbow box Graphic towards the center a few pixels or delete it entirely you might see how it "should" work. Moving the Graphic towards the very center causes the Graphic to be scaled in the 'standard' fashion. Also, if you leave the Graphic at (0, 0) but un-check the MovieClip layer's "guide" property the frame draws as expected, but the red square MovieClip will scale in the standard fashion. I'm sure it all makes sense to the guy who wrote the scale9Grid method, but to me it's a bit perplexing (i.e. stupid).
Okay, I've vented. I feel better now. Hopefully you'll find some of the info provided helpful. And if you're really lucky, you'll find it BEFORE you really need to.
-PiXELWiT
http://www.pixelwit.com
View Replies !
View Related
Scale9Grid
Hello everyone,
Code:
private function initScale9Grid():void {
var rectX:Number = this.x + 20;
var rectY:Number = this.y + 10;
var rectWd:Number = this.width - 50;
var rectHt:Number = this.height - 50;
var rect:Rectangle = new Rectangle(rectX, rectY, rectWd, rectHt);
this.scale9Grid = rect;
}
Error #2004: One of the parameters is invalid.
This is my code to create the scale9Grid for my movieClip. I even drew a sprite with the exact dimensions as the rect (and it lies right within the movieclip). But I keep getting this error.
I have been trying to get this working for a very long time. ANY idea whats wrong??
View Replies !
View Related
Scale9Grid
Ah, I forgot that the 3rd, and 4th parameters are width and height, not x and y....
Attach Code
var rectangle:Shape = new Shape();
rectangle.graphics.beginFill(color);
rectangle.graphics.drawRect(0, 0, 20, 20);
rectangle.graphics.endFill();
var grid:Rectangle = new Rectangle(2, 2, 18, 18);
rectangle.scale9Grid = grid;
Edited: 11/02/2007 at 04:44:09 PM by cayennecode
View Replies !
View Related
Scale9Grid
Why doesn't this work?
ActionScript Code:
import flash.geom.Rectangle;
this.createEmptyMovieClip("test_mc", 10);
var grid:Rectangle = new Rectangle(30, 30, 370, 370);
test_mc.scale9Grid = grid;
test_mc._x = 50;
test_mc._y = 50;
function onMouseMove() {
test_mc._width = _xmouse-50;
test_mc._height = _ymouse-50;
}
test_mc.lineStyle(5, 0x000000, 80);
test_mc.beginFill(0xFFCC66, 100);
test_mc.moveTo(20, 0);
test_mc.lineTo(380, 0);
test_mc.curveTo(400, 0, 400, 20);
test_mc.lineTo(400, 380);
test_mc.curveTo(400, 400, 380, 400);
test_mc.lineTo(20, 400);
test_mc.curveTo(0, 400, 0, 380);
test_mc.lineTo(0, 20);
test_mc.curveTo(0, 0, 20, 0);
test_mc.endFill();
What's wrong?
View Replies !
View Related
Scale9Grid
Does anybody know how it actually works. All I know is that it breaks down quite often; that is, every time a scaled movie clip hosts another movie clip (instead of only shapes), it reverts to plain old scaling.
Cheers.
View Replies !
View Related
Problem Using Scale9Grid
Has anyone had success using scale9Grid on shapes other than rounded corner shapes? I can't get it to work on things that aren't just straight forward shapes. See example attached, it works perfectly for the green rounded corner boxes but not for the red shape I drew with the pen tool...
View Replies !
View Related
BitmapData And Scale9Grid
Hi all,
I've been trying to use the scale9Grid property with BitmapData.
I know that scale9Grid doesn't work with child Movieclips, but does this relate to BitmapData Objects aswell?
What I'm doing is taking an imported images (convert to BitmapData), and combining it to form one image. this is then attached to the movieclip via attachBitmap().
Is there a way to use scale9Grid with an attached Bitmap?
If anyone knows of a way, help would be appreciated
Cheers.
View Replies !
View Related
Scale9Grid Question?
Hello I am having some problems with setting up 9-grid scaling using Actionscript.
I keep getting this error message:
Code:
ArgumentError: Error #2004: One of the parameters is invalid.
at flash.display::DisplayObject/set scale9Grid()
here is my code:
Code:
private function menuSeed():void{
trace("menuSeed");
var cont:Sprite = new Sprite();
cont.graphics.beginFill(0x555555, 1);
cont.graphics.drawRoundRect(0,0,60,45,15,15);
cont.graphics.endFill();
var grid = new Rectangle(15, 15, 45, 30);
cont.scale9Grid = grid;
cont.scaleY *= 2;
cont.x = 30;
cont.y = 80;
addChild(cont);
}
I have noticed that I start getting this error when I set the parameters for the grid rectangle to a number greater than the radius of the rounded corner, 15 in this case. Anything lower than 15 will solve this issue.
Why wont this work with 15 or greater?
Any ideas how to resolve this problem?
thanks
View Replies !
View Related
Scale9Grid Problem Again
If the rectangle grows, scale9Grid works well. (the corners stay fix) But if the rectangle decreases scale9Grid doesn't work. Why?
I've written a script that shows:
Attach Code
function mouseWheelHandler(event:MouseEvent):void {
Rect.width += event.delta;
Rect.height += event.delta;
}
var Rect:Sprite = new Sprite();
Rect.x = 10; Rect.y = 10;
Rect.graphics.lineStyle(1, 0x000000, 1.0, true, "none");
Rect.graphics.drawRoundRect(0, 0, 320, 240, 20, 20);
Rect.graphics.endFill();
var Grid:Rectangle = new Rectangle(10, 10, 10, 10);
Rect.scale9Grid = Grid;
addChild(Rect);
stage.addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
View Replies !
View Related
AS2 Scale9Grid And CurveTo
Hi there,
Having problems getting the scale9Grid to work correctly.
Here is a sample of the code:
//
////////////////////////////////////////////////////////////////////////////////////////
MovieClip.prototype.drawRoundedRect = function ( W:Number, H:Number,
R:Array ):Void
{
this.moveTo (R[0], 0);
this.lineTo (W - R[0], 0);
this.curveTo (W, 0, W, R[0]);
this.lineTo (W, H - R[1]);
this.curveTo (W, H, W - R[1], H);
this.lineTo (R[2], H);
this.curveTo (0, H, 0, H - R[2]);
this.lineTo (0, H - R[2]);
this.lineTo (0, R[3]);
this.curveTo (0, 0, R[3], 0);
this.lineTo (R[3], 0);
}
var radius:Number = 10;
this.createEmptyMovieClip ("mc",this.getNextHighestDepth ());
mc._x = mc._y = 5;
mc.beginFill (0x000000,100);
mc.drawRoundedRect ( 300, 300, [radius,radius,radius,radius] )
mc.endFill ();
import flash.geom.Rectangle;
var grid:Rectangle = new Rectangle (radius+1, radius+1, mc._width-radius-1,
mc._height-radius-1);
mc.scale9Grid = grid;
function onMouseMove ()
{
mc._width = _xmouse;
mc._height = _ymouse;
}
//
////////////////////////////////////////////////////////////////////////////////////////
Can anyone help me?
Thanks
View Replies !
View Related
Scale9Grid Problem
I'm trying everything to get this box to scale with rounded corners not getting stretched. I can't figure it out. The box is about 167 x 35 and this is my code, sorry if it's a lot
ActionScript Code:
import flash.geom.Rectangle;import mx.transitions.Tween;import mx.transitions.easing.*;onEnterFrame = function():Void{ space = 2; btn2._x = (btn1._x + btn1._width + space); btn3._x = (btn1._x + btn1._width + btn2._width + (2 * space));}btn1.scale9Grid = new Rectangle(6, 10, 5, 5);function enlarge(target:MovieClip):Void { var twUpY:Tween = new Tween(target, "_yscale", Elastic.easeOut, target._yscale, 360, 40, false); var twUpX:Tween = new Tween(target, "_xscale", Elastic.easeOut, target._xscale, 160, 40, false); target.mytoggle = true; var oListener:Object = new Object(); oListener.onMotionFinished = function():Void{ if (target.mytoggle == true){ target.play(); } } twUpY.addListener(oListener);}function shrink(target:MovieClip):Void{ target.mytoggle = false; target.gotoAndStop(1); var twDownY:Tween = new Tween(target, "_yscale", Elastic.easeOut, target._yscale, 100, 40, false); var twDownX:Tween = new Tween(target, "_xscale", Elastic.easeOut, target._xscale, 100, 40, false);}btn1.onRollOver = function(){ enlarge(btn1);}btn1.onRollOut = function(){ shrink(btn1);}btn2.onRollOver = function(){ enlarge(btn2);}btn2.onRollOut = function(){ shrink(btn2);}btn3.onRollOver = function(){ enlarge(btn3);}btn3.onRollOut = function(){ shrink(btn3);}
I tried changing all the dimensions of the rectangle, that didn't help at all, it's like it doesn't even acknowledge it's there...
View Replies !
View Related
Scale9Grid Error
Does anyone know why this error if no graphics present
eg:
Code:
var square:Shape = new Shape();
square.graphics.lineStyle(20, 0xFFCC00);
square.graphics.drawRect(0, 0, 100, 100);
var grid:Rectangle = new Rectangle(20, 20, 60, 60);
square.scale9Grid = grid ;
addChild(square);
eg with error
Code:
var square:Shape = new Shape();
var grid:Rectangle = new Rectangle(20, 20, 60, 60);
square.scale9Grid = grid ;
addChild(square);
error
Quote:
ArgumentError: Error #2004: One of the parameters is invalid.
at flash.display:isplayObject/set scale9Grid()
at Untitled_fla::MainTimeline/frame1()
Thanks
T
View Replies !
View Related
Scale9Grid And Masking Problem
first of all .. thank you very much for your interest
the following actionscript 2.0 code for simple reveal effect applied on a movieclip ..
movie has curved corners and loaded image ..
I'm tring to scale the border and the image mask within that movie while rolling over regardless of which regions of the 4 corners using scale9Grid class ..
well .. the border does scale properly, but the mask does not !
the only conclusion I've got that the mask movie does scale properly when disable masknig !
any help please ?
// importing nesessary classes //
import flash.geom.Rectangle;
import mx.transitions.Tween;
import mx.transitions.Tween.easing.*;
// API drawing engine //
function drawRec(mc:MovieClip, side:Number, corner:Number, stroke:Number, fill:Number) {
if (fill != undefined) {
mc.beginFill(fill);
}
mc.lineStyle(5, stroke);
mc.moveTo(-side+corner, -side);
mc.lineTo(side-corner, -side);
mc.curveTo(side, -side, side, -side+corner);
mc.lineTo(side, side-corner);
mc.curveTo(side, side, side-corner, side);
mc.lineTo(-side+corner, side);
mc.curveTo(-side, side, -side, side-corner);
mc.lineTo(-side, -side+corner);
mc.curveTo(-side, -side, -side+corner, -side);
if (fill != undefined) {
mc.endFill();
}
}
// creating test movie holder //
this.createEmptyMovieClip("_box", 1);
_box._x = Stage.width/2;
_box._y = Stage.height/2;
// creating border within movie holder //
_box.createEmptyMovieClip("_brd", 3);
drawRec(_box._brd, 100, 20, 0xA8A8A8);
// creating mask for image container //
_box.createEmptyMovieClip("_msk", 2);
drawRec(_box._msk, 95, 18, 0xA8A8A8, 0xA8A8A8);
// creating image container //
_box.createEmptyMovieClip("_img", 1);
// loading image //
var img_lodr:MovieClipLoader = new MovieClipLoader();
var img_lsnr:Object = new Object();
img_lsnr.onLoadInit = function(target:MovieClip) {
target._x = -(target._width/2);
target._y = -(target._height/2);
target.setMask(target._parent._msk); // commenting this line shows proper mask scaling !
};
img_lodr.addListener(img_lsnr);
img_lodr.loadClip("image.jpg", _box._img);
// enable 9-slice scaling for border and mask only //
var grid:Rectangle = new Rectangle(0, 0, 30, 30);
_box._brd.scale9Grid = grid;
_box._msk.scale9Grid = grid;
// assign scaling events for movie holder //
_box.onRollOver = function() {
new Tween(this._brd, "_xscale", Regular.easeOut, this._brd._xscale, 200, .5, true);
new Tween(this._brd, "_yscale", Regular.easeOut, this._brd._yscale, 200, .5, true);
new Tween(this._msk, "_xscale", Regular.easeOut, this._brd._xscale, 200, .5, true);
new Tween(this._msk, "_yscale", Regular.easeOut, this._brd._yscale, 200, .5, true);
};
_box.onRollOut = function() {
new Tween(this._brd, "_xscale", Regular.easeOut, this._brd._xscale, 100, .5, true);
new Tween(this._brd, "_yscale", Regular.easeOut, this._brd._yscale, 100, .5, true);
new Tween(this._msk, "_xscale", Regular.easeOut, this._brd._xscale, 100, .5, true);
new Tween(this._msk, "_yscale", Regular.easeOut, this._brd._yscale, 100, .5, true);
};
// end of code //
View Replies !
View Related
Scale9grid On Mask Object
i can't make this work for some reason
PHP Code:
masking = new Sprite(); // declared outside method...masking.graphics.beginFill(0x111111, 0.75);masking.graphics.drawRoundRect(0, 0, 75, 15, 5, 5);masking.graphics.endFill(); addChild(masking);masking.scale9Grid = new Rectangle(5, 5, 65, 5);this.mask = masking; // this extends Sprite...
..if I don't apply mask, scaling works great, but when I do scaling is wrong... Any ideas what might be a problem?
View Replies !
View Related
AS3 Scale9Grid For Library Objects
Hi,
I have a rounded rectangle movieclip in the library. I want to have multiple instances of the same on stage, each with different dimensions. But i do not want to loose out the perfect rounds on the edges on each instance. Can you pls help me with this in AS3.
thanks.
View Replies !
View Related
Scale9Grid Not Applying To Child Nodes Properly
I am running into something funky with my scale9Grid. I have a valid scale9 grid applied to a display object. I have a child object, that is basically a copy of the shape that I show on my roll overs to give me a color change.
The parent clip's shape scales as I would expect with the scale9Grid. The child however distorts as though the scale9Grid didn't exist. I even tried assigning a unique scale9Grid to the child, but it didn't seem to have any effect either. So the end result is a display object that looks distorted when I roll over it.
Anybody have any ideas about what I am doing wrong? This is my first time bothering with the scale9Grid property.
View Replies !
View Related
Help With SetMask
I am duplicating movieclips using the "movieClip(attachMovie)" command and it displays fine.
Now, what is the correct way to create a mask for them to appear in?
I have tried placing an MC mask on the stage and calling it with "movieClip.setMask()" but it didn't work; it just appeared below my duplicated movieclips.
Thanks for any help,
:: Serviator
View Replies !
View Related
SetMask Help
hey,
im sure theres a way just cant put my finger on it, i was wondering if a single object can mask multiple objects, so its something like this
PHP Code:
parent1.setMask(this.parent.node1,parent.node2,parent.node3);
thanks
-Cody
View Replies !
View Related
Wow, I Really Don't Get SetMask...
OK, I thought I understood it. Here's the code in a sample fla:
Code:
this.attachMovie("cover", "cover", 10);
this.attachMovie("mask", "mask", 11);
mask._x = 200;
mask._y = 50;
cover.setMask(mask);
What I have is a picture onstage, and then this code draws "cover", which is just a colored box over the picture, and "mask" is a circle of solid color that I want to be the hole in the mask. However, when I run it, "cover" just disappears and I get a solid circle over the background picture.
Here's the fla.
View Replies !
View Related
Using SetMask With More Than One Mc
Hi all...getting a little bit confused with setMask.
I have on stage an mc called 'mask'. Now the problem is when I introduce more than one mc to the stage and impliment setMask it invariably works on one of the mc's at the expense of the others.
Ideally I would like the mask to show all of the mc's and not just one.
Here is the script:
code: //the elements below are revealed by the mask (mask)
a.setMask(mask);// first mc to be revealed
b.setMask(mask);// 2nd mc to be revealed
c.setMask(mask);// 3rd
d.setMask(mask);// 4th
Where am i going wrong?
View Replies !
View Related
SetMask
I'm doing a very simple snow animation:
i = 100;
this.onEnterFrame = function() {
i++;
duplicateMovieClip("flake", "flake"+i, i);
clipScale = Math.round(Math.random()*100);
clipPos = Math.round(Math.random()*180+flake._x);
this["flake"+i]._xscale = clipScale;
this["flake"+i]._yscale = clipScale;
this["flake"+i]._x = clipPos;
this["flake"+i].setMask(flakeMask);
this["flake"+i].onEnterFrame = function() {
if (this._y<200) {
this._y += 2;
} else {
removeMovieClip(this);
}
};
};
stop();
I have a movie clip that I want to mask all the flakes, with an instance name of flakeMask, but it's not masking. What am I doing wrong?
View Replies !
View Related
Should I Be Using SetMask()
Hi
I'm trying to achieve the technique which is applied here by some clever chuffer:
http://www.templatemonster.com/flash-templates/13425.html
The effect I am talking about is the image gallery and the masking that takes place here once a thumbnail graphic is clicked on. There must be some layer sorting done in actionscript and the "star" mask must be applied using actionscript somehow.
Can anyone help me to get started with this?
Should I be using the setMask() method?
Should I be using attachMovie?
Should I be using linkage on items in the library or should all items already be on the stage?
If anyone can help then that'd be great.
Cheers
James
View Replies !
View Related
Using SetMask
Okay I have searched as much as I think I can search here, and I know this is extremely simple, yet I am stuck on it.
I wanted to try and use setMask with images loaded into my main movie using loadMovie command. I even found this thread here:http://www.kirupaforum.com/forums/sh...hlight=masking
but was having trouble getting that to work, so I am simply attempting to use setMask with a movieclip actually placed on the mainstage of my movie.
I can't even get this to work!! I have tried several combos including these:
(the name of the image mc is building and the mask is mask_mc)
onClipEvent (load) {
building.setMask(mask_mc);
}
onClipEvent (load) {
building.setMask(_root.mask_mc);
}
onClipEvent (load) {
_root.building.setMask(mask_mc);
}
When I check the code in Flash it says no errors but when I test the movie I get this message in the output window:
Scene=Scene 1, Layer=actions, Frame=1: Line 2: Unexpected '}' encountered
}
I don't get what is happening and I know it is simple.
View Replies !
View Related
Using SetMask
Can anyone tell why setMask isn't working in this .fla?
i've had it working on different .fla's before... something's up with
this one and I'm not sure...
thanks for any help!
View Replies !
View Related
SetMask Try-out
Well,
I've helped at a few topics about dragging and dropping. Slowly I started creating a fla which setMask() to a number a grouped items.
http://www.kirupa.com/forum/showthread.php?t=96130
It also uses rotation (while pressed) and drop target (the same). Perhaps this isn't as special as some others are posting but I think the dynamic approach of masking is usefull (at least I did )
Let me know what you think.
http://www.fromthemill.nl/kirupa/dropcomplex-v2.fla
http://www.fromthemill.nl/kirupa/dropcomplex-v2.swf
http://www.fromthemill.nl/kirupa/dropcomplex-v2.html
3Pinter
View Replies !
View Related
Using SetMask More Than Once
I am trying to use the following code to use one mc in several instances to mask a jpeg that fills my movie stage. I would like each instance to remain as a mask once the clip has played. It appears as though one will play but then disappears as the next clip(mask) plays. Not sure if this is because I am trying to use setMask more than once, or if it has to do with other issues. You can view the results (swf) here. Here is the code I have so far:
Code:
function loadMask1() {
clearInterval(loadMask1Interval);
_root.attachMovie("mask", "mask1", 1);
_root.mask1._x = -58;
_root.mask1._y = 190;
_root.setMask(mask1);
}
loadMask1Interval = setInterval(loadMask1, 0);
function loadMask2() {
clearInterval(loadMask2Interval);
_root.attachMovie("mask", "mask2", 2);
_root.mask2._x = 59;
_root.mask2._y = 190;
_root.setMask(mask2);
}
loadMask2Interval = setInterval(loadMask2, 1000);
stop();
View Replies !
View Related
Help With SetMask
Essentially, I am trying to fill a graphic with a pattern, which is loaded externally via XML.
This is my code (it doesn't work):
ActionScript Code:
selectedGraphic = _root["container" + (selection-1)]; patternToBeMasked = _root.createEmptyMovieClip("pattern" + (selection-1), getNextAvailableLevel()); patternToBeMasked.loadMovie(fileName); patternToBeMasked.setMask(selectedGraphic);
The graphics are loading properly, but the setMask command seems to have no effect. Is there something else I should be doing? Is setMask sensitive to levels or how movieclips are nested within each other?
View Replies !
View Related
SetMask()
Hi all,
Does anyone know if this bit of code can be shortned?
pos_mc.setMask(pos_mcMask);
scrubber_mc.setMask(pos_mcMask);
progressbar_mc.setMask(pos_mcMask);
loadingbar_mc.setMask(pos_mcMask);
Big THANKS guys,
M
View Replies !
View Related
Using SetMask
Okay I have searched as much as I think I can search here, and I know this is extremely simple, yet I am stuck on it.
I wanted to try and use setMask with images loaded into my main movie using loadMovie command. I even found this thread here:http://www.kirupaforum.com/forums/sh...hlight=masking
but was having trouble getting that to work, so I am simply attempting to use setMask with a movieclip actually placed on the mainstage of my movie.
I can't even get this to work!! I have tried several combos including these:
(the name of the image mc is building and the mask is mask_mc)
onClipEvent (load) {
building.setMask(mask_mc);
}
onClipEvent (load) {
building.setMask(_root.mask_mc);
}
onClipEvent (load) {
_root.building.setMask(mask_mc);
}
When I check the code in Flash it says no errors but when I test the movie I get this message in the output window:
Scene=Scene 1, Layer=actions, Frame=1: Line 2: Unexpected '}' encountered
}
I don't get what is happening and I know it is simple.
View Replies !
View Related
Using SetMask
Can anyone tell why setMask isn't working in this .fla?
i've had it working on different .fla's before... something's up with
this one and I'm not sure...
thanks for any help!
View Replies !
View Related
SetMask
Hi,
I am having a problem. When I call setMask as in the code below, it appears to "delete" or "destroy" the Diplacement map fitler that I assigned to the movie clip that I am trying to mask. However, if I mask the same clip using layers and the timeline it works fine. Please help if you can.
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
//visible drop, drop and disBG are all movie clips
var dropMap:BitmapData = new BitmapData(visibledrop._width, visibledrop._height, true, 0xFF000000);
dropMap.draw(visibledrop, new Matrix(), null, null, dropMap.rectangle, false, 0xffffcccc);
pt = new Point(drop._x, drop._y);
disFilter = new DisplacementMapFilter(dropMap, pt, 1, 1, 50, 50, "IGNORE", 0x000000, 0x000000);
disbg.filters = new Array(disFilter);
disbg.setMask(drop);
View Replies !
View Related
SetMask With CreateEmptyMovieClip?
Hi Flash World,
I'm creating an empty movie and after that I set this created movie as a mask to another movie.
f.i:
_root.createEmptyMovieClip ("floor", 1);
... lineTo and beginfill to create a black square ...
_root.mymovie.setMask(_root.floor)
The problem is that I don't want to set all the square as a mask... all its inside part ... I'd like to put that square as mask but with a circle inside that it wouldn't be possible to see through it...
What I want is to create a Mask with createEmptyMovieClip, some geometrical drawing inside and some parts of it to be possible to see through them and others no... is it possible? has something to do as when I create a gif with some color set to be transparent?
Thank you very much for your time.
View Replies !
View Related
Problems With SetMask()
Hey everyone.
I'm having an ActionScript crisis. Please HELP!
I'm making a slide show and I want to load each picture from file using
loadMovie("Photos/pic"+pic_num+".jpg", "picture");
I have a blank mc called picture on the stage and all I want to do is three things in order to change pictures... make the mask mc and the picture visible, set the mask mc to mask the photo.. and play the mask.... pretty simple huh?
I tried it with the picture on the stage and initializing it as being invisible and then when needed set it to visible, set the mask, and play..
it works!
like this:
ceremony._visible = true;
ceremony.setMask(flower_wipe);
flower_wipe.gotoAndPlay(1);
ceremony is the picture instance name and flower_mask is the mask movie clip.
I try the exact same thing again, but this time I'll load the picture from file like this:
loadMovie("Photos/pic"+pic_num+".jpg", "picture");
flower_wipe._visible = true;
picture.setMask(flower_wipe);
flower_wipe.gotoAndPlay(1);
the mask movie simply plays overtop of the picture instead of masking it. I've been staring at this stupid thign for long enough now. Any help anyone could offer would be greatly appreciated.
View Replies !
View Related
Problems With SetMask()
Hey everyone.
I'm having an ActionScript crisis. Please HELP!
I'm making a slide show and I want to load each picture from file using
loadMovie("Photos/pic"+pic_num+".jpg", "picture");
I have a blank mc called picture on the stage and all I want to do is three things in order to change pictures... make the mask mc and the picture visible, set the mask mc to mask the photo.. and play the mask.... pretty simple huh?
I tried it with the picture on the stage and initializing it as being invisible and then when needed set it to visible, set the mask, and play..
it works!
like this:
ceremony._visible = true;
ceremony.setMask(flower_wipe);
flower_wipe.gotoAndPlay(1);
ceremony is the picture instance name and flower_mask is the mask movie clip.
I try the exact same thing again, but this time I'll load the picture from file like this:
loadMovie("Photos/pic"+pic_num+".jpg", "picture");
flower_wipe._visible = true;
picture.setMask(flower_wipe);
flower_wipe.gotoAndPlay(1);
the mask movie simply plays overtop of the picture instead of masking it. I've been staring at this stupid thign for long enough now. Any help anyone could offer would be greatly appreciated.
View Replies !
View Related
SetMask Is A Bit Sticky
this is wierd, when using the code below I would think it would move the image not the box I am drawing inside it, it seems that I am not even dawing a box, I can't see it any where???
if you uncomment the setMask, my box appears but then my picture is gone!
any thoughts on why this is happening?
Code:
stop();
_root.createEmptyMovieClip("my_mc", 1);
my_mc.loadMovie("charlie.jpg");
_root.onEnterFrame = function(){
if(my_mc.getBytesLoaded() >= my_mc.getBytesTotal() && my_mc.getBytesTotal() > 0){
t_mc = _root.createEmptyMovieClip("t", 2);
t_mc.beginFill(0xFF0000, 100);
t_mc.moveTo(my_mc._x,my_mc._y);
t_mc.lineTo(my_mc._x+my_mc._width, my_mc._y);
t_mc.lineTo(my_mc._x+my_mc._width, my_mc._y+my_mc._height);
t_mc.lineTo(my_mc._x, my_mc._y+my_mc._height);
t_mc.lineTo(my_mc._x, my_mc._y);
//my_mc.setMask(t_mc);
my_mc.onEnterFrame = function(){
my_mc._x--;
}
}
}
View Replies !
View Related
SetMask & Duplicate
hi
how ican join the duplicate with the mask
the duplicate will be the mask
_______________
duplicateMovieClip("mc","mc"+i,i);
mm.setMask ("mc"+i)
i++
__________________
thank you...
View Replies !
View Related
LoadMovie And Then SetMask
I am trying to do the following:
createEmptyMovieClip("myLogo", 0);
createEmptyMovieClip("myLogoMasker", 1);
myLogoMasker.attachMovie("masker", "masker1", 2);
myLogoMasker._x = 322.5;
myLogoMasker._y = 272.5;
myLogo.loadMovie("logo.swf");
myLogo._x = 322.5;
myLogo._y = 272.5;
myLogo.setMask(myLogoMasker);
and all I see is a red square (the mask) over the loaded 'logo.swf' file. Seems like the setMask is just not working. Is this similar to the onData and onLoad functions getting over-written problem after loadMovie is called?
Thanks.
View Replies !
View Related
A SetMask Question?
Hey 2 alll
Is there anybody out there who can give me a little example how 2 set a mask. .i don't mean a normal mask though but an actionscripted mask.
the thing i want 2 do is make a square movieclip, and make a circle movieclip. i want the square 2 be as big as the stage and act like a mask.
Then i want 2 place the circle outside the masks range.
Then when the circle moves 2 the right it will only be appear under the squared mask.
so when it crosses the ouline of the square the circle disappears again.
if somebody could shed some light on this i would be very pleased.
Greetzzz to all that is actionscript.
Deamothul - the script keeper -
View Replies !
View Related
MovieClip.setMask();
hey guys,
i am trying to mask one movie clip with another usign setMask();. Only one problem that i have is that masked movie clip inherits the color of the mask. My mask is blak - everything that is masked turns black.
mask_mc.setMask(masked_mc);
//everything is masked_mc turns black
any thoughts?
thanks
View Replies !
View Related
MovieClip.setMask()
I would like to know how to use MovieClip.setMask(). I want to apply a mask (with animation in it) to each jpeg I load into a container. Is this possible or does the setMask only work on an mc that is already on the stage?
_root.createEmptyMovieClip("container",1);
container.loadMovie("image1.jpg");
container.setMask(mask)
Has setMask() been used on the loading of the images in this website?
http://www.federicafontana.it/index2.html
If you could point me in the direction of a tutorial it would be appreciated.
Thanks
View Replies !
View Related
SetMask Problem
Any idea what's wrong with this:
createEmptyMovieClip ("mc", 10);
mc.loadMovie("pic1.jpg");
attachMovie("mask","mcMask",20);
mc.setMask(mcMask);
In particular the mcMask movie clip is not working as mask , it is displayed as an ordinary movie clip.
View Replies !
View Related
MovieClip.setMask()
i everybody, sorry for my english
i'm trying to make two seprate mask on the same image with .setMask(), but only one appear to be fonctionnel the other one doesn't. is it possible??? if yes does anybody knows how to do it
Thanks
hortense
View Replies !
View Related
SetMask Not Working
Hello,
I have a clip dynamically created involving some API . I want to mask by this clip some bitmap converted to symbol by setMask action. But it does not work. Any idea_? I have included the source file. I know It looks terrible, but that is the way I deal and try to get on new techniques. So do not be frightened.
Thanx for reply
View Replies !
View Related
SetMask Not Working
Hello,
I have a clip dynamically created involving some API . I want to mask by this clip some bitmap converted to symbol by setMask action. But it does not work. Any idea_? I have included the source file. I know It looks terrible, but that is the way I deal and try to get on new techniques. So do not be frightened.
Thanx for reply
View Replies !
View Related
SetMask But No Animation
hello i've got a problem with flash MX 2004 PRO
i've created a function that works fine in this function
a MC is applied as a mask on another MC with setMask()
that also works fine.
but when i animate this mask MC it does not move on the
stage. What the f*ck!!! where my thoughts about it, then when my animation got around for his second loop it did moved, but not
all of then just one (i had about three masks on the stage)
what's wrong?
see http:\www.cckp.nlFla for the source file
View Replies !
View Related
|