ActionScript 3.0 :: 3d Transform A Sprite's Mask

Jun 3, 2009

I may have hit a limitation of DisplayObject's "mask" property. I have one Sprite that is filled with a pattern, and is the size of the stage. I have another sprite that is smaller, is filled with a solid color, and is rotated a bit on the Y axis. I am trying to mask the "pattern" sprite with the smaller sprite. It works fine when the smaller sprite is not rotated, but as soon as I rotate it, the mask no longer works.

Assuming this was some kind of limitation, the only solution I found was to use bitmaps, drawing each sprite onto a corresponding bitmap, and then copying the mask bitmap's alpha channel onto the pattern bitmap. Is there a better way? I would basically like to use 3D transformation to create a shape, but I want the fill pattern to be a 2D bitmap that is not transformed with it.

View 1 Replies


Similar Posts:


Actionscript 3.0 :: Color Transform On Sprite?

Sep 20, 2010

I've done color transforms elsewhere but I can find an example, and I'm pretty sure they are very straight forward... yet. I keep getting this error:1119: Access of possibly undefined property ColorTransform through a reference with static type flash.geom:Transform.

View 1 Replies

ActionScript 3.0 :: Transform And Distort Sprite Which Has Bitmap Childs?

Nov 7, 2010

I wanna transform and distort my sprite which has bitmap childs from this ._ |_| To this .._ /__

View 3 Replies

Flex :: Any Way To Show Sprite That Is Doing Mask?

Jan 1, 2010

I have two sprites, the first is the mask and the second on is going to be masked by the first. Right now I can see the second sprite that is masked, but not the first that is doing the masking. Is there a way to show the sprite that is doing the mask?

View 3 Replies

Flash - Setting Mask For Sprite?

Sep 12, 2010

So i have this sprite that is say arbitrarily 100 x 100 which is added to the stage. Now when content is added to this sprite the sprite expands automatically as it should. I dont want this to happen, what i want is to set a defined boundary i.e. 100 x 100, if too much content is added i can be able to scroll it. My problem is i cannot add a mask to the stage like the conventional way because i have many other boxes like this that vary in dimensions and number. I found a way i can do this but its very inefficient, what i did is i created a movieclip filled it say 100x100 with some color then instantiated it. Next i added the sprite and if content overlaps it wont be visible, only 100x100. I sort of stumbled on this and dont know exactly why this works. Any help is well appreciated, thank you.

[code]...

View 1 Replies

ActionScript 3.0 :: Using 3D Animated Sprite As Mask

May 4, 2010

Being a complete beginner in AS3 (and coding in general), I'm trying to do the opposite of what's seen in this swf (I'd like to have the spinning logo filled with the background colors): [URL]. I was thinking of a very simple way with this kind of code:

ActionScript Code:
var i:int=0;
var logo_vector:MovieClip=new LOGO_VECTOR();
logo_vector.x=192;
logo_vector.y=140;
//logo_vector.cacheAsBitmap=true;
[Code] .....

But while a logo_vector.rotation makes the logo spin around the Z axis and works, the rotationX gives a black screen. AS I could see the logo appearing onone frame, I thought that caching as bimtap on each frame would do the trick but it doesn't. I tried to put the logo into another movieclip but still no chance.

I thought about drawing the logo into a new bitmap as well, and then do a work on the pixels directly to have an opaqe background and the black logo transparent but there again, I can't get the logo position to refresh properly (and can't get it to be in the center of the bitmap).

I tried to copy the sprite into a bitmap:
var masque:BitmapData=new BitmapData(384, 282,true,0x00ffffff);
var masque_bmp:Bitmap=new Bitmap(masque);
and
Masque.draw (logo_vector);

In the Enter Frame function but I'm getting an empty rectangle and if not used as mask, the graphics are not refreshed)?

View 0 Replies

ActionScript 3.0 :: Line Games - Transform A Line Drawn By The Player Into A Hit Detectable Sprite ?

Feb 13, 2009

