Line Streching To Mouse? How To Do It? How?
say i am making a game to shoot thing (digimon, telletubbies and pokemon) and i need a laser line... how would i go about making it strech to my mouse nad aim the gun with the line?
FlashKit > Flash Help > Flash ActionScript
Posted on: 11-13-2001, 07:13 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Streching A MC
Hi, guys,
I found a great tutorial about flash full screen site, but I want to do one more thing. Let say I have a full screen site. In a swf is a MC, positioned in the center of the screen but the top of the MC must always be on the top of the screen. So in short, it must somehow get bigger if the user uses higher screen resolution. Any ideas how to do that?
THX
Animating(mx) Streching
I am trying to create an effect where I have a giraffee with a short neck and I am going to strech the neck so that his neck becomes longer. I dont want to disort the graphic in any way. I tried just hiding extra neck w/ a graphic of the head but that didn't work too well. I was thinking mybe some sort of mask, but I think that would be difficult too.
I just want to go from a short neck, to a long neck. Thanx for any suggestions you have in advance.
Streching A Scene
Ive created a scene that is 32 seconds long at 30 fps. Our client wants the movie to be streched to 40 seconds. How can I do this? I have Flash CS4.
IMAGE IS STRECHING
Hello guys!
Check: http://www.inwww.ltd.uk/go4Global/meniu.html
Check the home section where you can see it better. Press the button to go to the home section and then press any button....see how the "home" picture is streching!!!!!...this thing is visible at "account" section too....
WHY THIS IS HAPPENING??????
Regards,
Dragos.
http://www.inwww.ltd.uk
Streching Movie And Aligment?
Is it possible when customer strech movie, movie aligment is left (left part of movie is allways visible, and right part becomes visible just if customer strech movie?
Default aligment is center.
I was set "alowscale" to "false".
Tnx in advance
Resize Without Streching....just Have To Read It
this might be a little confusing, here is what I want to do......
dumbed down for ease of explaining.
I have a column that is in the middle of the SWF...
I have a BG image that I want to stretch and shrink along with the size of the resolution so it is always no tile, and fills the screen.
but the middle column is always centered, and does not strech.
I know there has to be a way.......hopefully any one know it....
I have this...but not really sure how to get it to wrok in my situation
Picture Streching For An Unknown Reason
Hi everyone, this is my first time using flash.
I followed a tutorial at http://www.lukamaras.com/tutorials/a...e-gallery.html and everything is working okay, except when I view the big images they are 4x wider than they should be, stretching to the right. I think its a problem with action script maybe because I'm using cs3, and saving the file as flash 8? I'm not sure. I've included the file and the xml/photos it references in case anyone is nice enough to check out my problem.
http://www.mediafire.com/?euw1wywgnvg
Thanks! -mike
Flash ToWindows Streching And Elements Position
Hello Guys !
pls take a look on this http://www.greenhills.ru/i/home/index.swf
Someone can tell from with property it's can be make
I mean vertical top aligment in swf (not centered as usual) and horisontal left for one and right for another elevents
I reread all documentation but can't find any way for make this
Thank for advice
Vyacheslav
feel free to contant me (root@inomnium.com) ICQ:171174878
Flash ToWindows Streching And Elements Position
Hello Guys !
pls take a look on this http://www.greenhills.ru/i/home/index.swf
Someone can tell from with property it's can be make
I mean vertical top aligment in swf (not centered as usual) and horisontal left for one and right for another elevents
I reread all documentation but can't find any way for make this
Thank for advice
Vyacheslav
feel free to contant me (root@inomnium.com) ICQ:171174878
Mouse Tracking Line
I need to know how to make it so that a line is drawn to follow where my mouse goes
i'm using the standard startDrag tracker script to track mouse but do not know where to go from there
help appreciated
thanx
Mouse Following Line ProblemHELP
I'm trying to create a line that follows mouse cursor and fades out after a certain distance
code i'm using is this
~~~~~~~~~~~~~~~~`
startDrag ("/tracker", true)
set ( Line, Newline&/:Counter );
duplicateMovieClip ("/Line", Line, /:Counter)
set ( Line, "/"&Line );
set ( NewX, getProperty ("/tracker",_x))
set ( NewY, getProperty ("/tracker",_y))
setProperty ( Line, _X , Position = /:OldX)
setProperty ( Line, _Y , Position = /:OldY);
setProperty (Line, _Xscale, NewX-/:OldX);
setProperty (Line, _Yscale, NewY-/:OldY);
~~~~~~~~~~~~~~~~
I keep getting the ")or , expected" error with the set property statements.
Any help seriously appreciated
THANX
Mouse Tracking End Of Line
How do I make a line that stretches to where ever I am pointing my mouse?
The start of the line is static, and the end of the line streatches to where my mouse is.
Line Mouse Trail
Im trying to make a couple of lines follow the cursor and then snap into place when they reach certain areas of the screen as seen in this website;
http://www.chameleoncreative.co.uk
I got a little way, I managed to get them to snap into place by making the lines change to a still movie clip when the mouse enetered certain buttons but i dont know how to constrain them to a certain area or why they appear at the top of the screen whenever the mouse leaves the button areas!
I'm affraid i'm totally awful at explaining myself and will be in shock if any one actually understands all that!anyways heres what i've done to illistrate that babble:
Drawing Line Where Mouse Is
I want a drawn line from the center of my flash pg to wherever the users mouse goes. It should be continually refreshed so there isn't more than one line.
I'm attempting to make it look like this picture.
I would love to use this image (its a quicktime movie file)...but it needs to be transparent without black.
http://home.cogeco.ca/~erikwithak/vectorline.jpg
Make Mc Appear Only When Mouse Is Over Certain Line
hi all....
I am currently doing a physics report (in flash, strange yes, but o well...)
At the moment i am expalining something that involves two sin graphs out of phase by 120 degrees.
So i have two empy moveclips that will dynamically create the movieclip. (using the lineto(); method).
I also have a movie clip (instance name of hor_phase) that i have already made to have an x and y value of the mouse.
I want it so that when the mouse is over (near it as well would be preferable if possible) then the movieclip will be visible. (the movieclip is just a line with a label saying 120 degrees, so that if one end is one one graph, the other end will be on the same spot on the other graph, to show the two graphs are 120 degrees out of phase.
The only problem is i have no idea how to do this, so if someone could help me, that would be fantastic... (also, the report is due very soon, and as much as i hate rushing people, i am in a sense of urgency here ).
thnx for help...
(what i have is attached)
[CS3] Trying To Get A Line To Stick To My Mouse
Hi there,
I've got a line, which is fixed at one end. I want to make the other end of the line grow and shrink in size and rotate to the position of the mouse. So it's like a second hand on a clock face except the line will grow and shrink and move to wherever the mouse is on that clock face.
The code I'm using is:
PHP Code:
line.onEnterFrame = function()
{
myRadians = Math.atan2(_root._ymouse-this._y, _root._xmouse-this._x);
myDegrees = Math.round((myRadians*180/Math.PI));
this._rotation = myDegrees+90;
}
THis is working ok, but if I move my mouse to the fixed center point of the line the line still rotates. I'm not sure how to get the other end sticking to the mouse.
Any ideas would be greatly appreciated.
Cheers
Matt
[F8] Get A Line To Follow The Mouse
I have a line that is attached at the bottom, so it can swing back and forth freely. I want the far end of the line (the non-attached end) to follow the mouse... I can't seem to get that to happen. Either the whole graphic follows the mouse, or it does nothing at all.
(Basically think of a fuel gauge, how the point of the needle can swing back and forth but the other end is static.)
Thanks!
A Line That Will Following The Mouse Cursor
Hi, can anyone teach me how to program this kind of question?
After a user clicks on a pointA on a graph, a line starting from that pointA will follow the mouse cursor until the user clicks on another pointB then the line will join pointA to pointB.
Hence, that line will "grow" longer if the mouse cursor move further away from pointA.
Then a line starting from pointB will follow the mouse cursor until the user clicks on another pontC then the line will joint pointB to pointC ..
and so on, until the last point is clicked.
Thanks alot for any help.
Regards,
LWM
Mouse Line Follower
Another truly useless code from me. Makes something follow the path of the mouse. Click to increase the amount of time between the mouse movement and the ball movement.
Code:
i = 2;
BREAK = 10;
_root.createEmptyMovieClip("ball", 0);
with (ball) {
lineStyle(10, 0xFF0000, 100);
lineTo(.2, 0);
}
onEnterFrame = function () {
BREAK -= 1;
if (BREAK == 0) {
j = 2;
}
_root.createEmptyMovieClip("POINT"+i, i);
_root["POINT"+i].lineStyle(5, 0x000000, 0);
_root["POINT"+i].lineTo(.2, 0);
_root["POINT"+i]._x = _xmouse;
_root["POINT"+i]._y = _ymouse;
i++;
ball._x = _root["POINT"+j]._x;
ball._y = _root["POINT"+j]._y;
j++;
};
onMouseDown = function () {
j-=5
savei = i;
while (i>2) {
unloadMovie(_root["POINT"+i]);
i--;
}
if (i<=2) {
i = savei;
}
};
Folow Mouse On Straight Line?
Hey,
How can I make a MC folow the Y movement of the mouse, but let it's X position stay on a straight, but rotated line?
Line 'end Points' Follow Mouse
I am working on a custom cursor for my flash. I had a simple crosshair but I'm going to change that.
The new cursor I need help with is made of 4 lines. They start from each corner of the stage and they end somewhere in the center, together.
When ever you move the mouse i want the end points that are together to follow the mouse. I hope you understand.
It would be nice if there was a tutorial that showed how to edit lines or something, but i cant find it.
// ***** Set some opening parameters
onClipEvent (load) {
// Make original line invisible
_root.line._visible = 0;
// Initiate some variables
number_lines = 0;
line_active = 0;
}
// ***** Every time the mouse button is released...
onClipEvent (mouseUp) {
// Get the position of the mouse
origin_x = _xmouse;
origin_y = _ymouse;
// Increase the number of lines by one
number_lines++;
// Generate a new line name
name = "line"+number_lines;
// Duplicate a new line
_root.line.duplicateMovieClip(name,number_lines);
// Position the line's end point at mouse position
_root[name]._x = origin_x;
_root[name]._y = origin_y;
// Update line length / orientation
_root[name]._xscale = _root._xmouse - origin_x;
_root[name]._yscale = _root._ymouse - origin_y;
// If this is the start of a new shape
if (!line_active) {
// Set the line tracking variable
line_active = 1;
// Set the start point of the new shape
start_x = origin_x;
start_y = origin_y;
}
}
// ***** Every time the mouse is moved
onClipEvent (mouseMove) {
// If there's a line currently being drawn...
if (line_active) {
// Update line length / orientation
_root[name]._xscale = _root._xmouse - origin_x;
_root[name]._yscale = _root._ymouse - origin_y;
updateAfterEvent();
}
}
// ***** When a key is pressed
onClipEvent (keyUp) {
// If it's the Enter key
if (Key.getAscii() == 13) {
// Join the end point of this line...
// ...to the start point of the first line in this shape
_root[name]._xscale = start_x - origin_x;
_root[name]._yscale = start_y - origin_y;
// Reset line-tracking variable
line_active = 0;
}
}
This is what i am working with. This makes a line every time i click. I dont want a new line everytime i click, i just want one line to ALWAYS move around.
Draw A Straight Line With Mouse
I want to draw a line with my mouse so that the line always remains straight. I want to click with my mouse and then the line start, move my mouse to a new location with the line trailing and then click my mouse again to end the line.
I was reading thru a tutorial I found on line. It draws a line by draging the mouse. Unless you can drag your mouse super straight you get a crookedy line. How can I correct for this and do what I want?
ActionScript Code:
// 1. SETTING THINGS
// ----------------
_root.createEmptyMovieClip("line", 1);
// 2. EVENTS IN _ROOT:
// ------------------------
_root.onMouseDown = function() {
line.moveTo(_xmouse, _ymouse);
line.lineStyle(0, 0x000000, 100);
this.onEnterFrame = function() {
line.lineTo(_xmouse, _ymouse);
};
};
_root.onMouseUp = function() {
this.onEnterFrame = null;
};
// 3. BUTTON "ERASE":
// --------------------
buttonErase.onPress = function() {
_root.line.clear();
};
Controling Line Movement With Mouse
Hi there
I'm trying to create a controllable line segment which as to be connected to two different movieclips (mc1,mc2, for example), one of them, draggable.
Basically what it needs to do is:
be able update it's position without resizing (follow mc1 and mc2 movement); and resize itself to a certain amount (only when the draggable movieclip is moved);
The creation of the line itself is working, and I also know that the function controlling the line has to respond to the mouseEvent on the draggable movieclip. The problem is to control the line size and position while the mc2 is being dragged.
Any thoughts?
Tks in advance.
Yantis.
Line-rotations On Mouse-movement
Hi Kirupa's out there!
I'm a little bit stuck on re-creating an effect.
To be honnest I really don't know how to begin with it or how I should call the technique behind it (guess I'm still a newbie).
The effect is here: http://www.locatus.nl to be seen (it's that mouse-effect).
Question is, if you guys would be so kind to help me getting started (just were I could find a proper tutorial or something)
Thanx,
Kayce
Drawing A Line Using The Movement Of Mouse
Hi, I am having a problem in a way like this. I simply want a line having a thickness of 2pts and color red to be drawn with the movement of mouse.
Simply speaking, a line will be drawn on whatever path the mouse moves on.
Hope you people help me out.....
Regards
Elastic Line To Mouse Pointer
Can anyone help me to draw a line from the bottom left corner of a movieclip to the mouse pointer. I need the line to be "elastic" because both the movie clip and the mouse pointer will be moving. I've tried various things with lineto but have failed to get the line to redraw and follow the pointer.
Any ideas?
AS3 Drawing Api - Creating A Line That Follows My Mouse
I'm sure this is pretty simple but can't figure it out.
I want to set a point to start my line from and have the other end of the line follow my mouse. Here's what I have so far:
Code:
var clip:Shape = new Shape()
addChild(clip);
stage.addEventListener(MouseEvent.MOUSE_MOVE, drawLine);
function drawLine(evt:MouseEvent)
{
clip.graphics.moveTo(0,0);
clip.graphics.lineTo(mouseX, mouseY);
clip.graphics.lineStyle(1, 0xff9933);
}
but it's constantly drawing the line due to my mouse_move listener.
I only want one line on stage - know what I mean?
Mouse Easing Along Horizontal Line
Does anyone know of a simple way/a tutorial which could help me create the following effect:
I have a standard navigation bar. As I move my mouse over each button, I want an object eg a dot (clip) to follow the mouse (above) each button -ALONG A HORIZONTAL LINE.
The effect can be seen at http://www.b7ven.com/v2/ when the mouse rolls over any of the navigation buttons.
Thanx!
Beginner - Mouse Over IE Line - And Click Problem
My test swf - - http://www.jennyweir.com/testSite/
How would I remove that white mouseover white line near the edges of the page (as seen on IE7)
I made the swf full screen to try to get it to dissapear - but full screen is apparently only nearly full screen and it is still there
I would like to learn how to make an swf which can live seamlessly in a matching html page so would appreciate knowing what to do. There is a setting I chose which I thought would fix it (show border) but it has not worked
Also - click problem:
in Flash, I made a fill layer into a button (100% size also and under the visible elements ) so that I could attach a goto url action (up)
on this swf you have to click twice to go to the url
I dont follow how this has come to be
appreciate any pointers
gav
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);
}
Mouse Position In Relation To Main Time Line
Hi
How would i convert the x and y coordinates of a movie clip from its local values ( ie. in relation to the movie clip its sitting in) to values in relation to the main movie timeline.
I have used this function before but cant remmeber it..
Image Streching For Unknown Reason In Dynamic Image Gallery
Hi everyone, this is my first time using flash.
I followed a tutorial at http://www.lukamaras.com/tutorials/a...e-gallery.html and everything is working okay, except when I view the big images they are 4x wider than they should be, stretching to the right. I think its a problem with action script maybe because I'm using cs3, and saving the file as flash 8? I'm not sure. I've included the file and the xml/photos it references in case anyone is nice enough to check out my problem.
http://www.mediafire.com/?euw1wywgnvg
Thanks! -mike
Making The Mouse Drag One Side Of A Line, The Other Side Anchored...
Can anyone help me with this? What I want to do, is make a line that is anchored on one side, the other side "connected" to the mouse. When the mouse is moved, the line will follow, expanding and shrinking with respect as to where they are on the page.
Can this happen? If so, how?
Any and all help would be great!! Also, if there are tutorials that are out there, point me there? I couldn't find any..
Thanks much..
Michael
[MX04] Dynamically Created Textbox Won't Go To Next Line When Text Exceeds First Line
Hey all,
I've dynamically created a textbox and then applied a new text format with the following code:
Code:
{
createTextField('welcome',4,-100,-25,160,100);
welc = new TextFormat()
welc.font = "Sydnie";
welc.selectable = false;
welc.size = 12;
welc.color = 0xfffafa;
welc.multiline = true;
welcome.text ="Text that exceeds one line."
blackbox.welcome.setTextFormat(welc);
}
How do I make the textbox go to the next line when the first is full and not go beyond it's right border?
Thanks for your time,
Greenham.
Attach A Line To Two Movie Clips. So The Line Moves And Adjusts To The Positionning
Hey
ok I'm working on a project, I have two movie clips moving to different locations, and I want a line connecting both clips.
The line will need to adjust dynamically to the mouvement of both clips.
Can someone give me a heads up on how to accomplish such task.
If more information is needed, post areply saying so, and I will add more information about what I am trying to accomplish.
Thanks
Jean
Mouse Trail (line Trail)
I remember a long long time ago in a galaxy far away there was a mouse trail here that would create a line that would fade out after a while.
i tried googling line and mouse trails but I found nothing
if anyone could help i will be their eternal sex monkey for ETERNITY
thank you
[F8]Text/Paragraph/String - Line By Line Write Effect
howdy - ive seen some nice text effects recently, and im looking for some resource on recreating them. Ideally im after a nice function / prototype for outputting a line of dynamic text, to a textfield in a nice way, rather than just dumping it on screen. So either letter by letter, or line by line, without having to do all the rubbish faux-effects by masking and tweening.
any ideas?
cheers.
Reading Textfield Line By Line ? Selecting Multiple Textfields At Once ?
OK i need some serious help/advice !
I`m trying to make a sort of program like word , i want to have a text field , but the problem comes when i want to create like borders around each line of text and have DIFFERENT background colors for each line.
So i was thinking if i can read line by line and get get the height of each line by examining char by char for it's size and get the biggest one ( since my text may have different fonts sizes ect on a single line) and then have like BLOCKS that are behind each line and adjust their sizes accoring to the line size and change their color also.
Also another thing that I would also want to do , i want to create a table which i did , but now how do i put the table into my text ...and not just lie on top blocking text behind it ..how do i like "push" the text around it ?? ANY IDEAS would help...thats why i thought maybe create lots of textfields just stacked from top to bottom..but then i will have the problem of selecting them all at once like in a REAL word processing problem...and also if the text becomes too big it will need to "flow" into next textfield...
Is there ANYWAY to do this ??! HELP ME!!!!
THANK YOU
Multi-line Text Field Auto Line Break
When a Dynamic Multiple line text field is used in Flash CS3, it has a very annoying feature that auto inserts a line break at the end of inserted text. It also auto inserts a line break if no text is entered too.
I'm having a problem with this because the text is being saved from flash to a text file on the desktop. With every multi-line text field there's a nasty looking line break.
Any way of "turning off" this auto-line-break-at-the-end feature?
Txt File Double Spacing Off Line, Single On Line
Has anyone else seen this?
When I'm setting up a .txt file for import (the swf is v5 code, authored in MX), I'm noticing that if the .txt file has a single line break between paragraphs, this represents as a single empty line when the swf file is viewed on-line, but it shows as a double blank line when the same file is opened off-line.
Does anyone know a trick to getting imported txt files to display the same way on- and off-line?
(Or am I going mad and no one else has noticed this...)
Flash Getting PHP To Feed It A Text File Line By Line
Maybe someone can point me in the right direction.
I want Flash to access the text file, separated my newlines, that can get quite large. I want Flash to access each of those lines one by one and process them with Actionscript.
I am getting the idea that I should use PHP to open the text file and store the lines in an array. But how can I access each array element in Flash?
Does anyone have any suggestions about this? Have you seen where this has been done before?
Is It Possible To Get Data Printed To The Screen Line By Line As A Ping Does?
I have a Flash web app using AMFPHP remoting that calls a unix script that runs either a ping or a traceroute command based on some parameters I pass it.
The methods in my remoting method table for ping and traceroute are:
PHP Code:
function doLsPing($addr)
{
$ping = shell_exec("/path/to/my/pingScript.sh " . $addr);
return $ping;
}
function doLsTraceroute ($addr)
{
$traceroute = shell_exec("/path/to/my/tracerouteScript.sh " . $addr);
return $traceroute;
}
The unfortunate behavior I am getting is that the returns, naturally, just send me the completed data from the ping and traceroute in one big lump. Of course I would like to have the data returning to me line by line as the data is collected...like it would if you ran the script in a shell or terminal window.
You can see the danger in getting the one-big-lump-of-data scenario. If you ran a traceroute on an address that did not exist and say the traceroute did 30 hops then you could potentially be waiting a loooooooong time without anything printing to the screen. Plus the user, if familiar with ping and traceroute, would be expecting to see the results printing to the screen line by line as the command ran.
Now the caveat to this is, my PHP skills are nil to none, so maybe I am just missing something that I could use rather than just a 'return'.
Any help here would be most appreciated!
Make Line Movieclip Turn To Dotted Line
hey Everyone
Just wanting to know how to use actionscript to make a line dotted. I want to have a movieclip (a solid line) and when u click on it it will become a dotted line, then be able to switch it back to solid with another click.
Cheers
Reading Data From Text File Line By Line
I want to read some data from a text file into arrays.
In the text file, I have:
data = 1234567890
This works ok, but I want the text format in the text file to be:
data =
12345
67890
So after reading 'data', i will have 2 arrays.
[1,2,3,4,5] and [6,7,8,9,0]
Any idea how to go about doing this?
It will be even better if I dont need to use any variable.
Like this:
12345
67890
The main thing is just to read the text line by line and get them into arrays.
Thanks.
|