Go Back   CodingForums.com > :: Client side development > Flash & ActionScript > Adobe Flex

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-12-2012, 09:33 AM   PM User | #1
micheladoms
New to the CF scene

 
Join Date: Oct 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
micheladoms is an unknown quantity at this point
masking on 3 differents compoents with single image

Hi Friends,



I created three shapes. in that shapes i am loading an image.now i want to apply mask to the image which is loaded in the three different shapes.i want to display shape area as mask. below i am sending code also what i am trying do please help me its very urjent.



public function thribleSlipt():void{



this.container.

removeAllChildren();

if(isCropped){
draggableImg.addChild(cropImag);
//draggableImg.source =cropImag;
}else{
draggableImg.addChild(ldr);
//draggableImg.source = ldr;
}

square = new Sprite();
hline = new Sprite();
square1 = new Sprite();
square2 = new Sprite()
hline1 = new Sprite();
hline2 = new Sprite();

elementmask = new Image();
elementmask.x = 0;

elementmask1 = new Image();
elementmask1.x = 193;

elementmask2 = new Image();
elementmask2.x = 386;

square.graphics.beginFill(0xFFFFFF,0.4);
square.graphics.moveTo(22,21);
square.graphics.lineTo(22,15);
square.graphics.lineTo(22,446);
square.graphics.lineTo(0,424);
square.graphics.lineTo(0,0);
square.graphics.endFill();
square.x=147;
square.y=0;

square1.graphics.beginFill(0xFFFFFF,0.4);
square1.graphics.moveTo(22,21);
square1.graphics.lineTo(22,15);
square1.graphics.lineTo(22,446);
square1.graphics.lineTo(0,424);
square1.graphics.lineTo(0,0);
square1.graphics.endFill();
square1.x=147;
square1.y=0;

square2.graphics.beginFill(0xFFFFFF,0.4);
square2.graphics.moveTo(22,21);
square2.graphics.lineTo(22,15);
square2.graphics.lineTo(22,446);
square2.graphics.lineTo(0,424);
square2.graphics.lineTo(0,0);
square2.graphics.endFill();
square2.x=147;
square2.y=0;

hline.graphics.beginFill(0x000000,0.4);
hline.graphics.moveTo(147,0);
hline.graphics.lineTo(170,23);
hline.graphics.lineTo(152,23);
hline.graphics.lineTo(15,23);
hline.graphics.lineTo(0,0);
hline.graphics.endFill();
hline.x=0;
hline.y=423;

hline1.graphics.beginFill(0x000000,0.4);
hline1.graphics.moveTo(147,0);
hline1.graphics.lineTo(170,23);
hline1.graphics.lineTo(152,23);
hline1.graphics.lineTo(15,23);
hline1.graphics.lineTo(0,0);
hline1.graphics.endFill();
hline1.x=0;
hline1.y=423;

hline2.graphics.beginFill(0x000000,0.4);
hline2.graphics.moveTo(147,0);
hline2.graphics.lineTo(170,23);
hline2.graphics.lineTo(152,23);
hline2.graphics.lineTo(15,23);
hline2.graphics.lineTo(0,0);
hline2.graphics.endFill();
hline2.x=0;
hline2.y=423;

spMask = new Shape();
spMask.graphics.beginFill(0xDDDDDD);
spMask.graphics.moveTo(149,0);
spMask.graphics.lineTo(169,20);
spMask.graphics.lineTo(169,445);
spMask.graphics.lineTo(14,445);
spMask.graphics.lineTo(0,425);
spMask.graphics.lineTo(0,0);
spMask.graphics.endFill();
spMask.x=0;
spMask.y=0;

spMask1 = new Shape();
spMask1.graphics.beginFill(0xDDDDDD);
spMask1.graphics.moveTo(149,0);
spMask1.graphics.lineTo(169,20);
spMask1.graphics.lineTo(169,445);
spMask1.graphics.lineTo(14,445);
spMask1.graphics.lineTo(0,425);
spMask1.graphics.lineTo(0,0);
spMask1.graphics.endFill();
spMask1.x=0;
spMask1.y=0;

spMask2 = new Shape();
spMask2.graphics.beginFill(0xDDDDDD);
spMask2.graphics.moveTo(149,0);
spMask2.graphics.lineTo(169,20);
spMask2.graphics.lineTo(169,445);
spMask2.graphics.lineTo(14,445);
spMask2.graphics.lineTo(0,425);
spMask2.graphics.lineTo(0,0);
spMask2.graphics.endFill();
spMask2.x=0;
spMask2.y=0;


elementmask.addChild(draggableImg);
elementmask.addChild(spMask);
elementmask.addChild(square);
elementmask.addChild(hline);

draggableImg.mask = spMask
this.container.addChild(elementmask);


elementmask1.addChild(draggableImg);
elementmask1.addChild(spMask1);
elementmask1.addChild(square1);
elementmask1.addChild(hline1);

draggableImg.mask =spMask1;
this.container.addChild(elementmask1);

elementmask2.addChild(draggableImg);
elementmask2.addChild(spMask2);
elementmask2.addChild(square2);
elementmask2.addChild(hline2);
draggableImg.mask =spMask2
this.container.addChild(elementmask2);


croppedImg.visible = false;
}




Thanks in Advance
micheladoms is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:47 AM.


Advertisement
Log in to turn off these ads.