ActionScript 2.0 :: Change BeginFill In Duplicated Mc?
Jan 14, 2006can I change the beginFill color in a duplicated movieclip?
Code:
this.createEmptyMovieClip('col1', 1);
with (_root.col1) {
[code]......
can I change the beginFill color in a duplicated movieclip?
Code:
this.createEmptyMovieClip('col1', 1);
with (_root.col1) {
[code]......
I have the same f() in frame 1 and frame 2, and when I play the movie again, it says f() dupliicated.How can change it in the second frame, not to be the same. Here is the f()
function onEnterFrame(event:Event):void{
domystuff; }
I have a template that I am editing. I have created new layers by duplicating an existing layer. The problem I am having is that anytime I make a change to a duplicated layer it changes the original as well. ie if I attempt to edit the action script on the new layer it changes the action script on the original? It seems as though they are linked and I can not find a way to unlink them??
View 1 Repliesi'm trying to have the text and position changed of a duplicated movie containing a text button. does any one knows how this would be possible?so you have the movie "options" thats being duplicated.in the movie you have the text named sub [code]probably basic actionscripting, but i've been trying more than an hour without any result.
View 1 RepliesIt seems like the random variables in my duplicated movieclips are all the same, any way to change this? To explain a bit more in detail: I got a movieclip with a few random variables and actions and I duplicate this movieclip and want the duplicate to have different random variables than the first one, but it gets identical ones.
View 7 RepliesI'm making a shape (christmas tree) which i can't make with rectangles and circles exc, so i made it with moveTo/lineTo, the problem now is that i can't "call" for it to fill the area inside the shape... how would you do it? Also, i hope i did this the wrong way, because its a really tiresome way of making it. What I've got so far is:[code]
View 3 Replies. As far as I could see in the reference manuals, the beginFill() method of the flash.display.Graphics class ends any previous incomplete (i.e., not ending back at the start point) fills by automatically drawing a line to the latest MoveTo() location.But, it seems it also ends any previous incomplete drawing even without fills, by drawing that final line.
But that's ok. The weird part is, even when I draw just one line and begin a fill immediately after that, I guess it tries to complete that line by drawing one more line back to the starting point and the messes up the display with the fill color in the following beginFill() call.
public class MyContainer extends Container
{
public function MyContainer()
{
[code]....
The output is as in the attachment.The first part creates a weird fill along the side of the line till the end of the container object.I even tried a endFill() at line 4, but same result. The only way to prevent this is to explicitly moving to some point as in line 11.
i have tried to fiddle about with it and i want to attach the wave movieclip instead of it using beginfill function.
View 1 RepliesI have a as file which basically draws a box around the bottom of your mouth and I am using a beginFill () function for the box. Basically I need to replace this fill with a bitmap image using beginBitmapFill () command. The trouble is I cannot find any resources that show me how to make the bitmap image wether it be a movieclip or graphic.
Also code (if it helps any) ActionScript Code: g.drawRect( r.x * scaleFactor, r.y * scaleFactor, r.width* scaleFactor, r.height * scaleFactor ); g.beginFill(0xFF0000); g.drawRect(r.x * scaleFactor + (r.width* scaleFactor)/3.6, r.y * scaleFactor + (r.height * scaleFactor)/1.65, 70, 40); g.endFill();
I have two questions about drawing shapes in action script 3.0, using graphics class (flash.display.Graphics):Question 1.When I draw some more complicated shape consisted of a few simpler shapes (i.e. two circles), and the shapes overlaps, the overlapped region is inverted (is rendered as a "hole"). Is there any way to avoid that?This is simple example of this behaviour:
var oClip : MovieClip = new MovieClip();oClip.graphics.beginFill( 0x000000, 0.5 );oClip.graphics.drawCircle( 150, 200, 70 );oClip.graphics.drawCircle( 250, 200, 100 );oClip.graphics.endFill();this.addChild( oClip );
I know,I can do it using separate beginFill/endFill sections for each circle:
var oClip : MovieClip = new MovieClip();oClip.graphics.beginFill( 0x000000, 0.5 );oClip.graphics.drawCircle( 150, 200, 70 [code]....
but then when I use alpha blending, the shapes are blended separatelly. Unfortunatelly, this is not correct for that what I want to do.I need to draw one beginFill/endFill session but without "holes" in the final shape, is it possible?Question 2.Is there an action script counterpart of the Flash menu option: Modify->Break Apart ?
the boxes are being added to the ready queue. what i want is that as soon as the box reaches to the right most position, i want a motion guide to follow, that is that the box should then enter into the CPU box and stay there for a specific point in time. this time will be determined by the burst time input.i only want the motion guide to happen to 1 box at a time when it reaches the right most position alont the queue.how will i be able to do this
View 1 RepliesI want two duplicated clips to do a hittest on each other. Anasteroid and a laser. I can use this. on one of the objects but howdo I pick up the name of the other object - it could be anything from
View 3 RepliesIs there a way to link duplicated movieclips to the library? Because I need to attach these duplicated mc's to an other mc. So my problem is that I don't have a linkage identifier?
View 8 Repliesthe "app" allows you to drag various movieclips onto a mc. On release the movieclip is duplicated.The question is: how can I set the parent mc of the duplicated mc? In this case the movieclip should be attached to "videoArea" SNippet
Code:
if(this.hitTest(videoArea)){
var duplicate:MovieClip;[code]....
I am trying to mask a duplicated mc.
I am attaching my .fla so you can take a look. The code is a bit long, but I marked the setMask code line with dashes (it's right on top). I marked out the setMask line so you can see how it looks like, because when I do mask, you can see any of the MCs that are being masked.
I search my problem in this forum prior to writing this. I got a thread that explains exactly what I needed to know; however, it doesn't work for me...I am trying to mask a duplicated mc.I am attaching my .fla so you can take a look. The code is a bit long, but I marked the setMask code line with dashes (it's right on top).I marked out the setMask line so you can see how it looks like, because when I do mask, you can see any of the MCs that are being masked.
View 3 RepliesI have tried using counters but didn't work.What i'm trying to accomplish here is to remove var b when a user choose another item on myComboBox subsequently, so that the selection before will not appear on stage...
Error received:
TypeError: Error #2007: Parameter child must be non-null.
at flash.display:isplayObjectContainer/removeChild()
at main_fla::MainTimeline/changeHandler()
[code]....
I am trying to get some actions on a duplicated MovieClip Now what I got is something like this:
Actionscript Code: I have some loop wrapped around this so the 'i' changes.duplicateMovieClip("target", "new"+i, 100+i);// I use 'i' because i need a few of those...for(i=0;i<somenumber;i++){_root["new"+i].onEnterFrame = function(){//actions}}
And it won't work. Logically it just makes MCs "new1" "new2" "new3" and so on.And then it checks for those.If i put a MC named "new3" on stage, it works. I guess i'm just stupid and doing the duplication wrong or something.
I'm getting frustrated with a project I'm working on. The problem I'm having now is trying to make a breadcrumbing list that is masked within an area like below.
Each breadcrumb is a duplicated movieclip that adds new text and resizes to fit the text as needed then moved over so that it is spaced evenly. All is well until the next duplicate which is beyond the mask area. When a duplicate is found to be beyond the right edge of the mask area, everything moves to the left so that the new duplicate will fit in its entirety. The whole thing blows up and releases all of the previous movieclips from the mask layer like below. I am using CS3 Actionscript 3 Publishing to Player 9.
I am an newbie trying to take an existing Flash game and modifying it for my own selfish goals. I am duplicating symbols and trying to preserve all of their actions so that I can then swap them out for my own symbols. When I swap, actions are preserved, but I have run out of symbols to swap, so now I am trying to duplicate the remaining symbol so I have more to swap with, but when I duplicate the actions are lost. I have adjusted the actions code to accommodate more symbols ( or at least I think I have)
View 8 RepliesI have attached a duplicate movie script action on a button to create a new copy of the clip (F900) with each press. This seems to work well; however, I can not, for the life of me, figure out how to create the script to remove the duplicated movie clipHere is the script I am using for the duplication and I did also attach the fla file:on (release) { _root.F900.duplicateMovieClip ("F900_"+"x", x ); setProperty ("F900_"+"x", _x, 300);setProperty ("F900_"+"x", _y, 200); x++;}Once I figure this out I would like to add different aircraft to it but that is not terribly important right now.
View 6 Repliesi'm trying to duplicate a swf loaded using greensocks LoaderMax but i don't seem to be able to
i'm using the following code:
private var _assetCache : Dictionary;
public function getAssetById(assetId:String):DisplayObject
{
var asset:DisplayObject;
[Code].....
if i simply return the asset from _assetCache (which is a dictionary) without duplicating it, it works and traces as a MovieClip but when i try to duplicate it, even though the traces tell me that the duplicate is a movieclip. Note the clip being loaded is a simple vector graphic on the stage of the root of the timeline
I have a MC inside a Masked area, when i click it i want to duplicate it and drag it out side the mask!My code works exept the MC is still inside the masked area!!Heres a bonus question: Why cant i remove the MC with removeMovieClip.. the duplicated-MC is inside another MC.
View 4 RepliesI'm very much a noob in terms of actionscripting (I use MX), and I was wondering if I could enlist your aid. For right now, I'm trying to get the hang of Duplicated MC's. Right now, my practice animation is like this: A one frame movie clip with actionscript tweening a black ball. Basically, my AS just makes it move to the right as it gets smaller and fades with alpha. This part works fine.
I put this above movie clip (ball, let's call it) in another MC. Now this MC (let's call it BallTween) has AS on it which duplicates the ball movie clip 30 times with a for loop (q is my incrementing variable). Now I read a tutorial on a forum that suggested using a mc = _parent['newball'+q] to control the duplicated movie clips as they are generated, but this doesn't seem to be working for me. Is there any really comprehensive tutorial on this kind of AS around? I would really like to get good at manipulating duplicateMovieClips. Does anybody have a simple way to do this from the ground up, instead of solving a problem in an existing flash project?
I've seem to have hit a snafu in a small animation I am creating for my next tutorial. What I have, is a movie clip that gets duplicated when the space bar is pressed. The movieclip has actions setup so that when the movieclip reaches a certain y value, it will remove itself via this.removeMovieClip()
The problem is, every movie clip that is duplicated does remove itself like it is supposed to. The exception is the original movie clip that I duplicate from. That movie clip seems to want to stay and cause problems (it is not removing itself because it isn't duplicated via attachmovie or the duplicateMovieClip method).
I use this code on frame 1:
Code:
topEdge = 0
leftEdge = 0
rightEdge = 550; //length of stage, CHANGE THIS
[Code]....
and it works great, but the flakes get duplicated even when i go to frame 2. What I would like is code to get rid of the movie clip
I cannot find a solution anywhere for this issue. Searching the forum yields: "The following words are either very common, too long, or too short and were not included in your search: name"
Anyway, the thing is this.
I duplicate a movieclip several times, which is a button, and name the instances c0, c1, c2, etc. I want to use substring to extract the number behind this name when someone clicks on one of these buttons. I have the following function in the button:
Code:
on(rollOver) {
x = substring(this._name,1);
ripples._x = coords[x].split(",")[0];
ripples._y = coords[x].split(",")[1];
}
As you may guess, I need the number in the variable x. However, the pointer "this" apparently points to the level this button is on (_level0), and not the button itself. So "this._name" gives me nothing.
My question to you all is, how do I obtain the buttons instance name the user has clicked on? Or for that matter, any other property. How do I address the button itself, from the on(XXXX) function?
The code to spawn the buttons is (in a loop):
Code:
duplicateMovieClip("clickdot","c"+x,x+10);
setProperty("c"+x,_x,coords[x].split(",")[0]-8);
setProperty("c"+x,_y,coords[x].split(",")[1]-8);
Obtaining the coordinates instead of it's name would suffice as well.
Everytime I press a button, my function duplicate's my MC and give's it a new name (artikel1, artikel2, arikel3...)This MC contains a dynamic textfield called "tekst".Now I want my function to change that textfield for every new duplicated mc something like this (mc1, mc2, mc3...)And thats the problem! I cant access the tekstfield from outside the mc ! i tryed something like this and manny more but nothing happend.
View 2 RepliesI have a clip, duplicated to realize the titles of a menu. How can i use these duplicated clips to load the submenus? (The submenu is another clip, duplicated using the numbers contained in the same array)
My script (or, i'd better say, Stringy's!) is:
/*
array: its lenght gives me the number of titles, each number inside the quantity of submenu for each title
*/
[Code]....
is there a posibility to target al of the clips (at once) i duplicated below?[code]
View 5 Replies