ActionScript 2.0 :: Moving A Mc Within A Boundry ?
Oct 13, 2009
I am doing a game, in that I have to move the mc within a boundry limit (i.e. moving over a path). If the mc hits on the wall, it should not move in the direction, which we move.
Note: Not by just setting the x, y limit. By using the hitTest.
View 1 Replies
Similar Posts:
Aug 31, 2009
i have a movieclip A and B...B is inside A..Now i want to drag B in region of A.how to set the boundry for B
View 1 Replies
Mar 31, 2010
I have a file set up with a movie clip moving from side to side by itself and when it reaches the end of the stage it goes back in the opposite direction.[code]I know want to control the movie clips movement with arrow keys, just left and right so that it would stop when it reaches the edge and will only let me move it the opposite direction.I guess I'm just trying to set up a sort of template.
View 9 Replies
Jan 21, 2009
I've just started dabbling with AS3 coming from Director. Is there a way to detect the mouse x , y values beyond the edge of the stage? When tracing mouseX, mouseY on enterframe event the values stick at the last position within the stage when the mouse roams beyond the stage boundry.
An vague example of usage would be if you had a big movie clip as a custom cursor, and wanted it to smoothly disappear beyond the stage edge.
View 3 Replies
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
Mar 7, 2009
I have a main MovieClip in which I have several frame labels, each will eventually have different MovieClips associated with them. First time through I want to play an "intro" MovieClip, which I have placed on the stage at the begining of the main timeline, then at the end of the "intro" Clip, go to the first frame label and play that MovieClip.
The way I was going about it was placing this code in the last frame of the "intro" MovieClip:
Code:
MovieClip(parent).screen_mc.gotoAndPlay("home");
'screen_mc' is the instance name of the Main MovieClip.
[URL]
View 3 Replies
Nov 27, 2011
I'm stuck on the code for the following situation:A mc is costumed as the mouse cursor, 1. when we move the "cursor" near a character (mc), this character will gotoAndPlay frame2.2. If the "cursor" touches the character, this character will gotoAndPlay frame3.I've got the code working for #2, but not #1.
View 1 Replies
Jan 9, 2007
Ok, this is my script:
while(village_holder.village.build.hit.hitTest(pt. getBounds(_root).xMin, pt._y, true)) {
pt._x++;
}
[code]....
View 2 Replies
Aug 10, 2009
Assume the main time line is A. On A I've got movie clip Z also On A I've got movie clip B and inside B I've got a movie clip C (I need it to be this way because it soft of a TAB meanu). My problem is the actionscript written in C makes few objects called planet 1, planet 2, planet 3 on A function well. But when I move planet 1, planet 2, planet 3 to a movie clip (planets_mc) it wont function! How can I put planet 1,2 and 3 in to one mc and still make the actionscript in C work? I've used the _root. command in the script C.
View 2 Replies
Nov 10, 2009
However, I'm trying to do something new that I've not done before, and hasn't been covered in any of the tutorials I've gone through.
In general, I've got a spaceship shoot-em-up. I'm wanting to use a "tractor beam" to scoop up other items off the stage. I have it set up so that the t-beam is it's own MC, and class/.as. When a button is pressed it shows on the screen fine. However, I need it to move along with my ship.
Is there a way to do this currently, or do I need to redo the t-beam to be another layer on my ship class/MC and work it from there?
View 7 Replies
Dec 17, 2009
how to move Children in As3.I've a MC called mainClip with an instance child1 and child2.In Child 1, there is another MC wich has the name "aniMC" wich is a clip with a animation inside.I now want to move this aniMC (with its animation inside) to the child 2.So, as I read here I have to first remove the clip and then addChild it.But this doesnt work. My Code-Snipplet looks like this:
mainClip.child1.removeChild(mainClip.child1.aniMC) ;
var testMC = mainClip.child2.addChild(mainClip.child1.aniMC)
The strange things is, that testMC traces me a Object-Movieclip and has the name "aniMC". But ... its not visible. Alpha and visible are 1 and true. But I cant see it. Could it be that the Clip was added but not its content?
View 2 Replies
Nov 26, 2008
Im currently making a game that has one of those old-skool Fallout maps (a world map where you click somewhere and the "you" marker moves there) that im trying to replicate.I already have the scripts ready for map interaction (using onhit here). But i was wondering if someone could help me with a script that works this way:
1. I have a movieclip (the character)
2. When i click somewhere on the map i want this movieclip to move there. Not instantly but moving over the screen to that point where you clicked.
3. I also want there to be passages that when the movieclip hit that movieclip (named hit for example) it stops dead and doesn't move (will be used on the map for mountains and such) and the player has to click somewhere else to move it that path (im assuming this will be something like onhit: hit - speed=0 something but im not a good scripter and it would had to be worked into the script.
4. ok this one is kinda optional but would be great! If it's possible to have it worked in the script that when the clip doesn't move (and is stationary on the map) the movieclip stays on frame 1 but when the movieclip is in motion (and moving across the screen) the movieclip is on frame 2 (and reverts to frame 1 when it's not moving anymore and so no)
View 15 Replies
Mar 18, 2009
I have made a rotating images but the images are not moving smoothly. You can see the example at:-URL...Does anyone know why the images not moving smoothly?
View 3 Replies
Apr 30, 2009
I made a button and what I want it to do when I click on it, is to take me from the instance it's located, into another instance.
Like I have this: Scene 1> Frame 1 with instance in it - and Frame2 with another instance in it.
Scene 1> Frame 1 starts playing the first instance (which has the button it in) and then from that instance - I want to go to the second instance which is in Scene1 Frame2.
View 4 Replies
Dec 4, 2009
Basically I just want a really simple image where the eyes follow the mouse and blink occasionally (not an animated/tweened blink even... just a 3 frame animation). I have managed to create both independently, but I am having alot of trouble making them work at the same time. My code is pretty much copy/pasted from different tutorials. I know why its not working, but I cant wrap my head around fixing it. (eyes following mouse needs actionscript to loop whereas the blinking needs a stop action).
View 3 Replies
Feb 15, 2010
I am getting the following error when trying to move a Move Clip on it's x axis by a value of 5.:TypeError: Error #1010: A term is undefined and has no properties.at flashmovie_fla::MainTimeline/mouseDownHandler()[code]
View 1 Replies
Mar 1, 2010
Who knows the first and second "this" refers to what mc
View 12 Replies
Oct 10, 2010
i m trying to use buttons to move the 2 green and blue boxes along x or y axis; problem is i cand make them move individualy, they both move at 1 click in the same dierction.. i need to assign actions to a set of btns to move only 1 box, and actions to other set of btns which move the orhet box..
View 3 Replies
May 12, 2009
I have an scrolling number of photos moving from left to right controlled by:
[Code]...
View 1 Replies
Jul 11, 2009
I've got a movieclip connected to a check box, it's x position is supposed to be +100 if unchecked, and -100 x if checked.I have several movieclips with several check boxes along the same lines, and wrote up two functions.
function Sh(card){navigation.tableu8.card._x = -63;}
function Hd(card, numx, numy){navigation.tableu8.card._x = -numx;navigation.tableu8.card._y = numy;}
These didn't work so I wrote this one to test if there was something wrong with using a function to move items, and it worked fine:
function ShA(){ navigation.tableu8.cA._x = -63; }
What can I do to avoid making 26 functions, ShA through ShZ ? Are there brackets or something I'm missing, or do I need to type "String" or "Number" somewhere?
View 3 Replies
Aug 9, 2010
I have a movieclip that I want to move down and up.I use a new tween using the Elastic. easeOut property to move the movieclip down over a duration of 2 seconds.But right after it moves down I need to move it right back up so it looks like a uniform animation.I used setInterval(reverse,2000) and reverse contains yoyo();This almost works.Since Elastic slows down the movement of the movieclip at the very end, there seems to be a pause between the movieclip moving down and the movieclip moving up.It does not give the impression that it is 1 tween, which is what I was going for.I tried to set the duration to less than 2 seconds, but then Elastic property is not 'stretchy'.It is too fast and comes to a halt, not elastic, and then the reverse (when the movieclip goes back up) is much faster than when the movieclip goes down.Is it possible to move the movieclip down AND up by using just 1 "new tween" function?
View 2 Replies
Mar 4, 2011
is it possible to select everything on stage and move it slightly in 1 direction with action script on key press? anyway at all.i cant put it in a movieclip and move it like that because lots of different thngs come onto stage further down the time line
View 7 Replies
Oct 21, 2011
i am trying to make a system of where you have game lives, and all my levels are on located on diffrent frames, so what my problem is that i want to be able to grab a variable from a previous frame and bring it to the current frame.
Code for variable and lives system so far:
var life_1:int = 1;
if(life_1 == 1)
{
star_1.alpha = 1;
[Code].....
View 5 Replies
Mar 1, 2012
Newbie Question: I'm having a problem with a Flash /swf. file I created, it looks fine when I create it, test it in flash on my computer and when I place it in the website I see everything fine. But on some (most) other browsers, parts of the text get cut off, looking like an incomplete word or sentence. See example here: Winsows 7- CS3 / Chrome - and Explorer. [URL]...
View 1 Replies
Apr 2, 2009
I know how to animate with Flash, and I know the basics of Actionscript 2.0 enough to make simple games.I have a project to do which I wanted to do with Javascript/CSS, but instead I'd like to hone my Flash skills to do it.If someone could point me in the right direction that would be awesome! I'm making an image move in a path about a web page without regard to other content on the page.I was thinking that I could make a Flash vid with a transparent background and lay it over the page.If so, how do I make a transparent background? If that's not the solution, can I even do this with Flash?
View 2 Replies
May 20, 2010
I have been doing ASP.NET / C# development for several years now. I have recently been offered a project that will need to be a winforms application (I am assuming .net 2.0).
[Code]...
View 1 Replies
Dec 1, 2010
Is it possible to copy a file from flash media server to a web server? I can forsee if it is on the same server then it is possible via php but what if it is on two separate servers?
View 1 Replies