ActionScript 2.0 :: Action Tween - Clicks Somewhere On The Stage The "character" Moves To The Position That Was Clicked

Dec 30, 2008

how to do a basic action tween in actionscript 2. I can only find tutorials on AS3 ones or AS2 ones with easing, i dont want easing. i want it so when someone clicks somewhere on the stage the "character" moves to the position that was clicked.

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Disable Mouse Clicks To The Walls And Character While Allowing Clicks To The Floor?

Sep 23, 2010

I'm building a project that has a character navigate through a room by clicking on the floor. Right now, the walls, character, and floor are all children of the same display object for sorting purposes. My question: is there a way to disable mouse clicks to the walls and character while allowing clicks to the floor? Using mouseChildren appears to be an all or nothing deal and I can't seem to isolate individual floor/wall/character objects for use with mouseEnabled.

View 4 Replies

ActionScript 3.0 :: Mouse Hovering - When The User Moves Mouse Down, More Text Appears From The Bottom And When Moves It Goes Back To The Original Position?

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

ActionScript 3.0 :: Get An Action To Follow Another Action When A Button Is Clicked?

Nov 4, 2010

How can I get an action to follow another action when a button is clicked? When a button is clicked, I want the timeline to go to a certain frame and play and when it's done playing, to go to another frame and play. I basically want two actions in one function.

[Code]...

View 1 Replies

IDE :: Tween Into Position When A Movie Clip Is Automaticcally Centered To Stage

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

ActionScript 2.0 :: Make A Function That Moves The Character?

Aug 7, 2004

I have a problem with functions.I want to make a function that moves the character and let him do a different thing like kicking or going down and jumping. Here is the code i have:

Code:
function enableKeyMovement(clip) {
clip.onKeyDown = function() {[code]....

i want the up key to be pressed once, the down key to be hold on to and when released it goes back, and the right and left to be hold on to and when released goes back to 1.

View 1 Replies

ActionScript 3.0 :: Screen Scrolling As Character Moves To Edge

Sep 16, 2009

I am trying to make my screen scroll as my character moves to the edge of it, but when I get to the edge of the screen nothing happens, I think this could be something to do with my registration points but I'm not sure. I have added trace statements for debugging but no luck. I have included my Fla so you can see what I mean.
Here: [URL]

Here is the code I am using to try and make this happen
PHP Code:
// scroll the LBground if character gets past half way up or down the stage
function scrollLevel():void {
// Horizontal scrolling
var horizontalCentre:Number = stage.stageWidth / 2;
var horizontalPosition:Number = LBground.x + Mchar;
[Code] .....

View 2 Replies

ActionScript 3.0 :: Record The Current Position Of Any Of The Items Item In Order To Use That Data To Change The Position Of The Item After The User Clicks?

Jan 2, 2010

If I have several items that move across the screen but the user can click any of them at any time, how do I record the current position of any of the items item in order to use that data to change the position of the item after the user clicks?

This is what I am doing: I have 11 images that slide accross the screen. The user can click any of them at any time. When he clicks one I am scaling the image so it looks like it is comming forward (z axis) and then the rest of the images are scaled down so it looks like they are going back on z axis. So what I am trying to do is get the current position of the image when the user clicks the image so that I can use that to correctly estimate the scaling and moving of the image to make it look like it scales from the center and not from the top left corner. So if have a variable that gets the current position of the image being clicked I'm thinking I can change its position using something like: x = currentposition + -45;

View 9 Replies

ActionScript 3.0 :: Action On Multiple Clicks On One Button

Jun 24, 2010

I need to create a demo where a button is pushed several times to go to several items in a menu. Like this:

If button is clicked once --> show menu item1 & go toandplay frame 2
If button is clicked twice --> show menu item2 & go toandplay frame 3
If button is clicked 3x --> show menu item3 & go toandplay frame 4 etc.

Actually it also needs a delay, so when the button is clicked once, it shows menu item 1, but if it is clicked again within 3 seconds, it should go to the next menu item in stead of going to play frame 2...

View 1 Replies

ActionScript 2.0 :: Trigger Action By Consecutive Clicks?

Jul 7, 2009

I have a movieclip in a game, performing different actions, all working beautifully now. I want to add one thing: If I click, say 5 times consecutively on that mc, I want an action to be triggered by that number of consecutive clicks, e.g. gotoAndPlay (2).The mc is moving around randomly on the stage and there are other clickable mcs moving around as well.

View 6 Replies

ActionScript 2.0 :: Some Action To Be Performed When Someone Clicks On Icon?

Jul 15, 2004

i m adding flash animation on my windows desktop icon .well i want some action to be performed when someone clicks on that icon.lets say open winamp in program files.i added flash file thru Html page on desktop.what about URL on Fscommand.is it possible to use it.?
is it possible to make flash open some executables from computer e.g.winamp.---by the way if macromedia creates vb.flash then our operating system will fly in air ----

View 1 Replies

ActionScript 2.0 :: Make A Interactive Animated Character, That Would React To Clicks In Certain Places?

Nov 26, 2006

I need to make a interactive animated character, that would react to clicks in certain places, but instead of bitmap/vector animations, there would be video clips embeded in the swf. The video clips would be played in various combinations.Let me give you a example.

Start: A looped video of a person idling.

Start/hotspot1: The looping video fades-out, and a video of a person jumping up fades-in, plays, then fades-out back to the loop.

I have to embed the videos, so that there won't be any buffering. I tryed to embed the video, and use commands like gotoAndPlay(), gotoAndStop(), play(), stop(), but if I have more than one embeded video I start having problems controlling the clips.Here's one of my unsuccessfull attempts:

Clicking on the HS1, should fade-out VIDEO1, fade-in VIDEO2/play it/fade-out, and fade-in VIDEO1 again.

View 1 Replies

Actionscript 3.0 :: Create An Image/mc Slider That Moves Form Right To Left Via User Clicks Of A Left And Right Button?

Sep 11, 2009

looking to create an image/mc slider that moves form right to left via user clicks of a left and right button.I would assume I would create an array to hold a series of mc's in (my images) and then tell the left and right buttons CLICK events to move linearly through the array (displaying next in line and previous etc.

View 1 Replies

ActionScript 3.0 :: Stop The Action And Make Things Happen On Clicks?

Oct 16, 2009

I have a set of images of dogs and a doghouse.

1. Each dog has an email assigned to it for the person.

2. Clicking on a dog (or alternatively "dragging it"), puts it in the doghouse and moves the existing dog out to the now empty location.

3. Once moved in, ther should be a button presented to create an email to the person saying they have been placed in the doghouse (so..like..mailto??).

4. Maybe an image of the doghouse with them in it could attached to the email.

5. LATER: The state of the page could be kept so future visitors know that the person is in the Doghouse.

I have an old JavaScript page that kind of shows the functions:

FAMILY DOGHOUSE

Also, what I have done in FLASH (so far) is also shown at the bottom of the page.

1. Not sure how to make the action wait for the mouse click or drag!

2. Also, maybe a button, once the people decide who goes in the doghouse, to submit and fire the email??

When I chose this little project I thought it was easy, but I realize I have not a clue how to begin beyond making buttons and tweens.

View 0 Replies

ActionScript 2.0 :: MC Moves On Mouse Position?

Jul 19, 2009

im talking about the way the MC moves from left to right while stationary...based on mouse movement, anyone have any ideas what this function is called but more effectively, WHEre i can find a tut or something?

View 1 Replies

ActionScript 3.0 :: Keep Mc In Same Position On Screen If Its Container Mc Moves?

Apr 21, 2009

I have a large movieclip that contains all the elements of my game - the level backgrounds, the player character, the non-player characters etc. The stage is only a quarter of its width and when the player character moves off the edge of the stage the whole game movieclip moves a quarter width to the left or right, depending on which side the player character has left the stage from.

Each of the quarters of this large game movieclip are considered levels of the game (so there are four levels, obviously) and what I want to know is how do i get an object that exists in one level to appear in exactly the same position on screen in the next level, when the player moves to that level?

View 4 Replies

No Tween On Certain Clicks

Aug 25, 2011

I have a tween code that Ned Murphy helped me with now when i want to press a button i dont want my object to move where the button is.

View 5 Replies

ActionScript 3.0 :: Tween That Moves A Progress Bar Along The X Using ScaleX

Jul 22, 2009

i have a tween that moves a progress bar along the x using scaleX but when the user presses a button i want the progress bar to scaleX -= 0.2 but when i do this it scales to taht size but immediatly jumps back to where it was in the tweener tween.

View 1 Replies

ActionScript 2.0 :: Make An Input Text Field Trigger An Action When User Clicks On It To Write?

Aug 5, 2008

I'm trying to achieve something that I'm sure it's not that complicated, but unfortunately I have not clue how to do it.I have created some text fields. And what I want to do, it's that when the user clicks onthem, in order to start writing, I want a specific movieclip to dissapear.This could be achievable if I knew how to make the textfield behave like a button; but I don't know what code I need for this, as onPress it's not working at all.

View 5 Replies

ActionScript 3.0 :: Tween Movieclip From Current Position After Previous Tween

Mar 17, 2011

I am working on to slide a movieclip across the stage.The movie clip is five times the width of the stage and I am using the Tween  Class to move it across the stage when a button is pressed.The interaction I want is that when the button is pressed the movie clip moves a certain amount.If the button is pressed again it moves further.The script I have come up with though is taking the movieclip back to the original position of the movieclip and then moving it as opposed to moving it from the position it reached after the first button click.I have tried a few things but nothing is working.The script I am using at present is:[code]

View 5 Replies

ActionScript 3.0 :: Tween Class - Tween Back To The Original Position?

Oct 27, 2009

I am trying to understand the thinking behind motion tweening using AS3 (rather than doing it on the timeline).I am trying to create a simple platform game, and while this is simply a learning project, I have an movieclip instance on the stage, and using basic x+5 logic I can get the instance to move left and right on the stage accordingly.Trying to make the instance 'jump' is a bit trickier. This is the code I am using:

ActionScript Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;[code].....

I thought this code would move the instance from it's current y-position and tween it to it's highest jump point. From here I planned to use a MOTION.FINISH event to tell it to tween back to it's original position.Something strage happens though, rather than tween from the current y position and move up, the instance instantly transforms it's position to y+100 and then tween back to the original position. So it kind of turns out that it is the second part of the jumping action that I want to create.

View 2 Replies

ActionScript 2.0 :: Moves A Movieclip To The Opposite Y Position Of The Mouse Pointer?

Oct 11, 2007

I have a basic script that moves a movieclip to the opposite Y position of the mouse pointer:

Code:
var cP = this.createEmptyMovieClip("centerPoint", 1);
cP._x = Stage.width / 2;
cP._y = Stage.height / 2;
var myBox = cP.attachMovie("boxMC", "myBox", 2, {_y:cP._y});
cP.onMouseMove = function() {
myBox._y = (cP._ymouse * -0.9);
};

Everything works great, but I'd really love to be able to ease the box to it's Y position, rather than moving it to it's final position immediately. I'm having a difficult time with it because the box is moved based on the mouse position, which obviously doesn't ease.

View 2 Replies

Flash 10 :: Tween With A Vector Graphic Expanding As It Moves Down But It Cant Handle?

Jun 30, 2010

So I just got CS4 and the all Im trying to do is a tween with a vector graphic expanding as it moves down but it cant handle it, it plays out all laggy and its the same when its published. Can any of you guys help?

Just as a note CS3 does the same job just fine I dont know whats wrong with it I have played around with the publish settings and my frame rate is set to 25fps.

To test it I did the same thing with just a vector square on a new file and it reacts the same way!

Theres no actionscript going on just simple stuff that should work but fine but doesnt

View 2 Replies

Actionscript 3 :: Tween Position Relative To Current Position?

Jan 23, 2010

I have a tween set on a timer:

var manTimer:Timer = new Timer(1000,14);
manTimer.addEventListener(TimerEvent.TIMER, moveMan);
function moveMan(e:TimerEvent):void {[code]....

I just need to make the tween's position relative to it's current position, as opposed to starting at the stage's 0 position then moving the the stage's -40 position. It needs to start at its current position the move -40 from that position.

View 1 Replies

ActionScript 2.0 :: Zoom Tween - When User Clicks Appropriate MovieClip

Apr 5, 2006

I'm in the process of planning out my web portfolio website. The situation at hand right now is learning how to do a zoom tween via actionscript. I want to learn more actionscript tweens and get away from tweening using keyframes/frames - as this creates Huge file sizes. So I'm trying to be more efficent and keep file sizes down. Basic idea is I have a background image with 3keypoints (movieClips) that the user can click on. Once you click on these the camera will zoom and pin-point whatever movieClip has been selected.

Here's what I've been able to see so far. By applying this script to each separate movieClip it zooms in on the image or particular part of that image correct? How would I modify this so that it zooms when the user clicks the appropriate movieClip. I got this from from here and I have also seen and read the Kirupa Tutorial about the starfield/racecar game etc. But it doesn't sink in without examples right in front of my face. And to reverse the zoom when the user wants to (un)zoom back out would I switch the

_xscale = _yscale += speed;
to
_xscale = _yscale -= speed; ??
onClipEvent (load) {
speed = 2; //speed of the zoom
} onClipEvent (enterFrame) {
_xscale = _yscale += speed;
//does the zoom
_x -= 1;
_y += 2.5;
//this moves the movieClip down and to the left so it leaves the screen entirely
}

View 2 Replies

ActionScript 2.0 :: Tween From One Position To Mouse Position?

Mar 28, 2010

tween from one position to mouse position

View 1 Replies

ActionScript 2.0 :: Make A Character Walk To A Clicked Point

Apr 13, 2008

im having a bit of an issue with making a character walk to a position when the area is clicked (but i dont want them to move on the y scale, just the x). i dont want them to instantly move, i want them to (flip over if necessary) and play their walking animation as they walk to the clicked position.

View 1 Replies

ActionScript 2.0 :: Different Action To Occur If Any Of The Movieclips Get Clicked?

Oct 1, 2003

I have many movieclips -I have 10 movieclips for each type-and i have around 7 types of movie clips (ex. 10 red squares, 10 green triangles, 10 blue circles movieclips) now I want a different action to occur if any of the movieclips get clicked-but the same action should occur if the same type gets clicked (ex. if the user clicks on any of the blue circle-it should get dragged, if they click on any of the green triagles-it should get deleted and so on)what's an efficient way of doing it except for

if square1.onclick=square2.onlick=function()...

if triangle1.onclick=triangle2.onlick=function()...

there's a prototype-but that affects all the movieclips-is there a way for me to make each of the movie clips-sort of a different category (object) so that way I can use prototype keyword-or anything else-to have the same affect? and not have to write repetitious code?(maybe some sort of inheritence to movieclip)

View 4 Replies

ActionScript 2.0 :: Tween Class Button - User Click On The Top Rectangle And It Moves To Reveal The One Underneath It

Sep 20, 2007

i am creating a simple set of a few rectangles stacked on top of eachother (going to be like a stack of postcards) and i want to have the user click on the top rectangle and it moves to reveal the one underneath it. i have it all set up to work except i can't think of a way to stop it from being clickable after it's been moved to the side and the 2nd rectangle is revealed. does this make any sense? here is my code:

[Code]...

View 2 Replies

ActionScript 3.0 :: Perform An Action When A Button Is Clicked Without A Function?

Feb 27, 2010

Is there a way to add an EventListener to a button and make it execute some action when it is clicked without calling a function?

In other words if I have three different buttons and I want to make an action depending on what button was clicked, something like.

If button 1 is clicked do this, if button 2 is clicked do this, if button 3 do this.

I know a different action can be taken using an eventListener and a function assigned to each button but I'm trying to understand more about AS3.

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved