Tweening Over Distance Not To Specific Point

Oct 27, 2009

I've scanned through the forums, but can't seem to find an answer to my question. I'm trying to move (tween) a movie clip 800 pixels along the x axis (horizontally) when a every time button is clicked. I don't want to move the movie clip to the 800 "x" pixel mark. Yet, I can't seem to move the clip an additional 800 pixels whenever the button is pressed again - it keeps starting from the original spot. I am new to ActionScript...

My code is below:
btnBottom1.addEventListener
(MouseEvent.MOUSE_DOWN, playHandler);
function playHandler(evt:MouseEvent):void {
import fl.transitions.Tween
import fl.transitions.easing.*;
var twTeen:Tween = new Tween(mcbottomFlap1, 'x', Elastic.easeOut, mcbottomFlap1.x, +800, 3, true);
}

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Distance From Point To Point And Referencing Other Instances Of The Same Class

Feb 8, 2009

I'm creating a game in flash for a university project, and learning actionscript and programming as I go. I'm very much still at a beginner level - at the moment al I have is some actionscript for drawing rectangles and moving them about the screen. This is what I'm having trouble with at the moment: I have a class called 'Creature', and I want instances of it to interact with each other. I want them to do something when they come within a certain distance of another instance. And I want them to be able to pick a random other instance to get the location of, in order to do something with that information.

What I think I need is: A function for telling the distance between two (x,y) points.
A way of referencing the nearest other instance of the class. And a way of randomly selecting from all of the instances of the class.

View 4 Replies

ActionScript 3.0 :: Find Distance Between Point And Line?

Feb 14, 2011

How could I find the distance between a given point and a drawn line? I was thinking about using the point-slope formula to draw a perpendicular line between the point and the line and measuring it as the distance, but I'm not quite sure how to do this in as3.

View 0 Replies

ActionScript 3.0 :: Calculate Mouse's Distance To A Certain Point?

Dec 4, 2009

What I am trying to do with AS3 in Flash cs4 is calculate the cursor's distance to given point (let say 400,300) and use that distance to constantly (20 fps) change my curtain's alpha value. (which is basically a box turned into a movie clip) [code]...

View 5 Replies

ActionScript 3.0 :: What Is Faster Point.distance() Or HitTestObject()

Feb 25, 2012

what is faster Point.distance() or hitTestObject()

View 5 Replies

Actionscript 3.0 :: Tweening A Line To A Point

Apr 24, 2009

Is there a way to tween a line's length to a point using actionscript? I have a diagram of a product and when the user clicks a button I want lines to draw to points on the product.

View 2 Replies

ActionScript 3.0 :: Tweening Objects To Specific Position?

May 10, 2011

Right now I'm working on a website that has movie clips that I want to tween back and forth across the stage when a button is pressed.

Here's the idea:

When 2_btn is pressed, I want 1_mc, 2_mc, and 3_mc to move from right to left and then stop when 2_mc is positioned on the stage, stop moving and play

Then if 3_btn is pressed I want all three to be animated from right to left until 3_mc is positioned on the stage, stop moving and play

Then if 1_btn is pressed I want all three to move from right to left until 1_mc is positioned on the stage, then stop moving and play

Basically I have no idea how to accomplish this, or how to word it into Google.

What I have right now, which obviously isn't accomplishing what I want is:

Tween from left to right across the timeline, and then using a gotoAndPlay, and then stop(); on the frame..

View 2 Replies

Flex :: Charts - LineChart, LineSeries, DateTimeAxis Do Not Connect Points On Specific Time Distance?

Jun 21, 2011

I have a LineChar, with one LineSeries, on which i am drawing values ( Y axis ), on specific time ( X axis ).The problem is that i don't wanna the points which is distanced on a specific distance in time ( let say 6 hours ) to be connected.Is there a way to make LineSeries with DateTimeAxis not connecting points distanted in specific time ?

View 1 Replies

ActionScript 2.0 :: Distance From Center - Output Distance Only In Positive Numbers

Jun 17, 2005

I am working on the project where everything is based on the distance from the center of the stage. First I made this fla where flash outputs the x and y distance from the center. First problem is that I want to output distance only in positive numbers.

View 1 Replies

ActionScript 3.0 :: Making Distance Between All Mcs At Equal Distance From Each Other On Mouseover

Oct 16, 2010

I am posting my code that attaches the movieclips on stage

[Code]...

i was hoping that when the newMc expands, all other mc would keep the same distance between each other as at initialisation. I not able to figure how to do it. maybe even an earlier post or llink where similar query was explained.

View 1 Replies

AS3 :: Listen/respond To A Specific Cue Point By Name?

Mar 15, 2010

How do I listen/respond to a specific cue point by name in AS3?
 
I have this listener which runs a function as soon as a cue point is reached, but I can't figure out how to run different functions for different cue points.
 
