ActionScript 2.0 :: Duplicating MC And Moving It?
Aug 12, 2004
i have a battlehsip that launches torpedoes. i want the gun of the battleship to aim (not perfectly but not way off so the gn can have 8 directions instead of every direction. [ignore this if u dont know what i mean]) the gun aims near the shark and launches a torpedo.i need the battlehsip turret to aim at the shark and duplicate torpedos and have the torpedos launched near the shark. and i need it to move toward the shark.
View 2 Replies
Similar Posts:
Nov 2, 2010
im currently making an "AS3 beat em up" ala streets of rage or double dragon.Currently i have my character moving and a few animations done and i am trying to figure out how to make attacks work.I have some "basic" animation for his attack, but im not sure how to get it to work correctley.What happens is, if you press control (the attack button) whilst the character is walking he just keeps moving and is stopped on the attack frame.I want the character to stop moving if the attack is pressed and once it is released start moving again.
hero.gotoAndStop('still');
var left:Boolean = false;
var right:Boolean = false;[code].......
View 2 Replies
Jan 30, 2012
what i have is a tween on a movie clip of a popcorn kernel on one layer and a tween on a button on another layer to follow the movie clip. i want to be able to roll over the kernel and make it "pop". i changed my over on the button to popped corn (this works) but i want it to stay popped for the rest of the tween.
View 11 Replies
Apr 22, 2007
I want to know how i can moving my scene by moving a mouse over them.
to understand what i want exactly ckeck this link :- [URL]
View 1 Replies
Nov 28, 2010
I have some simple script that has 2 "movie clips". What I want to do is to start moving the second movie clip at the same time when the 1st starts moving. (both start moving at the same time) I tried the following script but it never works:
[Code]...
View 3 Replies
May 19, 2009
I am tring to create a movie clip in which different coloured birds are flying..I am tring to duplicate two or more MovieClips at the same time..but only either of them WorksHow should I modify the code so that I can achieve that ?
PHP Code:
function birds() for(m=1; m<=10; m++)
{firstEnem y= "bird"+1;
[code].....
View 2 Replies
Jul 31, 2009
im having a problem duplicating more than 1 mc in my flash movie here's my code which is meant to duplicate it 1 time.
Code:
function createEnemy ()
{
i = i + 1;
[Code]....
View 2 Replies
Nov 26, 2009
As the tittle suggests i have some trouble with Duplicating movieclips in a masklayer. The mask works but it wont duplicate. Also when i turn of the masklayer and use it as a normal layer the duplicate works perfectly. cant find any reason why it wont work.
View 0 Replies
Jan 27, 2010
I am working on an Augmented Reality project .. This is the code that is called when the marker makes contact with the webcam.
[Code]...
Every time I remove the marker and put it back in view .. this script is called and is causing the action to duplicate itself over and over each time the marker is present. How can I do some sort of check to see if this is already added so that it wont duplicate ?
View 9 Replies
Feb 10, 2011
Here's the deal... I built a dynamic image gallery that runs hoizontally, and the idea is tu duplicate it and, when it reaches a certain point, use it's duplicate, so that there's the illussion of a "never ending" gallery.The problem is that, when duplicating the movieclip, it appears empty, even though I duplicate it after having loaded every picture.
View 8 Replies
Apr 13, 2003
I have two small dots (stars) that I want to duplicate. I have created a function-[ [code]I placed the function on a blankMC in the onClipevent (load) section. In the onClipEvent (enterFrame) I have placed a setinterval command [code]Now this waits 8 seconds and then creates a massive amount of duplicated stars - more than I want. I had just put the duplicate movie bit in a movie every couple of frames and that did what I wanted but I am trying to challenge myself and use functions and code.
View 2 Replies
Apr 9, 2006
Whenever I make a code to duplicate anything in a reaction to an action, i get the problem of having my initial duplicated mc destroyed upon re-duplicating (you fire bullets and the one shot before the last always disappears and so).The thing is, if you take kirupa's "How to Fire"-tutorial, download the source and run it, the thing works like a charm. However, even if i copy every last single bit of code and content to a new document, the duplication process acts as described above.In addition, here's a quote from the tutorial "How to Fire" [url]
explain how on earth one would get "_level0.bullet" from something the likes of "trace(this._name)", which, of course, returns the instance name. Which would, in the aforementioned tutorial's case, be, in fact, "bullet". Not "_level0.bullet". He states "It's not the instance name"... Well, what the heck is it then? The result of the trace in question varies relying COMPLETELY upon the given instance name. If you write "Bratwurst" as the instance name, you get "Bratwurst" from the trace, as god is my wittness.
Even if i remove EVERYTHING from the code that even COULD, by the user's will, remove the duped mc, the initial problem remains. You can only fire one bullet at any given time, other(s) disappear.It's most propable that there's just something i've missed completely, and end up making myself looking like an ***, but still.For those who want a code, just take a look at the tutorial (the URL above). Everything's basically the same. I would also appreciate if someone were to try what i've described, which is to copy everything from the tutorial .fla and placing the stuff on a fresh document.
View 1 Replies
May 2, 2006
I�m tring this AS to duplicate a MC on the main movie. This AS is on a loaded SWF. It�s not working but can�t find the reason.
Code:
duplicateMovieClip(_root.container, "container1", _root.getNextHighestDepth());
_root.container1.loadMovie("grupo01.swf");
View 2 Replies
Jun 18, 2007
but in a more complex way. I have an existing 2d array that I want to copy to a new 2d array (but the NEW array can vary in size!).
For example, my current 2d array with the data:
var old_array =
[[0,1,2,3,4],
[5,6,7,8,9],
[10,11,12,13]];
And I want the new array to contain the same data as the old_array, yet if the new array is larger, it will put a zero instead of 'undefined'...like this:
var new_array =
[[0,1,2,3,4,0,0],
[5,6,7,8,9,0,0],
[10,11,12,13,0,0],
[0,0,0,0,0,0,0]];
View 3 Replies
Jul 4, 2007
was going well but then i decided to make it so they appear at certain intervals using the amount of seconds elapsed.
Code:
var PreElapsedS=0;
dupCir = function(mc:MovieClip, interval:Number){
[code].....
View 2 Replies
Mar 22, 2009
[URL] if you go into my movie section. i want to add movies to my section if i copy for exemple Audi commercial. i'll have 2 that's great when it'S time to change the name like Audi to Marli it will affect the first one, the original section that i copy too. that's my problem. how can i copy a section to be indivudual. without affecting the first one. cause after that i can go and change everything.
View 1 Replies
Nov 11, 2009
i've read some other threads about this but i can't seem to get them to work with my script..i'm trying to fill my stage with squares to make a visual grid, using setInterval so it shows them animating across row by row. so far i have this:
[Code]....
however i've tried adding in code to make it break onto the next row after duplicating 50 but can't seem to get it to work no matter what i do..
View 2 Replies
Jan 6, 2010
when copying one timeline to another it keeps asking me to 'replace existing items'.When i do this it pastes 2 instances of the same item on my page + another random item.
View 1 Replies
Apr 11, 2011
I am a newbie in flash Action script2can anyone please tell me that how can i duplicate a movieclip to as much numbers i want through out the stage using actionscript2. i have searched lots of posts in sites but i can't get it
View 1 Replies
Jan 12, 2009
I've developed a resource with drag and drop movieclips within a presentation.There are a huge number of drag and drop clips, so I've added a bit of swapDepth code so that the chosen movieclip is always in view. The problem now is that when I go to the next page (which contains a different drag and drop activity), a movieclip from the previous page is duplicated. Is there any solution to this? I've tried an onenterframe unload for the next page, but obviously this deletes the MC permanently making it fairly useless.
View 2 Replies
Aug 9, 2009
i made this code that duplicates a movie clip randomly in the stage but i want it to be duplicated out of the stage.
View 1 Replies
Feb 2, 2010
i know i can duplicated a movie clip by using addChild:
Code:
var myMC:MovieClip = new blank_character;
this.addChild(myMC);
myMC.x = 200;
myMc.y = 200;
etc...
Im making somewhat of an online multiplayer game, it loops through an XML file full of character co-ords and names etc and creates movie clips and positions the characters on the screen accordingly.
The characters are pulled out from the library once, and then after that i want to access the movie clips within the characters.
for example, in the root timeline i have all the characters, inside the characters i have movie clips containing their clothing, names, etc, that i want to be able to edit.But im having troubles referencing the movie clips and doing this.
I've tried things like
Code:
var myMC:MovieClip = new blank_character;
this.addChild(myMC);
myMC.name = "character"+characterID;
[code]....
1119: Access of possibly undefined property clothing through a reference with static type flash.displayisplayObject.
View 7 Replies
May 15, 2010
in flash 8 im trying to duplicate movie clip - after clicking on button i am calling loadT function.
Code:
function loadT () {
xpos = 1;
ypos = 1;
[code]....
View 4 Replies
Dec 15, 2010
The follow code produces a strawberry image that falls from the top of the screen to the bottom. I tried using a for loop to create 10 different instances of this but it doesn't seem to work for me.(Note: ranx is a number produced randomly earlier in the program)
Code:
var nstrawberry:strawberry = new strawberry();
stage.addChild(nstrawberry);
nstrawberry.x = ranx;
[Code].....
View 2 Replies
Dec 21, 2011
I want to display photos and load them dynamically.What I have is pretty basic .[URL]I have this much done and normally I would just manually add the URL to each button (boring and tedious) and I am learning to import variables and images and all of that...I want to be able to click the thumb to see the actual image:
Main Stage:
code:
onClipEvent(load){
_xscale=1000;
_yscale=1000;
[code]...
my problem is that I want to pass a value to the button based on 'i'
code: _root.mc_picGroup.mc_picGroupA["btnPic"+i].strURL = i;
Then the image name would be 0.jpg,1.jpg,2.jpg etc...I was displaying the images based on an MC
_root.mc_picGroup.mc_picGroupA["mc_picHolder"+i].gotoAndStop(i);
That worked but I thought it would be easier to place it in the button.(That didn't work...) I will just use the image mc but my real roblem is passing the value to the button.
code:
on (release){
getURL(strURL+".jpg","_blank");
trace(this._name);
}
returns "mc_picGroupA" instead of the button I am clicking.I know its ugly, but I just thought it would be a cool way to display some photos.[URL]
View 2 Replies
Jun 28, 2009
I created a button bar with 6 buttons that display separate content. When I click on one of my buttons, it brings up the content alright, but on release creates an entire duplicate set of buttons on top of my existing set of buttons. I can click on another button, and it will display content okay, but add yet another set of buttons on top of itself. after 2 buttons it basically freezes. why are my buttons in essence copying itself, and how can i correct.
View 6 Replies
Aug 4, 2011
ive made a simple button that sends you to the first frame. and its working good but than when i duplicate it only 1 button works i got 33 buttons and only one of them is working....
View 4 Replies
Feb 2, 2007
Does anyone know a way of duplicating a Sprite object.
View 9 Replies
Feb 16, 2009
I would like to be able to click on various items within my movie clip, with each clip producing a new duplicate that can dragged around, independent of the original item or other duplicates.
View 2 Replies
Feb 2, 2011
I'm trying to do something that I thought would be quite easy, but now I'm beginning to wonder. The broad description is that I'm trying to load an external .swf into a parent movieclip. (This item must be loaded externally, and can't reside in a library.) Once loaded, I then want to duplicate, resize and rotate the movieclip multiple times.
The problem is that the duplicateMovieClip function doesn't seem to allow me to duplicate my loaded clip, nor does it allow me to place a duplicated item into a parent item (other that at the _root level).
View 1 Replies