I'm trying to work out how to create a simple demo that works as follows: A ball falls from the top of the stage.Player is able to draw a line anywhere on the stage. The ball will bounce/roll along the line such that the player can guide it at will. I don't think the coordinate rotation will be a problem for me but I can't figure out how to transform a line drawn by the player into a hit detectable sprite -- or realkly any way that I can get those line coordinates into my coordinate rotation routine. To keep it simple, I'm just working on the first part of the problem, getting the line to where I can hit test or know its position.Here is my code so far:

package
{
import flash.display.Sprite;
import flash.events.MouseEvent;[code]........

It always traces 0,0 instead of my current line coordinates - and even those I don't think would be sufficient.

View 4 Replies

ActionScript 3.0 :: Flash Sprite Gradient Mask AS3

Sep 10, 2010

I have created a Sprite that contains 3 movieclips that act as masks for another movieclip. 2 of the moviclips have an alpha gradient but I cannot get the alpha to work. I have the three masks because they are separately animated.Here is my code.

var maskContainer = new Sprite();
maskContainer.addChild(WebPageMaskEndT_mc);
maskContainer.addChild(WebPageMaskEndB_mc);[code]....

NOTE: I have also tried setting cacheAsBitmap for the 3 individual masks but no results.

View 2 Replies

Web Development :: Saving Image Out From Beneath Mask From Within Sprite

May 31, 2011

I've got a sprite object that gets a custom shape loaded into it, that gets used as a mask so as to cut out a custom shape from an image that is loaded in with a loader object - The loader(loada) and shape(lines) objects are both children of the sprite object - I've added code to save out the image from beneath the mask but when the save function is called nothing is saved out, and no errors are thrown.[code]

View 1 Replies

Flex :: Draw Sprite Into Bitmapdata With A Strange Mask

Apr 14, 2009

I have run into strange behavior drawing a sprite into a BitmapData. This sprite looks fine when drawn directly to the screen. But when this sprite is drawn into a BitmapData, the sprite is being masked... but there is no such mask applied to that sprite! This "bad mask" can be toggled off and on... by applying / not-applying a different mask to the sprite I am drawing. This mask is not the same shape or location as the "bad mask".

[Code]...

View 1 Replies

ActionScript 3.0 :: Loading In An External Image That Can Transform With The Senocular Transform Tool Class

Jun 26, 2009

I'm having trouble with loading in an external image that I can transform with the Senocular Transform Tool class. I have managed to load in the picture but the transform class doesn't seem want to grab it. Eventually I want to us the FileRef to upload the image but I just need to figure out how it works first. Here my code to load in the external image

[Code]...

The transform class can grab the other movieclips but it doesn't want to grab the new image loaded in from the code above.

View 1 Replies

Actionscript 3.0 :: Using A "3D" Animated Sprite As Mask?

Nov 16, 2009

I'm trying to do the opposite of what's sen in this swf (I'd like to have the spining logo filled with the background colors):I was thinking of a very simple way with this kind of code:

Code: Select allvar i:int=0;
var logo_vector:MovieClip=new LOGO_VECTOR();
logo_vector.x=192;
logo_vector.y=140;

[code]....

but while a logo_vector.rotation makes the logo spin around the Z axis and works, the rotationX gives a black screen. AS I could see the logo appearing onone frame, I thought that caching as bimtap on each frame would do the trick but it doesn't.I tried to put the logo into another movieclip but still no chance.

I thought about drawing the logo into a new bitmap as well, and then do a work on the pixels directly to have an opaqe background and the black logo transparent but there again, I can't get the logo position to refresh properly (and can't get it to be in the center of the bitmap).

View 1 Replies

ActionScript 3.0 :: Alpha Mask - Area Of The Loader Outside Of The Mask Will Visible When The Mouse Is Down

Sep 10, 2010

I have a startDrag function set up on a loader and mask that when the mouse is down on the loader it drags, when not it doesn't. There is also 2 buttons that control whether mask1 or mask2 is used. What i would like however is when the mouse is down - the area of the loader outside of the mask is visible but only by about 10/20% alpha, that way the user can see where all the image is while dragging. Is this possible? Full code can be seen below and i have attached the zip with the .fla file:

[Code]...

View 2 Replies

ActionScript 2.0 :: Scriptable Mask - Large Mask Behind The Whole Of Flash Site?

Aug 19, 2003

what i am doing is to make something along the lines of the "scriptable mask" tutorial Inigo was kind enough to put up.My idea is to have a large mask behind the whole of my flash site, this masks a colour image with a black & white one (nothing tricky). The image I am using is actually 5 separate images combined, and each is a pic of certain parts of the site.I also have a very basic set of buttons along the bottom... each corresponding to each section.

All I want is to set it up so that when I mouse over the buttons, the _x of the mask moves to correspond with the correct image... really very basic... or so I thought .If anything it should be easier to do than what is in Inigo's tut (where he uses the _x of the mouse to move the mask)... i just cant seem to get it to work with a nice easing effect (its easy to get the mask to simply snap to each coordinate, but I need it to smoothly move).

View 4 Replies

Actionscript 3 :: Class Extending Sprite - Set The Sprite's Width And Height Properties?

Mar 5, 2010

I created a class, extended the sprite class, and now in the constructor I am trying to set the Sprite's width and height properties which are inherited from the DisplayObject. However, after I set this.width and this.height, and print the values, I get 0 for both.

What the heck is going on? When I view the livedocs I see that DisplayObject has width and height listed as public properties. I have been able to instantiate a Sprite directly, and set the width and height after it's been instantiated, so I don't get it.

package {
import flash.display.*;
public class ScrollBar extends Sprite {[code].....

View 1 Replies

Flash: `sprite.visible = False` Doesn't Hide Sprite Immediately?

Apr 4, 2011

I've got a sprite which I want to temporarily hide... But changing the .visible property doesn't do what I expect. The code looks roughly like this:

[Code]...

View 1 Replies

IDE :: Adding A Single Sprite On Main Moviclip Sprite Remains Invisible

Mar 2, 2009

I created a new AS3 document (550px by 400px) and added the following code to the first frame.

However, when I run this, I see nothing painted on the screen at all, the screen remains completely white.[code]...

View 3 Replies

Create Own Mask Around A Jpg Image By Drawing Around It On The Mask Layer

Dec 4, 2009

maybe point me towards a better way to mask. png file is way too big. I have been using the mask layer option to create my own mask around a jpg image by drawing around it on the mask layer. There has to be a fetter and faster way to do this. Is it possible to maybe have a specific color range have an alpha value of 0. Similar to green screening whereas If I put the item I want to clip on a green background flash will auto take out the green for me. and by auto I mean action script maybe. I think this can be done but im not finding it.

how are these guys clipping these images [URL] they have the movie clips set up where the black background on the 3 layers of shoes is getting masked out. When I go into the shoe movie clips I see there is a black background but it just disappears when I go back to main timeline.

View 3 Replies

ActionScript 3.0 :: Shape.mask=mc.mask In As File Not Working

Apr 8, 2010

ive gotten one movie clip to mask another in the actions frame but i cant seem to be able to mask the flames which are a shape with a movieclip in this as file. im not getting any errors but the mask isnt covering anything look near the bottom at s.mask=mask_mc; there are about 20 "s" shapes spawning per second if that has anything to do with it

Code:
//this package turns an mc into a flaming button that calls a javascript function
package
{
import flash.display.MovieClip;

[Code].....

View 3 Replies

Flash :: Rotating Sprite Moves The Sprite From It's Original Location

Jul 6, 2011

I'm doing a simple rotation on a sprite but there's a weird behavior where the sprite does not rotate around it's top left. I think I'm rotating along the top left of the test class instead of the sprite child. I would like to rotate the rectangle around it's top left corner (kinda like a clock hand). The code is pretty short so I'll let the code + pictures explain my problem:

package
{
import flash.display.Sprite;

[Code]....

I've read a lot of stuff about rotating around a fixed point, I've tried doing it with movieclips instead of sprites, I even copy pasted a tutorial on rotation and nothing works.

View 3 Replies

ActionScript 3.0 :: Sprite.addChild(NumericStepper) Resizes Sprite To 100x100

May 27, 2008

[Code]...

Then the numericStepper is drawn as if it is squished to 20% its normal height. If I pre-set mySprite width and height before adding the numericstepper, the trace output is 0,0 after adding it and it is not displayed at all. Is there some way I can make the sprite only adjust to correctly fit the numericStepper OR resize it afterwards without distorting the numericStepper component?

View 2 Replies

Actionscript 3 :: Difference Between Sprite.width VS Sprite.scaleX?

Sep 23, 2011

Both of sprite.width and sprite.scaleX can be used for scale a sprite. Is possible sprite.scaleX depends on screen size?

View 2 Replies

ActionScript 3.0 :: Sprite.graphics And Setting Sprite.width?

Jun 19, 2009

It has been a great resource of the years. No my problem. I am trying to dynamically resize a sprite that has a line drawn into it. Here is my code:

[Code]...

View 4 Replies

ActionScript 3.0 :: Possible To Mask Multiple MC Or Sprites Under One Mask?

Nov 26, 2009

I was wondering if its possible to mask multiple MC or Sprites under one mask, when using AS3.abc.mask = a;cba.mask = a;something like that

View 2 Replies

ActionScript 3.0 :: Mcproduct Sprite And Mcproductpane Sprite?

Aug 15, 2010

first i have 2 sprite.. it`s mcproduct sprite and mcproductpane sprite . mcproductpane is a parent of mcproduct sprite.. so inside mcproductpane there a several mcproduct sprite.this is a script of mc prodcut

PHP Code:

[Code]...

The problem is i want to set a button in here(mcproductpane sprite), this button will unload / make dissappear an image that i load using loader class in mcproduct sprite..how can i make this happen?when i want to make a button in mcproductpane sprite which the function of the button it`s to unload/make an image that i load using loader class in mcproduct sprite disappear.

View 1 Replies

Actionscript 3 :: Drawing - Cut A "hole" Inside A Rectangular Sprite To See The Sprite Underneath?

Feb 3, 2010

Everytime I google this question I see confusing information about masks and blends, none of which seems to directly apply to what I think should be an easy thing... There are three Sprites involved here...the lowest layer sprite is pretty much a background. I want to overlay a translucent Sprite on top of the background and then I want the third, top-most Sprite to act as a hole, so that the area inside the third Sprite is completely transparent, so that the background sprite is completely visible. How would I go about doing this dynamically (i.e. dynamically drawing the masking sprite and hole using the Actionscript graphics calls)?

View 4 Replies

ActionScript 3.0 :: Set The Height Of The Sprite Depending On The Height Of An Textfield Inside That Sprite?

Feb 2, 2009

Is it possible to set the height of the sprite depending on the height of an textfield inside that sprite? I'm creating a box with a textfield inside it, but I want the box to be sized depending of how much text it is in the textfield..

View 9 Replies

ActionScript 3.0 :: Remove A Sprite Object When Another Sprite Object Hits It?

Mar 23, 2011

I have a brick class where I have created a rectangle using flash.display.graphics.I am using this brick class to create a grid of 10 X 10 in another class called grid using new brick() in a for loop.I have another class called ball where I have created a circle with flash.display.graphics.The problem is that I want to remove / destroy individual bricks when the ball hits the bricks on Event.ENTER_FRAME which is not happening.the error I get is shown only for the last brick that is created in a for loop.ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

at flash.display:isplayObjectContainer/removeChild()
at grid/ball_movement()// my function in enter frame event
The code I wrote in ENTER_FRAME is

[code].....

View 3 Replies

ActionScript 3.0 :: Remove A Sprite Object When Another Sprite Object Hits It

Mar 24, 2011

I have a brick class where I have created a rectangle using flash.display.graphics.I am using this brick class to create a grid of 10 X 10 in another class called grid using new brick() in a for loop.I have another class called ball where I have created a circle with flash.display.graphics.The problem is that I want to remove / destroy individual bricks when the ball hits the bricks on Event.ENTER_FRAME which is not happening.the error I get is shown only for the last brick that is created in a for loop.[code]

View 1 Replies

How To Transform An Image

Jul 18, 2009

most 3d picture wall animations do this. how do i make the transformation in flash, either by hand or by action script or both?

e.g. initial image the transformed img (the entire image should take the form of trapezium) transformed image should not be like this- in this case, parts of the image is cut off in the black parts.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved