Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




PLS Helpppp - Guided Moving Line



hi guys,

I'm fairly new to flash. I'm using flash cs3 and all i need to do is a simple guided moving line. Can anyone out there help me out on this?
Just like how you can move a object through a guided path/line (using tween), i'd like to know how can i draw a line which follows a guided path as well?
plssss helpppp



FlashKit > Flash Help > Flash Newbies
Posted on: 05-16-2008, 02:20 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[CS3] Guided Moving Line
hi guys,

I'm fairly new to flash. I'm using flash cs3 and all i need to do is a simple guided moving line. Can anyone out there help me out on this?
Just like how you can move a object through a guided path/line (using tween), i'd like to know how can i draw a line which follows a guided path as well?
plssss helpppp

[CS3] Motion Guided Line
Hi,

I would like to create a line that follows a certain path. At first no line will be visible but then the line wills how and "grow" to follow a certain path. To fill a certain path with it's colour. If anyone could tell me how this is done i would creatly apriciate it.

picture of the "path" it has to follow can be found here:

http://img184.imageshack.us/my.php?i...tpanneldr5.jpg

once more thanks in advance !

Moving Along A Line
I would like to make a shooter which fires out of a canon at various points based on mouse click. So for now what i have done is I have a start point which is the mouth of the canon and the end point which is the place where the person clicks. And upon click, the cannon fires.
Simply put the canon waits for a mouse click. on click, it fires but the movement ends at point where the user clicked. This doesnt look cool if the target has moved or the user has not even clicked on the appropriate target. I would prefer if the cannonball could continue to move along that line until it goes off the stage when it is deleted.
Currently, I am using tweener class, so my code looks something like this.
-----------------
private function moveIt(e:Event):void{
Tweener.addTween(e.target,{x:mouseX,y:mouseY,time: 1,onComplete:disappearMe(e.target)});
}
private function disappearMe(e:Object):void {
Tweener.addTween(e,{delay:1,alpha:0});
}

-----------------
Any assistance would be greatly appreciated.

Thanks

Moving Along A Line.
I would like to make a shooter which fires out of a canon at various points based on mouse click. So for now what i have done is I have a start point which is the mouth of the canon and the end point which is the place where the person clicks. And upon click, the cannon fires.
Simply put the canon waits for a mouse click. on click, it fires but the movement ends at point where the user clicked. This doesnt look cool if the target has moved or the user has not even clicked on the appropriate target. I would prefer if the cannonball could continue to move along that line until it goes off the stage when it is deleted.
Currently, I am using tweener class, so my code looks something like this.

ActionScript Code:
private function moveIt(e:Event):void{
Tweener.addTween(e.target,{x:mouseX,y:mouseY,time:1,onComplete:disappearMe(e.target)});
        }
private function disappearMe(e:Object):void {
Tweener.addTween(e,{delay:1,alpha:0});
        }

Any assistance would be greatly appreciated.

Thanks

Moving Line......
Hello

I was wondering how i make a line go around a shape, like kinda draw the shape, do u know what i mean? i cant find a example but ive seen it somewhere

If you could help me i will be very grateful

Thanks

Jason

Moving Along A Line
I would like to make a shooter which fires out of a canon at various points based on mouse click. So for now what i have done is I have a start point which is the mouth of the canon and the end point which is the place where the person clicks. And upon click, the cannon fires.
Simply put the canon waits for a mouse click. on click, it fires but the movement ends at point where the user clicked. This doesnt look cool if the target has moved or the user has not even clicked on the appropriate target. I would prefer if the cannonball could continue to move along that line until it goes off the stage when it is deleted.
Currently, I am using tweener class, so my code looks something like this.
-----------------
private function moveIt(e:Event):void{
Tweener.addTween(e.target,{x:mouseX,y:mouseY,time: 1,onComplete:disappearMe(e.target)});
}
private function disappearMe(e:Object):void {
Tweener.addTween(e,{delay:1,alpha:0});
}

-----------------
Any assistance would be greatly appreciated.

