ActionScript 3.0 :: Fill A Created MovieClip?
Jul 22, 2011i have a movie Clip to stagei want give texture to this MovieClip!how i can ?it is not round MovieClip !!so i can't to Draw this by Drawing API methods
View 4 Repliesi have a movie Clip to stagei want give texture to this MovieClip!how i can ?it is not round MovieClip !!so i can't to Draw this by Drawing API methods
View 4 RepliesI'd like to fill the .graphics section of a sprite AFTER a series of lines and arcs are drawn. To draw the shape, I need to use a series of moveTo() and lineTo() statements, so the standard beginFill() won't work for me. The final shape will always be closed, but I don't have the lines/arcs in sequential order.
View 7 RepliesSay I draw a square on the stage, with a fill of blue and a stroke of black. My width and height are both the same. Now, in my Actionscript, I want to change that blue fill to something else.... on some off the wall condition of course.
Better yet, imagine I draw this extremly elaborate polygon out. How could I change it's fill, dynamically, in Actionscript (AS2 preferably, but I'm just lookin' for logic here)
I 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).
Since there is no actionscript function to set the registration point of a movieclip, I created a movieclip that I want to hold my image in my Project.fla file with a centered registration point I then add the movieclip to the stage in my Project.as file:var holder:Holder = new Holder();addChild(holder);The holder is successfully on the stage, and I now load my external image file that I would like to be inside of my image placeholder:var imageLoader:Loader;imageLoader = new Loader();imageLoader.load(new RLRequest("images/ball1.png"));addChild(imageLoader);What I am now trying to do is insert the imageLoader into my holder so that I can alter it as though the registration point is in the center
View 3 RepliesI have created a simple square shape by the following:
penName_mc.moveTo(0,0);
penName_mc.beginFill(0x6548D9,100);
penName_mc.lineTo( 50-startX,20-startY );
[code].....
If I give a movieclip or sprite a width, height, x and y, is there any way to use it a button with an event listener without giving it a fill of any kind?
View 2 RepliesI have a question about loadBitmap. I want to fill a movieclip with a tiled background but it looks kinda weird. It's all streched out. If I use Stage.width and Stage.height it looks great but of course it's not what I want since I want only that movieclip. I tried with a mask but then when I try to test myMovieClip._width it equals Stage.width.Here's my code:
PHP Code:
function tileBg(mc:MovieClip,w:Number,h:Number,bg:String):Voidtile:BitmapData = BitmapData.loadBitmap(bg); trace("TILE BG="+ tile); mc.beginBitmapF
[code].....
I have a movieclip that is only a blue square. However, i want to "fill" that blue square with a pattern made out of an image x.jpg (or x.png, whatever).
And i'd like to do this dinamically in AS3.
How can I fill a MovieClip with a random color using Actionscript 3?
View 13 RepliesI 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'm trying to get a movieclip fill color to change once clicked. I'm able to get the mouseover and mouseout working. But the click state isn't working properly.
Here's my code:
Code:
my_mc.addEventListener(MouseEvent.MOUSE_OVER, onFolderOver, false, 0, true);
my_mc.addEventListener(MouseEvent.MOUSE_OUT, onFolderOut, false, 0, true);
my_mc.addEventListener(MouseEvent.CLICK, showMovieclip, false, 0, true);
[code]....
When I use the above code, nothing happens once clicked. I tried using the color property, but, although that made a color change (black), it wasn't the color I had indicated (white).What I have is a movieclip ("my_mc"). Inside the movieclip are other movieclips. When one is clicked, only that movieclip ("my_mc.movieclip01"), is highlighted.
I 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'm trying to build a simple flash swf with haxe that shows the output of my webcam. I want to swf to be embeddable and the size to be determined in the html. So my html looks like:
<html>
<head><title>Web cam</title></head>
<body bgcolor="#dddddd">
[Code]....
This creates the swf file that shows the webcam output but with some big white bands on the right and bottom. I want to make the webcam image to fill all the flash object size.
I am trying to fill a movieclip with a gradient going from black to white. Below is my code, which doesn't work:
View 1 RepliesIit works but it's just not perfect. Ihaven't played with flash since MX, things have changed a bit. Here is the online sample: [URL]. If you want the source it here: [URL]. So I would like to learn how to create an if / else function to control the height of a MC. i.e. This externalMC I used is 900 X 500, so divide 900/500 = 1.8:1 (or .5556:1) this gives you your relative ratio. Then just multiple the width of 75% of stageWidth by .5556 to get the proportional width, the problem is once the browser windows height is resized to <= 500. it stops.
Code:
Select all/*Resize*/
holder.smoothing = true;
var mainStage:Stage = this.stage;
mainStage.scaleMode = StageScaleMode.NO_SCALE;
mainStage.align = StageAlign.TOP_LEFT;
function initialDisplay(evt:Event):void {
[Code] .....
The subject pretty much sums it up; I have a bunch of movieclips on the stage, that are already filled with a bitmap pattern in the IDE. Now I need to fill them with another pattern once they are clicked, and I can�t seem to figure out how to do it.This is the closest yet, but i just get a recangle with the new pattern behind my selected mc. I realize that the rectangle comes from the drawRect method (duh) but I cant seem to find something the will allow me to fill the entire movieclip with the new pattern.in District.as
Code:
public function doSelect(){
_selectPattern = new SelectPattern(0,0); //class from my library
[code].....
In part of my actionscript i'm using: thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth()); to create a seperate movieclips for ewach image in my xml file. How would I then attach another movieclip to each of the newly created ones? ie thumbnail_mc.t0, thumbnail_mc.t1, thumbnail_mc.t2... is there a way to do it automaticall7y or do i have to assign it to each one individually? "thumbnail_mc.t"+k.attachMovie obviously doesn't work
View 11 RepliesI need to fill some movieclip with an external image in AS3. I know how to use an image contained in the FLA's library as background filling, but I don't know how to do this with an external loaded image.
View 3 Repliesthis should be a pretty simple one. I am trying to dynamically generate a movie clip, attach a movie clip from the library and then animate a tween but for some reason, even though the name is being generated dynamically to be different every time and each new MC is put on a different depth, the first movie clip disappears once a new one is generated. Here's my code:
[Code]...
I have a function that appends 7 movieclips to the timeline in a loop. The name of the clips is generated automatically:
[Code]...
I've created a movie clip. Loaded an image and added it to the movie clip. Then added the movie clip to the stage:
var one:MovieClip = new MovieClip();
var firstTestImage:Loader = new Loader();
firstTestImage.load(new URLRequest("testImage1.png"));[code]............
Now I want the movie clip to have an eventlistener that will trace when clicked:
one.addEventListener(MouseEvent.MOUSE_DOWN, linkto);
function linkto(event:MouseEvent):void
{[code]..................
I have a movie containing a movieclip in which an empty movieclip is created with AS, showing an externally loaded pic. At the click of a button I want the pic to unload again, but it doesn't work. I tried removeMovieClip and Delete.
View 3 RepliesI've created a movieclip using actionscript and the output recognizes the MC, however, I am unable to see it. Here's the code:
[Code]...
I intend to apply a linear gradient via actionscript to an image (.png) with transparent areas. Of course, I previously converted this image to a movieclip. So I actually want to apply the gradient fill to the container movieclip, which has the instance name of "flower". Here's the code:
[Code]...
There must be something wrong with my code because nothing happens when I call the myFunc() function. the more time I'm spending on trying different variations of these variables, the more frustated
this i have this code at the moment and i want to add a hittest to the "bullet".i have created.[code]but this doesn't seem to work.
View 3 RepliesI have two character to choose from, so I created two movieClip to contain the character max and luna. When I choose the desired one, it's added to a hero MovieClip. It works, the hero acts as a container and it is referred for the movements by the keyboard event. Now I want to target hero.character.gotoAndPlay for the animation in the timeline of the character movieClip in the Main class, but I can't do that. I tried to trace the instance character.name but it won't do the trick it throw the same error :
TypeError: Error #1010: A term is undefined and has no properties. at Main/fl_MoveInDirectionOfKey()
[Code]...
For AS 3
I have a class which crate a panel with close button. and i create an instance of this class like this
function _smallThumbClick(evt:MouseEvent):void {
var _popup:Popup=new Popup( square.width ,evt.currentTarget.y, evt.currentTarget);
addChild(_popup);
}
and this mouse event from the thumbnail(suppose), so if i click on the thumb it will create popup. so i want to close all other or previously opened pop window.
How do u get the popup class object to close from another class..
or is there any alternate method for detect instance of the movieclip or class..
I have a horizontal scroll bar that I need to appear to loop around continuously. I've managed to get it moving on its own since the last time I posted, however the loop is proving more difficult.
The move function is here:
Code:
public function movemouse() {
lst.onEnterFrame = function () {
var speed:Number = -1;
this._x += speed;
[Code].....
resizing a movieclip created with createEmptyMovieclip.I tried changing the property using setproperty,the result : no image shown at all.. i think i stting a property for a wrong movieclip.....
Code:
addressVars= new LoadVars();
addressVars.load("http://localhost/test/flashmx_dbPassReturn.php");
addressVars.onLoad = function() {
[Code]....