ActionScript 3.0 :: Fill A Rectangle With The Texture?
Jan 19, 2009I Would like to draw the texture that I've got stored in/as a bitmapdata. I hoped to be able to fill a rectangle with the texture. Is ther a easy way to do this?
View 1 RepliesI Would like to draw the texture that I've got stored in/as a bitmapdata. I hoped to be able to fill a rectangle with the texture. Is ther a easy way to do this?
View 1 RepliesI am trying to create small flash application which would allow me to fill movieclip with different texures/bitmaps using actionscript. It should work something like this:Click herebut instead of fill with different colors movieclip should be filled with different bitmaps/textures. I have find tutorial for changing colors but not sure how to realize this to change textures.Perhaps there is some other solution beside using actionscript for which
View 2 RepliesI've searched for it on Google many times, but without any sucess. What I want to know to how to do is, to fill a movie clip with texture (overlay), throught AS3.
View 2 RepliesI've seen that it's possible to format a specific bit of text in a text field with:setTextFormat(format:TextFormat, beginIndex:int = -1, endIndex:int = -1):void
I need to format a section of text by applying a texture to the rectangular fill space around the letters. (Imagine in Microsoft Word that you've written a short sentence and you highlight it. Then you fill the text background with a colour. Then imagine that that colour is a single repeating texture. That's what I'm trying to achieve.) Note that the text field must be multiline, and I'm not looking to fill the whole rectangular text field area. The applied texture needs to fit to each character. Is this possible in Actionscript? Would I need to use some kind of HTML or CSS formatting? Is it possible at all? If it is possible, is it possible to change the size of the fill area around the text?
if it were possible to apply a tiled image fill to text to create a texture.
View 3 RepliesI am trying to draw a line from x1, y1 to x2,y2 and i want it to be a line that repeats a pattern from an image. All I can see is that you can only draw lines and change their color or thickness but I would like it to repeat an image. Is that possible or do i have to use a really long and thin rectangle with a bitmap fill?The problem is I am making a game where the user will be able to actually draw the line so i have to make it be created dynamically. The game fantastic contraption [URL] has in the game a feature where you draw lines of any length and position that are filed with a picture.
View 13 RepliesAnyone knows if it's possible to fill a rectangle with a bitmap with action script?
View 12 RepliesI have a normal rectangle shape in flash. Id like to change the fill color of it using code, so I can use flashvars and be able to change the color of the shape with a few HTML adjustments.All I need to know is how to change the fill color of the shape. I've got the flashvars sorted.
View 1 RepliesI know that this could be solved a bunch of different ways, but I feel like I'm on the wrong track. [code]...
View 3 RepliesHow to make boundary fill in flash, like paint brush. If I click on any position bounded area will be filled with particular color. I have tried to make it
import flash.display.Bitmap;import flash.display.BitmapData;
var bmd1:BitmapData = new BitmapData(20, 20, false, 0x00000000);
var bm1:Bitmap = new Bitmap(bmd1);this.addChild(bm1);
function boundary_fill(x:Number, y:Number, fcolor, bcolor){
[Code] .....
I have rectangle now I want to fill it with red color but it show attach overflow error .
Can i change the fill color of an existend rounded rectangle primitive?[code]
View 7 RepliesFor those of you still with me, I am tasked with making some scrollable content in Flash. Load in a TextFile using LoadURL(), then display it. To get the text, we've written our own class TextFieldExtended, which is basically just there to give the textfile location to the constructor and then have the class do the various steps of getting it and loading it for you.So I needed to get a Scrollbar, which I got hereThe thing is, it works with Sprites.After trying to get it to accept TextFieldExtended, I bumped into a block, since the scrollbar relied heavily on a Sprite property that TextFieldExtended didn't have or could have.
So I tried adding the TextFieldExtended instance to a Sprite instance using addchild.A problem occurs here that I do not know how to handle. It seems that a Rectangle is drawn and the Text is drawn on that. I say this because the scrollbar moves the Rectangle up and down a bit, but the text doesn't scroll, just the Rectangle it is positioned in and the text then moves along with it.My question: can this be fixed, or is does this implementation of scrollbars need a lot of adaptations before this is possible?
I am new to flash, trying to do some animation character. I have 2 queries
1. What is lock fill; whenever I am trying to fill a color, it shows lock fill....
2. If I am creating a non regular figure like say with pencil, if I draw some part of it & do other part by later; these will be assumed different objects & I am not able to fill the whole figure with a selected color.
I draw a rectangle i should see a little bold circle to indicate a perfect rectangle, I seemed to lost mine, can somebody please tell me how to get it back!
View 2 RepliesI am trying to convert a rectangle(actually multiple rectangles) to a curved rectangle. I think it should be pretty easy but I guess i am stupid. Basically I would have a start position and stop position (many of these), and they would be converted to curved rectangles and follow in a cicrle around.
View 0 RepliesI would like to create a rectangle inside of a rectangle, starting approximately 15% inward from the right side of the other rectangle.
I know how to create rectangles with:
Code:
var newHotRect:MovieClip = new MovieClip();
newHotRect.graphics.beginFill(0x00FF00);
newHotRect.graphics.drawRect(0, 0, 100, 100);
addChild(newHotRect);
But how would I make another rectangle on top of that (the black one pictured) that is approximately 15% from the right?
I toyed around with .right, and .bottomright with no success. Can anyone lead me in the right direction? or even finding the x and y of the upper right or bottom right side of a rectangle?
how to respond when a rectangle hits another rectangle? I already know how to detect the collision, I just don't know how to respond to it. I'm just trying making a simple side-scrolling platform game where I have platforms I can walk on and bump against on all sides. I have searched everywhere and just can't find the tutorials I'm looking for.
View 6 RepliesI have a scratch card. Basically I'm masking a movie clip with an empty shape. I can draw on that mask and thus my movieclip will become visible. I have also attached the fla.
Now what I would like to achieve is that when you fill a percentage of that mask, let's say 70%, I automatically fill the whole layer so that all of my movieclip becomes visible (as mask is fully filled).
I'm an animator and have always drawn with pen and paper (old schooool) and then coloured using photography in photoshop. I'm just starting a new project where I'll be using flash for the animation.
Question: If I am illustrating using the pen tool (black stroke), how can I easily colour each object with photography? As I am such a beginner the only way I know is to animate my sequence(s) then export a pdf sequence, and subsequently colour each frame individually in Photoshop.
I am becoming crazy because I really don't find a way to preload the texture image which is automatically loaded by the DAE class.
All that I want is to display the progression of the image loading, before displaying the DAE.
how i could create a background like this site has [URL]
You see there is a little texture in it, and the texture matches every screen size. The gradient effect is no problem but how can i make the texture also match every screensize?
Now I'm trying to use molehill to accelerate my collision detection effeciency, and I found out there is a function called setRenderToTexture that I can use. However, when I get a texture from that function, I cannot access pixel data in it. Does anyone knows how to deal with that, or is there another way to use molehill to do such general-purpose computation?
View 1 Replies[code]...
That is changing colors (the ARRAY_COLOURS have [ 0xFF0000, 0x0000FF, 0xFFFF00 ])
I would like to have instead of that something like ARRAY_COLOURS[ IMAGE1, IMAGE2, IMAGE3 ]
Here i am looking to apply the texture to the Text and Movie Clip dynamically.
View 2 RepliesI have a problem: i want to let users edit the texture of a collada object(it is a bottle, a cocacola bottle). After loading collada object, is it possible to let user edit texture of it(upload their own image as texture)?
View 1 RepliesI want to parse a dae file for getting the texture name. But when I am trying to read dae as xml it read the entire dae file but the problem is that I can't access it's elements
My Code:
package{
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
public class XMLReader{
[Code] .....
i'm trying to achieve the effect of a rotating sphere given a regular 2D texture. the best thing i've seen is a tutorial on emanueleferonato.com which gives this result: emanueleferonato dot com /downloads/mapping09.swf as you can see, it works pretty well when you're moving left/right OR up/down. it fails to simulate realistic rolling when going in any diagonals (since it's a very simplistic illusion). how to render such a sphere given any point on a mercator projection and then have the sphere rotate in an arbitrary (but fixed) direction? this is a bit advanced math stuff.
btw, if anyone's interested, i figured a better displacement map than what is used in the link i showed
i started my search again and immediately bumped into this: [URL] it's library called BitmapSphere and it does exactly what i need it to! also, could admin edit this and put together the link or something? i find it highly annoying that i need 50 posts before being able to post a link
I have an image of a handbag. I want the user to be able to click on a fabric image and change the fabric on the handbag to whatever they selected. How to change the image texture in photoshop. Would I first have to make the change in photoshop, then somehow create a movie in flash that places those images in the .fla file. Or will flash do it all for me. That is wrapping the texture around the image each time a new one is selected.
View 2 RepliesIs there such a thing as taking a screen, copying it to bitmapData and then angling it as if in 3D perspective... in AS2 ? I know AS3 in CS4 can do this, but I am stuck working in AS2. I've used Bitmapdata before, but only for 2D manipulations.
View 2 RepliesI would like to combine bitmaps to one texture and apply it to a cylindric primitive. The cylinder will be rotating or better: the texture should moving along the cylindric-surface and therefor you should see only one (up to 3 textures at the same time). For better understanding: it's my intention to create somehow a poster-pillow with a undefined number of posters on it. By clicking on the pillow, it should rotate to the next poster but you will see always parts of the previous/next poster.
My question is: How can I load the texture dynamically but also how to combine, load/unload posters on the run ?