center_flv.addEventListener(MetadataEvent.CUE_POINT, interactive);

View 3 Replies

ActionScript 3.0 :: Initialising A Point With A Specific Value

Feb 12, 2012

Whenever i want to declare a point with a specific value, it takes me three lines:[code]It isn't a huge amount of effort, but i'm becoming tired of doing this hundreds of times. Is there an easier way?I've tried doing something like this:[code]but that gives me an error, because it only accepts one input parameter.how can i do this simple operation in one line ?This is also important to me because i'm making a fair bit of use of static classes, (non instanced, making use of static public vars) where (afaik) i cannot run code. I want to be able to declare global point variables in a static class, without having to use some external class to set the values.

View 3 Replies

ActionScript 3.0 :: Get The Distance Between 2 3D Objects By Using Distance Method

Apr 28, 2011

In AS3 I am trying to get the distance between 2 3D objects by using distance method.
  
if(Vector3D.distance(model.position,model2.position) < 100)
{
// do something

[Code]....
 
>>You can use it directly as a method of the Vector3D class to get the Euclidean distance between two three-dimensional points.
 
Which point does this method pick? Is it the closest point to the other object ?
 
I am just thinking of how much time this would take in testing objects with large poly count.

View 1 Replies

ActionScript 1/2 :: Load Movie And Go To The Specific Cue Point?

Oct 24, 2011

How can I load movie(1.swf) into the current file and make it go play the specific cue point (of the child's file)?

[Code]...

View 1 Replies

ActionScript 2.0 :: Round A Number To A Specific Point?

Mar 25, 2007

Is there a way, or even better a class available in flash to help me round a number to a specific point. For example, I have need to have a number rounded to the nearest 15th, how would I do that?

View 7 Replies

ActionScript 2.0 :: Making Url Point To Specific Mc In Swf File

May 7, 2008

I made a map for big shopping center in flash that uses tooltips to display the shop names when moused over. Is there anyways I can make a url(html) from any of those shops refer to its specific movie clip? I am askingt because the shops wishes that its customers or site visitors should easily see the location of the shop when they click " show shop location on map"

View 4 Replies

ActionScript 3.0 :: Rotating A Circle To A Specific Point

Mar 6, 2009

What I'm trying to do is make a dial-type of interface, where you click on a point on the edge of a circle and that point will rotate to another point at the top of the circle. What I can't figure out is how the make "Point B" rotate to "Point A", where "Point A" is always fixed at the top of the circle and "Point B" (and Point C and Point D, etc...) are located along different points on the edge of the circle. I'm using the tween function to rotate, so what I need to figure out is how to get the difference in the rotation between the two points.

View 7 Replies

Actionscript 3 :: Change The Video And Start It At The Specific Point?

Sep 19, 2011

I'm having a problem and I do not think the solution. I'm new using Flash.I have a video player and now we are implementing an HD button, the player always starts the video and 360P format and stream begins, if the user click on the HD I need to save the time of the video when it was clicked and then call another file. mp4 720P and start it at the same point that was recorded.I've tried various ways using CONNECTION.STREAM.seek(TIME); and always starts at (0), I feel that because of not being in Buffering he does not understand

View 1 Replies

ActionScript 3.0 :: Triggering An Event At A Specific Point Of An FLV File?

Jun 30, 2009

I have a file that loads in several flvs.At certain points during the flvs, I need to trigger events on other timelines.Right now, I have them set up as listeners using enterFrame to detect playheadTime.This works, but is too hard on the CPU that is running the file.Is there something similar to VideoEvent.COMPLETE that could trigger events at other specific points in the flv?

View 2 Replies

ActionScript 3.0 :: Rotating Around Matrix Point To Specific Angle

Mar 5, 2010

I have a slider which I want to use to rotate an image around it's center. This normally is easy but my problem is the clip is made dynamically and the size changes so I can't use the default registration point and I need to assign the center point before I rotate it. I found the rotateAroundExternalPoint function which rotates around a center point fine. How to get it to rotate to a certain angle and then have it stop at that angle. The rotateAroundExternalPoint increments the rotation rather then allowing me to set the angle to rotate to. Is there anyway that I can set what angle to rotate my clip to? It right now increments the rotation by the x coordinate of my slider bar (slider_position.x).

Code:
import flash.geom.Matrix;
import fl.motion.*;
var mat:Matrix = clip.transform.matrix;
addEventListener(Event.ENTER_FRAME,EnterFrame3);
function EnterFrame3(event:Event) {
var center_point_x = clip.height / 2
var center_point_y = clip.width / 2 //
MatrixTransformer.rotateAroundExternalPoint(mat,center_point_x,center_point_y,slider_position.x);
clip.transform.matrix = mat;
}

View 9 Replies

ActionScript 2.0 :: Seek To Specific Point In Video Before It Buffered

May 22, 2010

I'd like to start playing a web-based video at a specific time, say 2 minutes in, even if the video hasn't been downloaded that far. I thought I could just "seek" to that time but that apparently only works when the video is buffered first.

So for example, this:
Code:
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
ns.play("[URL]");
ns.seek(123);
video.attachVideo(ns);

Seems to work if you have the video cached or buffered or whatever, but if you don't it gives the "NetStream.Seek.InvalidTime" error, which makes sense. I want to know if it's possible to start playing a video at a specific time, even if the video hasn't loaded up to that point.

View 1 Replies

ActionScript 3.0 :: Change The Video And Start It At The Specific Point

Sep 19, 2011

Good afternoon staff. I'm having a problem and I do not think the solution. I'm new using Flash. I have a video player AS3 and now we are implementing an HD button, the player always starts the video and 360P format and stream begins, if the user click on the HD I need to save the time of the video when it was clicked and then call another file. mp4 720P and start it at the same point that was recorded. I've tried various ways using CONNECTION.STREAM.seek(TIME); and always starts at (0), I feel that because of not being in Buffering he does not understand. Can anyone help me solve this?

View 0 Replies

ActionScript 2.0 :: Point To A Specific Scene When Mouse Is Inactive?

Oct 17, 2006

I'm working on a presentation to be presented on a Trade Show. It have an inicial movie, running in loop, but with a Menu bar, so people could stop the movie and go to a product catalogue. I want that when people stop looking the catalogue and go away, the presentation go (after a few minutes) to the initial movie loop again.

View 4 Replies

Actionscript 3 :: Flash Zooming In (scaling Up) To A Specific Point Within A Clip

May 24, 2011

I'm trying to scale a container/parent movie clip up so that I effectively zoom in to a point referenced by one of its children. I've figured out how to use globalToLocal to get that point at the center of the stage, but the problem is the registration point for the container clip is (and needs to stay) at the upper left, so when I scale the container clip up, the point does not stay in the center of the screen. Here's my code:

[Code]....

View 1 Replies

ActionScript 3.0 :: Pausing Flash At A Specific Point In Timeline On MOUSE_OVER?

Dec 6, 2009

I am very much new to AS3 and Flash and had a problem trying to get my Flash timeline to pause at a specific point if the mouse was over any part of the stage. If the mouse was not or no longer over the stage I wanted the timeline to continue playing where it had left off.

I managed to solve the problem after a few hours and would like to share my first piece of AS3 - it might help someone else who has a similar problem, or you might be able to improve it.

One of may main objectives was to make sure the code cleaned up after itself and left no listeners or timers running.

[Code]...

View 2 Replies

ActionScript 3.0 :: Make A Bullet Launch At Different Degrees (anywhere From 1-360) From A Specific Point Towards The Mouse

Jul 30, 2009

I need to make a bullet launch at different degrees (anywhere from 1-360) from a specific point towards the mouse.

View 3 Replies

Motion Tweening Error : Motion Tweening Will Not Occur On Layers With Ungrouped Shapes .....?

Jul 27, 2009

I'm getting the following error: Motion tweening will not occur on layers with ungrouped shapes or on layers with more than one group or symbol. I don't have any ungrouped shapes (it's all text), each layer has 5 instances of only one symbol (keyframes), no objects are grouped and text is all static text.

When watching the animation, the first word (web) looks fine, on the second word (design) the tween fails on the last couple of frames of that clip (the blur filter disappears), the third word (and) is OK, and on the forth word (development) the blur filter is not applied to the last 16 frames of that clip.I broke each animation into its own MC thinking that was causing the issue, but that didn't fix anything.

View 5 Replies

ActionScript 3.0 :: Pushing Point Locations Into An Array - Point(x,y) Conversion Faillure?

Dec 9, 2011

Im pushing Point locations into an array to Shift em out later. like this:

tempmoves.push([new Point(roundx,roundy)]);
..
ob.movestoplayer = tempmoves;[code]....

What am i doing wrong?

View 8 Replies

ActionScript 2.0 :: Movieclip To Move Along The X-axis To A Certain Point And Then Back To The Starting Point Again?

Apr 12, 2007

It's been a long time since I've done any work with actionscript, and alas I've forgotten nearly everything. I've tried to look for a tutorial that would explain basic animation with actionscript, but the one that I found on Kirupa was no longer there.

Basically I'd like to do this:On the stage I have a movieclip and I'd like the movieclip to move along the x-axis to a certain point and then back to the starting point again. The moving speed of the movieclip should also be adjustable.

View 8 Replies

Flash :: Perspective Projection Formula - Convert 3d Point To 2d Point?

Mar 27, 2011

How to convert 3d point to 2d point? I've found next formula in Internet(camera is situated in origin)

[Code]....

But these formulae give me strange result when z are less than zero(z<0) I need build line from A(100,100,100) to B (100,100;-100) As you can see these equations give really strange result when I try to convert B point in 2D dimension

View 1 Replies







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