Thanks

Moving Line......
Hello

I was wondering how i make a line go around a shape, like kinda draw the shape, do u know what i mean? i cant find a example but ive seen it somewhere

If you could help me i will be very grateful

Thanks

Jason

Moving Chart Line
I'm trying to animate a chart line/arrow to show the line move from start to end point. I don't know how to do this without creating a new arrow image for each frame of the animation.

I have Swish and Flash MX. Can anyone give me any suggestions or point me towards any swf files already done along these lines?


Thank,
Jenn

Help To Make A Moving Line
I want to make a moving line where the start point i steady. The line should move straight forward and stop.

Moving Objects Along A Line?
i've been using motion tweens to animate my movies and i'd like to reduce the size by using actionscripting to achieve the same effects. can anyone suggest any tutorials that will take me through the basics of using actionscripting to move objects along a line?

here's my current website and the first 20 frames are nothing but motion tweens. any suggestions on how to reduce the load up time??

http://web.mit.edu/jbradd/www

Problem With A Moving Line
So I made this movieclip that is just a line going from (0,0) to (100,100) and i was using this drawline() function (see the code) to change its shape.

What I want to have is the top of the line (the #stop variables) to slightly move back and forth to create a nice animation of moving grass (what i want to achieve with this in the end).

This is the first time i'm fully coding something in the first frame of the _root timeline (I always had bits and pieces of code everywhere before), and i'm having some problems with it.

I am using Math.sin() to make it move back and forth, but theres the part it wont work. Strangely, it seems to be choosing a position at random all the time, or its moving back and forth so fast its impossible to see.


Code:
function drawLine(xStart, yStart, xStop, yStop) {
attachMovie("baseLine", "Line"+iDepth, iDepth);
this["Line"+iDepth]._x = xStart;
this["Line"+iDepth]._y = yStart;
this["Line"+iDepth]._xscale = xStop-xStart;
this["Line"+iDepth]._yscale = yStop-yStart;
}
_root.iDepth = 1; // must specify a depth value for the movieclip
xStart = 30;
yStart = 100;
xStop = 200;
yStop = 20;

this.onEnterFrame = function()
{
xStop = Math.sin(xStop++)*10;
drawLine(xStart, yStart, xStop, yStop);
}
anyone here that can help me out with this?

Moving Line/Squares
Hello all.

I have a simple task. To make a blind effect with coloured lines/squares. I can't seem to get the hang of it.

Can someone point me in the direction of a tutorial? The best i can describe it, it there being a picture, and then coloured squares/lines going down it to cover it.

Thanks in advanced for your time

Line Between Two Moving Points
Hey Guys,

Trying to piece this together using the tutorials but not getting it so far...

What im trying to do is have two circles with a line from the center of each.

I want the circles to be able to move and the line stay connected to the centers of each.

So Im trying to write/find code that draws a line from the centers of the two cirlces and stays connected no matter where the cirlces move on the stage.

No interaction with the mouse. Wondering if you can point me in the right direction.

Thanks!

Moving One Point Of A Line
Hi-

I've tried several different approaches now on this problem, and I am at a loss...

I have multiple sprites of the same class(orbs) that each have multiple lines drawn to them from what I want to be stationary points. There are six possible stationary points, each stored in a Point variable.

The orbs drag and drop and I would like the lines associated from each orb to stay connected to their stationary point, but have the line essentially follow the orb. I had no problem drawing the original lines, just having them follow the orb. As of now the lines are NOT children of the orbs, but rather each set associated with a particular orb is stored in its own sprite.

I appreciate any conceptual guidance...

Thank you!

Draw A Moving Line From (400,100) To (500, 150)
Hi hi,

I am newbie in AS3. This forum is great. With the replies of my previous post, I have learned how to draw vertical, horizontal or with 45 degrees moving line.

But what if I want to draw a line from (400,100) to (500, 150).... I think I need to use some sine, cos or tan formula to increment ... right ?? :

-----------------------------------------------------------

var line:Sprite = new Sprite;
addChild(line);

with (line.graphics) {
clear();
moveTo(400, 100);
lineStyle(1, 0xff6600);
lineTo(500, 150);
}

var sp:Sprite = new Sprite;
addChild(sp);
var lineY:uint = 100;
var lineX:uint = 400;

function drawLine(e:Event):void {

with (sp.graphics) {
clear();
moveTo(400, 100);
lineStyle(1, 0xff6600);
lineTo(lineX++, lineY++); // I know this is not correct !!!!
}
trace("lineX = ", lineX, " lineY = ", lineY);

if ((lineY>150) || (lineX>500)) {
removeEventListener(Event.ENTER_FRAME,drawLine);
}
}

addEventListener(Event.ENTER_FRAME,drawLine);

------------------------------------------------------------------------

Please show me how to achieve this.

Thanks

Florence

Moving One Point Of A Line
So here's one for all you experts out there...

Let's say I draw a line in AS3:

Code:
var line:MovieClip = new MovieClip();
var container:MovieClip = new MovieClip();

container.addChild(line);
addChild(container);

line.graphics.lineStyle(3, 0x0000FFFF);
line.graphics.moveTo(200, 50);
line.graphics.lineTo(250,50);
Can I move JUST the starting point or the ending point? Something like this:


Code:
.
.
.
addEventListener(Event.ENTER_FRAME, moveIt);

function moveIt(e:Event):void {

line.startingPoint.x -=5;

}
Thoughts?

Moving Line Thing
Does anyone knows a tutorial (macromedia flash mx) about: a moving white line that moves across the outerline of a image? (sry for my lack of english)

Something like this:


Check my MSpaint skills :P

Thank in advance,
symtic

Moving Line Animations
Ok, so I am asking about a moving line animation, similar to that of the "Aurora" screen saver on Vista. That's the best I can think of for an example. I was thinking creating about 10 blurred lines, configuring them all on their own motion tween, then loop? Is this the only way or is there a more compact way?

Moving Dash Line Around Textbox, How?
I want to create a moving dash line box around a textbox when it is selected. I could create the thing in Photoshop and make an animation. But I have 6 textboxes and I thought what if the client decides they want the textboxes different sizes?

So I was wondering how I might do this in action script to make it easier to change.

Any help would be greatly appreciated.

Chris

Moving From One Point To Another On A Straight Line
how can I make one instance of a MC go to the same position as an instance of another MC on a straight line, and lets say, 5 steps?
I tried here, but it didnt work:
steps = 5;
conta;
itera;
TY = there._y;
TX = there._x;
distY = there._y-here._y/steps;
distX = there._x-here._x/steps;
if (conta == 12 and itera<=5) {
there._y = TY-distY;
there._x = TX-distX;
TY = there._y;
TX = there._x;
conta = 0;
itera++;
} else {
conta++;
}
place();

How Do I Make A Fading Moving Line?
i want to create a fading moving line. for example, i have a movie clip that shows a line that draws a simple square box, but i want the tail of the line to fade off while it is drawing the box. for lack of a better example, the effect i want is like this

http://www.flashkit.com/movies/Effec...n-80/index.php

but i'm not doing a mouse trailer,i just want that nice gradual fade effect. how do i achieve that??

How Would One Go About Creating A Moving Dotted Line?
I am trying to create an animation of a coach drawing up his football strategy on a chalkboard. An example is like below


My main barrier is figuring out how to animate a moving dotted line without doing frame-by-frame method.

Shape tweening seems to just mess it up with
1st Frame: Original dotted line
Mid Frames: Just one solid time
Final Frame: Final length in dotted line

If I animate it straight its alright. But in curves the line will not follow the path I would give it.

An example of what Ive achieved so far in trying this is here

Can anyone help?

Thanks

Help: Want A Line Drawn Behind A Moving MovieClip
I have a small circle that, when you push a button, teleports to the button's position and then moves at a velocity of -25 down the Y axis.

I would like to use this code to have the moving circle draw a line where ever it goes:


PHP Code:



createEmptyMovieClip("trail",1);
_root.trail.lineStyle(1,0xFF0000,100);
_root.trail.moveTo(smallcircle._x, smallcircle._y)
_root.trail.lineTo(smallcircle._x, smallcircle._y)




but this is obviously flawed since I do not get a line at all.

Any help would be much appreciated

Actionscript 2 Curved Line Moving...
hi all, I'm creating a high jump game with AS 2.0. I need to replicate the bend of the pole, and then the steps taken to bend the pole back again, depending on the speed of the jumper. Anybody got any examples or ideas? I found a great example in AS 1.0 but I really need to get on to 2.0 instead. I can create a line with a bend, but can't get my head around the maths to do anything with it. All help really appreciated.

[F8]Objekt Moving Along Drawn Line
Hi guys,

I need help with the early stages of a simple flash game. There is an object that falls down from above, this object is supposed to move along a line which is drawn while the object is falling.

Implementing the falling object and the ability to draw lines is no problem, but how do you tell flash to make the object move along the drawn line once it collided with it?

Thanks in advance for any helpful advice.

-eclaw

How To Make Moving Dotted Line?
Hello, I have a question
I want to make a dotted line that is moving on the path in loop
I made one dot that is moving on the path, but how can i duplicate it so that i will have a hole line of moving dots, that are moving in loop, allways
Pls help me, i'm using flash 8
Lenka
see attached picture - tha't the lines that i'm talking about

Help With Moving At A Constant Speed Along A Line
Hey guys, it was suggested that I post this in here since it has to do with AS3.0. Would you guys mind checking out this thread in the Math and Physics Forum. It's had a few posts in it and some updates, so please check it out and see if you can help me with my issue.

THANKS!

Moving In A Straight Line From One Point To Another
Hey everyone. I've got a simple question for you guys.

How do you move a movieclip from one point to another, directly in a straight line?

For example if I wanted it to move from 232,415 to 105,98

Any ideas?

Dotted Line Moving On Guide
Hello, I have a question
I want to make a dotted line that is moving on the path always.
I am trying to make that all day, but it's doesn't work like I want .
Pls help me if you have the time
Lenka
see attached picture - tha't the lines that i'm talking about

Continuous Moving Line Animation
http://www.la-sight.com/LS_how_near.asp

Can some one tell me how to do this animation ( the continuous moving line animation)


I have gone through the Tutorials at Kirupa for Continous movement it it didnot help me out

Thanks

Continous Moving Line Animation
http://www.la-sight.com/LS_how_near.asp

Can some pls help me out, on how to do this lien animation.

Is there any source or tutorials available for this coninous movement, using tween motion or actionscripting


Thanks

How Do I Make A Line That Will Stretch Between 2 Moving Symbols?
how do i make a line that will stretch between 2 moving symbols?
this is probably very basic but I can't seem to fugure it out. thanks in advance

Moving Dashed Line (hopping And Fading)
(sorry for my english)
Maybe very simple, but I just cannot figure out what the easiest way is.
I want a dashed line moving around a square button. So what you see is a dash hopping forward and fading dashes were it came from.
Anyone?

Draw Line Follow The Moving Object
Hi,

do you guys know how do i draw a line/path follow the moving object?

i use the following code to make the movement of the object, but i want a line to trace its moving path. can anyone help?
movingObj._x=Number(my_x)+Number(xmov);
movingObj._y=Number(my_y)+Number(ymov);



thanks

[CS4] Help Me Create Moving Road Line .. Example Included.
hi. ive been trying to do this but no luck. i just want the middle line done. more realistic than the gif i linked. thanks in advance!

http://johnemiller.com/images/road_anim.gif

[CS4] Help Me Create Moving Road Line .. Example Included.
hi. ive been trying to do this but no luck. i just want the middle line done. more realistic than the gif i linked. thanks in advance!

http://johnemiller.com/images/road_anim.gif

the way i did it is i got 3 lines back to back but somehow the timing is wierd because the lines move from point a to b but at the same time they get bigger. my main problem is that the 2nd line is catching up with the 1st line instead of keeping a constant distance. the lines go pretty fast at first but slows down as they get bigger thus the 2nd line catches up. i changed the timing way longer than the 1st line and still the 2nd line catches up and overlaps.

Function Not Finishing The Current Line Before Moving On
public function send_Request(url1:String, uri:String){
var loadit_lv:LoadVars = new LoadVars();
loadit_lv.load(url1+uri);
loadit_lv.onData = function(data:String){
trace(data);
}
trace('Donee with function');
}

This function prints:

Donee with function
Text string from onData

Someone help me to understand why the last line of the function outputs before the .load method finishes executing?

Help Me Create Moving Road Line .. Example Included.
hi. ive been trying to do this but no luck. i just want the middle line done. more realistic than the gif i linked. thanks in advance!

http://johnemiller.com/images/road_anim.gif

the way i did it is i got 3 lines back to back but somehow the timing is wierd because the lines move from point a to b but at the same time they get bigger. my main problem is that the 2nd line is catching up with the 1st line instead of keeping a constant distance. the lines go pretty fast at first but slows down as they get bigger thus the 2nd line catches up. i changed the timing way longer than the 1st line and still the 2nd line catches up and overlaps.

Moving Object In A Straight Line Using Mouse
Hi, i have created some code to move an object to a mouse pointer's position. The problem is that it does not travel in a straight line.

I think the problem has to do with the conditions of x and y. I want to calculate the gradient(x/y or (x1-x2)/(y1-y20) or create an incrementation of a set of points that are similar to the gradient to reach the destination...i dont know how to do that tho.



Code:
var circle:Sprite = new Sprite;
circle.graphics.lineStyle(1,0x0000FF);
circle.graphics.drawCircle(100,100,50);
circle.graphics.endFill();

var mouseClickCheck:Boolean = false;
var circleX:Number = 0;
var circleY:Number = 0;
stage.addEventListener(MouseEvent.CLICK, handleMouseMove);
addEventListener(Event.ENTER_FRAME, UpdatePosition);

addChild(circle);

function UpdatePosition(event:Event):void
{
if(mouseClickCheck)
{
trace("[circleX] = " + circleX);
trace("[circle.x] = " + circle.x);
if(circle.x <= circleX)
{
circle.x += 100;
if(circle.x > circleX)
{
circle.x = circleX;
}
}
if(circle.x >= circleX)
{
circle.x -= 100;
}
if(circle.y <= circleY)
{
circle.y += 100;
if(circle.y > circleY)
{
circle.y = circleY;
}
}
if(circle.y >= circleY)
{
circle.y -= 100;
}
}

}

function handleMouseMove(event:MouseEvent):void
{
mouseClickCheck = true;

circleX = mouseX;
circleY = mouseY;

var g1:Sprite = new Sprite();
g1.graphics.lineStyle(2,0x0000FF);
g1.graphics.beginFill(0x0000FF);
g1.graphics.drawCircle(mouseX,mouseY,5);
addChild(g1);
}

How To Make A Line Of Images Continue Moving Across The Page?
I have about 6 images that i want to have move across the page but i dont know how to make them continue following each other as if they are going in a circle but not round (see what i mean?) they are just following each other and when the last one starts going across the screen the first one follows it. i want each of these to be buttons also but that i think i can do. i am just having problems with the moving images and how to get them to follow each other when the first set has gone by.
thanks
arielle

Scaling And Moving A Line Across The Screen In Repsonse To A Rollover
Hi people!!

Wow - 3wks today! Scary! Anyway....

I really need some help!

I've got a horizontal menu running across the top of the page. Its a simplistic looking one using just words as buttons. However I would like to make it a little more interesting by having a line that will shift from button to button (left to right etc.) as the user rolls over the respective buttons, so it 'underlines' them.

I can make it jump from button to button by having the line as an MC then using the _x(position) property, but really I would like it to 'move' accross the screen to each button.

If possible to make it even sexier! I would like to be able to change the _xscale of the line so it 'grows' / 'shrinks' to the right size of each word.

REALLY hope someone can help me!!

Cheers Deadhands

Anything nice in your Advent Calendars today?!

Moving A Variable From A Function To A Single Line Of Code
Hi guys im having trouble getting the var name_ent1 out of this function. could some one help?

var name_ent1
setPaper = function {
name_ent1 = this.text;
trace(name_ent1)
names.tester.text = name_ent1.text();


};



I would like to display the variable name_ent1 in the below line of code,
so i have decalred the var outside the function but it still doesn work.

pre_body_1 = "It was the celebrity wedding of the year as" +name_ent1+ "married";

Moving A Point And Remaining A Path (line) Back
I want to move a point to a coordinate (_x,_y) and this point must go there slowly and create a path (line ) . After that the point must return and also slowly and the path must disapeare. Can You help me. I am a beginer.
I need to know an instruction used for delayng actions.
Bye.

Helpppp
so, i use adobe photoshop to create layouts and i slice them up with adobe imageready. well, the header in my page, i made in flash, and when i embedded it into the page...the flash portion offsets the image by a pixel. i need help.

here is an attachment of what is done.

Helpppp?
I'm having serious problems when trying to resize the photos in my slideshow to be contained in a box. They keep fluctuating between a correct size and their original size. Below is my function. When I set the xscale and yscale to known values, i.e. 50, it works fine, but as soon as I change it to be more Object oriented, it fails. Any ideas?? Thanks!!


Code:
function resizeImage(){
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
//Picture is the movieclip where the pictures are loaded.
//Border is the movieclip border within which I need
// the image to be contained.
var picW = picture._width;
var picH = picture._height;
var borW = border._width;
var borH = border._height;
scale = yscale = xscale = 100;

if((picW > borW) && (loaded == filesize) && (loaded > 10)){
scale = (borW / picW)*100;
xscale = scale;
}
else if((picH > borH) && (loaded == filesize) && (loaded > 10)){
scale = (borH / picH)*100;
yscale = scale;
}
else if ((loaded == filesize) && (loaded > 10)){
xscale = yscale = 100;
}
scale = Math.min(xscale, yscale);

picture._xscale = picture._yscale = scale;
picture._x = border._x + ((border._width - picture._width)/2);
picture._y = border._y + ((border._height - picture._height)/2);
border._visible = true;
}

Need Serious HELPPPP
need serious help...i did the scroll window tutorial

http://www.kirupa.com/developer/flash5/slidingmenu.htm

ok my prob is i want to load a swf onto the stage of each press of a button...

for ex. i click on button1/2/3 or 4...and while it scrolls to the area it also loads a movie .....how would i do that for each button....

Helpppp
When i make the arrows come up to the spot and ur suppose to tap the arrow but when you hold the arrow it will rack up the points because i made it add 5 on the left arrow but when u hold it adds alot. How do i make it so when the tap it more than once it doesn't keep adding points it disables that. I will greatly apprectave any help i can get. Tnkz

Need Serious HELPPPP
need serious help...i did the scroll window tutorial

http://www.kirupa.com/developer/flash5/slidingmenu.htm

ok my prob is i want to load a swf onto the stage of each press of a button...

for ex. i click on button1/2/3 or 4...and while it scrolls to the area it also loads a movie .....how would i do that for each button....

LoadMovie Helpppp
Hi this is a constant problem I keep having in Flash MX...


1. I try to Load a .swf into my empty movieclip.
2. the script I use is something like this (this isnt it EXACTLY cos Im not at my proper computer with Flash)

STOP, on rlease, unloadmovie (eg, mainpage), loadmovie (page1) into empty
2. My problem is AWLAYS this: I get a slight delay when the new swf is loaded.

3. Is this because I have a stop in there? But if I take it out then the page wont hold will it for the viewer to look at it?

Please help me!!! I cant work it out!!!!!!

Thanks so much!!!

Copyright © 2005-08 www.BigResource.com, All rights reserved