ActionScript 3.0 :: When Press The Keyboard Come Back Down To Movie Clip Starting Position On The Bottom Of The Stage
May 9, 2010
I have got a movie clip moving up the stage and when I press the keyboard I want it to come back down to its starting position on the bottom of the stage. What code do I add to the following?
[Code]....
View 5 Replies
Similar Posts:
Jan 24, 2010
I want to press any keyboard key to delete movie clip - how do I go about it? This is what I have for mouse click
bubble_mc.addEventListener(MouseEvent.CLICK,rotateBall);
trace("ball working");
function rotateBall(e:MouseEvent):void { ball_mc.rotation+=5;}
addEventListener(Event.ENTER_FRAME, ballMove);
View 5 Replies
Feb 2, 2009
I made two movie clips that follows the mouse but I want to put constraints on them, they should follow the mouse until the mouse reaches a certain distance and then the movie clip should pop back to its original x and y position.
Code:
private function init():void
{
addChild(backgrnd);
[code]....
View 1 Replies
Feb 27, 2010
I created a movie clip, an aircraft compass which rotates till the button is pressed but I would like it to return back to its original position in opposite direction of smooth rotation and stop. I already have the following script on the clip.
onClipEvent(enterframe) {
if(spin) {
_rotation -= 2;
[Code]....
View 2 Replies
Jan 8, 2009
I'm using Flash 8 and I'm having an issue getting back to the main stage once a movie clip has played. I have my file set up with three movie clips on the main stage. One just plays which is the banner, there are two rollover buttons on that mc for panel1_mc and panel2_mc. When you rollover to view panel1 it plays fine, but inside I have another button to take you to panel 2. That wont work...this is what I have for code for the button inside the clip:
[Code]....
View 4 Replies
Mar 31, 2011
How do i make a movie clip go back to the main stage once it is clicked.. it has a roll in and out which is inside the movie clip.. i have a door and i want it so when you click the door it goes to another key frame on the main stage
View 1 Replies
Jun 25, 2009
I had attach a few movieclip in the main stage by using addChild() method. If I going to refer back to them inside other movieclip, How can i do so..
For example,
//attaching at the main stage
var earth1:MovieClip = new earth()
addChild(earth1);
[Code].....
How can I refer back this Movieclip from other movieclip's timeline?
View 1 Replies
Jul 3, 2009
Is there a way to position something INSIDE of a movie clip, based on X and Y values of the root stage?
Basically the X and Y of the container movie clip is at Stage.width/2; but I want one specific movie clip inside to stay permanently at 200X and 200Y on the MAIN STAGE. I can't actually move it to the root timeline though because it is using actionscript inside of the container.
View 1 Replies
Mar 14, 2009
I hav movieclips in a flash document that i have autocenter when the stage is scaled code is something like this:
clients_mc.y = Math.round((stage.stageHeight/2)-15);
stage.addEventListener(Event.RESIZE, resizeClients);
function resizeClients(event = null){
clients_mc.y = Math.round((stage.stageHeight/2)-15);
};
any way to make it esae in to position or bounce, something?
View 4 Replies
Mar 9, 2011
I have a flash site, on one of the pages is an embedded youtube video, that I have used this code for
[Code]....
The video loads perfectly, however, it is anchored to the top left hand corner. I have attempted to do this within a movieclip and move the movie clip around on the stage also but it has not worked
View 1 Replies
Nov 7, 2009
I have 2 scenes. In both scenes, I have a movie clip that moves via keyboard control. If the goto next scene is triggered by the movie clip in the first scene the keyboard control works in the second. However, if I use a button to move to the next scene then there isn't any control over the movieclip in that scene. I've traced the keyCode in the second scene and it is picked up but the switch statement doesn't run. I'm migrating to Actionscript 3.0 and updating something I created in 2.0. I would like to do it without writing a class.
[Code]...
View 5 Replies
Sep 9, 2003
I have a clip that rotates to orient itself towards the mouse when the mouse is over a given area. When the mouse leaves the area, the clip snaps back to its original position.
1) the clip snaps directly towards the mouse at the moment the mouse enters the clip; I would like it to actually rotate;
2) the clip snaps directly back to its original position when the mouse leaves the clip; I would like it to ease back into position.
[Code]...
View 3 Replies
Sep 25, 2009
The following code blocks create a movie clip 20px high and align it to the bottom of the stage (I add 100px to stageHeight because by default it traces 300 instead of 400). Regardless, both code blocks work when tested in Flash.In HTML however, only the first code block works.The second code block produces a blank HTML page. The second block is so that I can change the footer's height and still have it sit at the bottom of the stage...Considering "footerY" traces 380px, I have no idea how the two code blocks are so different that one HTML page makes the clip visible and the other doesn't.
Code:
var footerHeight:uint = 20;
// var footerY:uint = (stage.stageHeight + 100) - footerHeight;
// trace(footerY);
[code]....
View 5 Replies
Mar 13, 2010
I have a problem when I making a game Flash with action script 3,. I want tomake my character move when the key helding and I want my character attackwith one tab press either
View 3 Replies
Apr 21, 2010
I have MC masked with TEXT,when the user moves his mouse down more text appears from the bottom and when he moves it goes bakc to the original position...I do not want the mouse wheel .. I woudl like to do it by mouse hovering...
View 5 Replies
Mar 29, 2010
I have a demo/spec file I'm working with (download the .fla here): [URL] I'd like to have a movie clip (FLV) start playing AFTER the animation stops playing. I know once I bring the clip in, I'll have to give it an instance name and reference it in AS, but I'm not just not sure exactly how to start. I feel like the whole timeline thing traps me up...
View 1 Replies
Aug 30, 2011
I have several movie clips on the stage. They are draggable. I want to be able to drag the movie clip, then when it is dropped, a copy of that movie clip will appear where the first one had been, and the first one will just stay where it is on the screen.
However, I'm running into problems with the syntax.
Here is my current code:
[Code].....
View 14 Replies
Apr 11, 2010
My movie clip is not bottom aligned when window is resized. I noticed that everything works when I delete the line which tells the stage to not scale. PHP Code: //Stage.scaleMode = "noscale"; But I need to keep that line because I don't want my swf to scale. My question is how can I resolve the issue with the bottom align of my mc? I already have addListener but seems it does not work when the "noscale" line presents.
View 2 Replies
Jan 23, 2009
I am trying to design a very basic flash game. The basis of which is that there is a slider at the bottom and objects fall from the top and you have to avoid them. However, if the object lands on the slider, it also has to become part of the slider and so the area of the slider increases. I am unsure of how to code this last bit as the properties of the slider must change.
View 1 Replies
Nov 9, 2010
Does anybody know how i can create a stacking list component (just like photoshop) where the first row starts at the bottom and the second on above the bottom and so on. Normally the list component works like this.
[Code]...
View 3 Replies
Nov 4, 2009
Im making a flash game. And Need to have a menu (sized based on what they click, small medium large) referenced from a movieclip, and variables passed to it. Im using CS4/AS2. Is there a function i can put on my button to create a movie clip at a location?
View 2 Replies
Jun 20, 2010
is it possible for me to hide a movie clip by the press of a button that is on a differant timeline?
here is my code for button.
stop();submit_btn.addEventListener(MouseEvent.CLICK, subClick);
failed_txt.background = false;failed_txt.border = false;
var myName:String;var myPass:String;
[Code].....
View 1 Replies
Jun 29, 2009
i've given the variable as "countdown" When i press a button, i want to start count down 60 seconds, and when they passed go to the other frame (frame 2) and show my statistics.
View 4 Replies
Jan 4, 2008
I have some buttons and over them a semi transparent panel appears. I want the panel to block press and rollover and other mouse events for all the movie clips that it covers. How to do that?
View 12 Replies
Aug 20, 2011
i have a menu with 8 buttons and every movie clip of them have the following script on it
[Code]....
what i need is when i press the movie clip it goes to specific scene label. i tried this code
on (release) {_parent._parent.gotoAndPlay("b")
}
but it doesnt work with movie clip but works with buttons only , so is there any equivalent code to use with the main code above of movie clip.
View 7 Replies
Apr 29, 2004
i'm trying to write the code for a flash animation which uses different movie clips and buttons.all the movie clips are in the same layer but i've written code to make all but one invisible when the animation loads.
dance._visible = false;
harmonica._visible = false;
violin._visible = false;
i've then got buttons which are supposed to make the movie clips visible, but then disapear again after the clip has played.i want to be able to press one button to have one clip start playing, but then i want to be able to press another button which stops that movie clip and starts a new one playing.this is what i came up with but it doesn't work
on (press) {
violin.stop();
harmonica.stop();[code]....
this script is from one of the buttons which is supposed to start the movieclip harmonica and stop violin playing.i've got the same code for violin but the other way round.when i press a button it works fine and plays the clip which then disapears (leaving a default clip which plays all the time visible) but pressing buttons to interrupt the clip and play another one don't work properly. the movie clips don't stop and reset when they are interupted. they kind of pause instead. when i go to play a clip that has previously been interrupted it starts from where it has been paused and not from the beginning
View 4 Replies
Dec 5, 2005
i need to make a certain movie clip play when i press a button.
View 4 Replies
Apr 27, 2004
I have two arrows that control an animated movie clip that has words scrolling vertically. When you click on one arrow it plays the movieclip forward, and when you click on the other arrow it plays the movieclip backward. I want you to have to keep clicking on the forward arrow to have it continue animating through the different words. I've place stop actions at the points I want the movieclip to stop animating but when you click the forward or backword button it never stops and just plays through the whole thing. [URL]
View 6 Replies
Jan 6, 2010
I try to move my existing movie clip using keyboard.. I want to clear how i can move mc.. For example if i click errows.. or for example if i click N i must move mc to right position. But i can not clear why my arrows working and N not
Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, starMoving);
function starMoving(event:KeyboardEvent):void
{
switch (event.keyCode)
[Code].....
View 8 Replies
Aug 5, 2009
I would like to create an image sliding effect using next and previous buttons. For example the sliding images on the homepage here: http:[url]....I know this is not in flash, but that's the effect I'm trying to create using flash.
I followed the help quoted below. However, when I press the Previous button to rewind the timeline, the movie clip does not stop. For example, if I am on image 3 in the slider and press the previous button...instead of going to image 2, it slides all the way back to image 1 without stopping.
Quote:
ActionScript 2:Notice how, in the link to the example, all of the images/slides are the same size. Create a few of those before you begin.
1. Convert each image/slide to it's own Movie Clip, so that you can go always go back and adjust them if needed....as well as other useful reasons.
2. You only need 2 layers for now, Actions & Container. On frame1, add a stop action to the frame on your actions layer. Then, place all of your Movie Clips on the stage, on the Container layer. Line them up horizontally, edge-to-edge. Select them all and convert to a Movie Clip named "container".
3. On the Container layer, Insert A Keyframe > move the Container Movie Clip to the left so that the next slide is now in place on the stage > Right click in between the two Keyframes and choose "Create Motion Tween". You should have the animation from slide 1 to slide 2 now. Repeat this process for 2 -3, 3-4, 4-5 ......(don't worry about the reverse!)
4. We need to create buttons to go to the next and previous slide. Make a new layer called Buttons. Create 2 buttons, one for Next and one for Previous. These can be Movie Clips OR Buttons, just place them on the stage give one an instance name of "next_btn" & "prev_btn" (no quotes) for the other.
5. All that's left is to add some actions to a few frames on the Actions layer.
a) Add a stop action to every frame where the slide will be static (still), you should already have one on the first frame from step 2.
b) Now here's where the magic happens. If we test the movie now, the slides will just play and over. So add this code to the frame 1 on the Actions layer:
Code:
stop();//already have this stop action, just add the below
this.onEnterFrame = function(){[code]....
View 1 Replies