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




AS3 - Can You. Trace A Line #



Just wondering if u can trace a line # in ActionScript 3, similiar to other languages _line_



Ultrashock Forums > Flash > ActionScript
Posted on: 2008-03-13


View Complete Forum Thread with Replies

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

Trace A Line
Hi,

I need to make a presentation with maps and trace lines in maps over the roads. I would like to tracing these lines at the start to the end with animation. Any idea?

Thanks in advance,

Amadeu Carlos Penzin

Trace A Line
Hi,

I need to make a presentation with maps and trace lines in maps over
the roads. I would like to tracing these lines at the start to the end
with animation. Imagine a randomized line traced with the "pencil tool"
on the stage. I want that this line will be traced since the beginning
until its end along the movie, better, in the beginning the stage is
empty, later this line will be appearing frame by frame. I know to make
this with a straight line but with a randomized line I still didn't
get. Dividing the line and making it frame by frame is very laborious.
Through this method I know to make this. The problem is that I have to
make a lot of routes over the map and this background map must be
visible during the movie. I think that it does not allow to use the mask. The manual procedure becomes unproductive for hundreds of lines. I already
have being instructed and guided in many interactive training tutorials of flash, action script etc. and I saw a lot of examples and nothing...Any idea to make this automatically with the action script?

Sorry for my english!!!

Many THX,

Amadeu Carlos Penzin

Trace Out Line Breaks?
I am playing around with text fields, and I am not finding a way to trace out line breaks in text fields. Anyone know how to do this?

Trace Line Number
Hi, I am expanding Flash's Array Class adding a lot more methods to make arrays more powerful inside of Flash. I want to be able to trace out errors when people use the methods incorrectly, but I was wondering if there is a way to get the code line number? So I could trace something like this..

Warning: ** Value sent in holds() is not supported. Type "undefined" was is not suppored in this method. (Line: 239) **

If there is a function I can use to grab the line where the piece of code that contains errors is?

Trace Frame Name On Time Line.
how can we trace frame name on time line.

If I'm Using A Txt Editor And A Command Line Compiler, Where Does Trace() Output To?
I'd really like to use trace()... but I'm not using flex or eclipse... how can I see the output of it?

Very Tricky - Trace The X , Y Value Of All Nodes Of A Curve Line Shape
WE draw a smmoth curve line shape in the flash with line tool.

now if we want to genarate the same pattren from action scripting, we need the x, y cordinates of the line .

can we trace the all x, y cordinates of a curve line shape dynamically ????

SEE THE ATTACHED FILE

[flash 8]Adapting 'Auto Trace Mouse' Script To Perfom 'Atuo Trace Object'
Hello everyone..

I am new to flash and I am hoping the good people of this forum will help.
I have this sript for auto tracing a mouse position (got from this site) but i would like intead of trcing the mouse...to get it to trace a random moving object from another script!

mouse script:

createEmptyMovieClip("Line",1);
Line.lineStyle(1,0x000000,100);
onMouseDown = function ()
{
Line.moveTo(_xmouse, _ymouse);
onMouseMove = function ()
{ Line.lineTo(_xmouse, _ymouse);}
}

onMouseUp=function()
{
onMouseMove=null;
}

Random moving object:

loops = 0;
_root.target_x = Math.random()*450;
_root.target_y = Math.random()*300;
_root.xdiv = (_root.target_x-_root.circle._x)/20;
_root.ydiv = (_root.target_y-_root.circle._y)/20;
loops++;
_root.circle._x += _root.xdiv;
_root.circle._y += _root.ydiv;
loops++;
_root.circle._x += _root.xdiv;
_root.circle._y += _root.ydiv;
if (loops<20) {
gotoAndPlay(2);
} else {
gotoAndPlay(1);
}

I guess there is a way I can do this or it can be done...? Help will be much appreciated.

Thankz

[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

[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.

Line Break Or Line Feed For Dynamic Text
I am usin a textArea so now it is different than the last post about styles.
This text is dynamic and is assigned from within the Flash file it resides.
It comes from a list selection listener and I want to pre-format it with line breaks.

Since it resides in the file I will be using a textArea with HTML on to get the line breaks.
But now I can't Style it the same way with the setStyle methos

Currently I have one line is like this.

myNotes.text = "This is Line one<br>This is another Line<br>and another line";



Any help would be appreciated.

Thank you,
WBell





























Edited: 01/24/2009 at 12:49:08 AM by W_Bell

Two Objects Conected By A Dinamic Line + Physics Of The Line
Hi

I have two Movie clips, and I have to conect them with a dinamic line, like a rope. The movie clip A will be interactive with the mouse, changing X and Y positions, so the line should act like a rope.

Does anybody knows some code to do that or have a example?

Reading A Text File, Line By Line
I am using loadVar to read in a text file for processing by Actionscript.
Is it possible to just read in a portion of it (instead of the whole thing), process it and then read in some more? Specifically, can one read in up until a linefeed?

Multi-line Text Box Line Break?
I am trying to make a multiline text box do a line break. a quick example:

You run into a tree.
You found something!
It glows with a blue aura.

It is just for a simple break, if I try to do it normally, it ends up like this:

You run into a tree. You found something! It glows with a blue aura.

without a line break. Can someone please tell me what the line break command is?

Reading Text File Line By Line
Hy all

Got the following code:


Code:
var strContent:String;
function fillContent(folder:String):void
{
var arrayMenuItems:Array = new Array();
var arrayContent:Array = new Array();
var arrayNews:Array = new Array();
var myContent:URLLoader = new URLLoader();
myContent.dataFormat = URLLoaderDataFormat.TEXT;
myContent.addEventListener(Event.COMPLETE, getString);
myContent.load(new URLRequest("content/" + folder + "/_content.php"));
contentText.multiline = true;
trace("./content/" + folder + "/_content.php");
trace("MY DATA: " + myContent.data);
contentText.htmlText = strContent;
contentText.setTextFormat(format_ContentRegularText);
contentTitle.setTextFormat(format_Titles);
menuItemFont.setTextFormat(format_MenuItems);
}

function getString(e:Event):void
{
strContent = e.target.data;
}
What I actually need is to be able to read the _content.php file line by line. I'd like to store each line of the text file in an array (arrayContent). But I haven't found ANY solutions yet for this problem.

Best thanks for trying to help

Regards

Read External Txt File Line By Line...
Hi guys i am currently rushing a project on flash.
i did the project in java, C++ as well as tcl/tk
now i am doing it for actionscript.

i needed help on:
-read external text file which contains coordinates
Eg:
123,321
34,43
233,785
745,3

-i need the action script to read these coordinates and store them in an array. can anybody help me out pls.

Draw A Line Using LineTo Then Hit Test That Line
is there a way to hitTest a line drawn with the following method?



Code:
clear();
lineStyle(1, 0, 100);
moveTo(obj1._x, obj1._y);
lineTo(obj2._x, obj2._y);

perhaps turn it into a movie clip and hitTest that?

...I'm stumped here...

Read Line By Line In External Txt File?
I found the answer to this problem somewhere on these forums, and I've searched and searched, but I can't seem to find it again. =( Google has let me down as well.

The person wanted to know if there was a way to read in each line separately from an external txt file without using the crazy syntax, but the person who replied said that you could just make all the text one variable, and then break it up by newlines inside the AS code using a for loop.

Whoever can find that topic for me or figure out what methods are needed for it will be my hero. =)

Is Actionscript Processed Sequential (line By Line)?
Ok, so long story short, I have a loop that fills three different arrays. As soon as the loop finishes, on the next line, a function is called that loads dynamic images into movie clips. However, this isn't working as I thought. Instead, the function is being called at the same time as the loop is running. Therefor, the first few images don't show up and I get undefined errors. However, if I delay the function being called by 50ms, I don't get the error. This means that it is a timing problem and that flash is executing the loop and the function call at the same time.

Does anybody have any experience/advice on what or why this might be happening?

Thanks in advance.

Edit: Also, my entire movie is implemented using actionscript in the first frame of the movie.





























Edited: 07/18/2007 at 02:27:48 PM by nateyboy044

API-draw: Check If Line Intersects Another Line
It been a while and I need some help on this one...

I'm making a very simple game that lets you draw a curve by hand (using lineTo to the mouse position on mousemove) but now, I need to check wether the line intersects wiith another part of the same line (e.g. a loop)

I first used an onrollover command, and that worked, but not always because the mouse moved too fast (same with hittest with mouse). Then I pre-drawed the line in another mc, used hittest on it, and if it wasn't intersecting, draw it in the real mc. But that didn't work because it used the bounds to test. I guess the best way is to use some mathematical formula, but that would mean I have to save all my coordinates in an array...

Is there another way?

TIA

Read Text File Line By Line
Hy all

Got the following code:


Code:
var strContent:String;
function fillContent(folder:String):void
{
var arrayMenuItems:Array = new Array();
var arrayContent:Array = new Array();
var arrayNews:Array = new Array();
var myContent:URLLoader = new URLLoader();
myContent.dataFormat = URLLoaderDataFormat.TEXT;
myContent.addEventListener(Event.COMPLETE, getString);
myContent.load(new URLRequest("content/" + folder + "/_content.php"));
contentText.multiline = true;
trace("./content/" + folder + "/_content.php");
trace("MY DATA: " + myContent.data);
contentText.htmlText = strContent;
contentText.setTextFormat(format_ContentRegularText);
contentTitle.setTextFormat(format_Titles);
menuItemFont.setTextFormat(format_MenuItems);
}

function getString(e:Event):void
{
strContent = e.target.data;
}
What I actually need is to be able to read the _content.php file line by line. I'd like to store each line of the text file in an array (arrayContent). But I haven't found ANY solutions yet for this problem.

Best thanks for trying to help

Regards

API-draw: Check If Line Intersects Another Line
It been a while and I need some help on this one...

I'm making a very simple game that lets you draw a curve by hand (using lineTo to the mouse position on mousemove) but now, I need to check wether the line intersects wiith another part of the same line (e.g. a loop)

I first used an onrollover command, and that worked, but not always because the mouse moved too fast (same with hittest with mouse). Then I pre-drawed the line in another mc, used hittest on it, and if it wasn't intersecting, draw it in the real mc. But that didn't work because it used the bounds to test. I guess the best way is to use some mathematical formula, but that would mean I have to save all my coordinates in an array...

Is there another way?

TIA

Reading Code Line By Line?
Guys (and girls) im trying to write a bit of code which appears to shake an image on screen, however when i put all my _x &_y functions in to move it around it reads the whole block in one, instead of reading and DISPLAYING each line seperately... how do i force code to do it (in director Id use an 'updatestage' command) many thanks

[F8] Line Vs Line Collision Detection?
Anyone know how i can do line vs line collision detection? Using hitTest() isn't good enough as my lines are all at weird angles. I think vectors might be the solution, but i can't get tonypa's tutorials to work, any hints? Thanks,

Aldarn.

[F8] Delecting How Many Characters There Is Line By Line
ok cos no ones answering my other question
here I have to think of an alternative solution

can someone tell me is there a way to read through a textbox line by line and get how many characters there are in each line?

Line Rider Style Line
How can i do this, i would like the same usability as linerider where teh oencil tool ca be picked up or put down, and where the pencil tool foolows the cursor all the while the pencil tool is selected, please help!

Text Effects Line By Line
Hi,

How can I make the text of my website to appear line by line, each line changing itīs alpha to appear.

If the line make a small movement would be better. Something like falling from 10 pixels...

Something like this effect, but with the lines of the text instead of the letters...

thanks

Line-by-Line Text Effect
Hi,
I'm a newbie to this forum, but I'm hoping someone will know how to do the effect on this site -- www.outsellconsulting.com

The effect is in most of the sections (if you click on the left nav) --- the text slides in line-by-line. I don't think it's done with Swish, for example, but I could be wrong.

If anyone has any ideas on this, I'd appreciate it.

Draw A Line Through A Path Line
Hail,
Does anyone knows how I draw a line through a path line?
An example I have a movieClip that is a pencil and it is moving through a path line, now I want to draw the line that the pencil draw. Confused?

Read Line By Line From .txt File In AS 3.0
Hi,

I'm wondering how I can read from a .txt file in actionscript 3.0. I'm used to Java where when I want to read from a file I would do something like this.


Code:
Scanner scan = new Scanner(url.openStream());
String line;

while (scan.hasNextLine())
{
line = scan.nextLine();
//do something with that line
}
Is there something similar in Actionscript where I can read a file line by line?

icekube12jr

Loading Text Line By Line..?
Hi all, been using flash for a while to do linear animations for my sites but this one involves some simple actionscript and I'd like to know the best way to achieve the following please:

Basically I have a variable which will count from x to x and I need it to "reveal" a line of text when the counter gets to specific numbers.
For example; counter reaches 50 and I want the line "counter at fifty" to be added to a text box.

I'd like this text box to actually scroll too when the text begins to go off the bottom of the screen.


Now I've tried doing this with an animated mask, which moves down a line at a time when it reaches the specified variable counter number. But this does not allow me to move the text up easily when it begins to overflow the stage.

I figure that the way it is likely to be done is to load up the lines into an array and then use a loop to unhide the lines when the conditions are met. But I can't figure it out! Been trying for about 2 days now :P

Thanks very much for any help!

Flash Drawing Board With Erase Function, Erase Line By Line
Hello!

Im building a pretty simple drawing board in flash, i got this code from this forum and it works fine (there is more to it but this is the drawing part)

Code:

var clip:Shape = new Shape();

bana.addEventListener(MouseEvent.MOUSE_DOWN,_handleMouseEvent);
bana.addEventListener(MouseEvent.MOUSE_UP,_handleMouseEvent);

function _handleMouseEvent(e:MouseEvent):void{
   switch(String(e.type)){
      case "mouseDown":
      bana.addEventListener(MouseEvent.MOUSE_MOVE, _handleMouseEvent);
      
      bana.addChild(clip);
      
      clip.graphics.lineStyle(1.5,colorPicker.selectedColor);
      clip.graphics.moveTo(mouseX,mouseY);

      break;
      
      case "mouseUp":
      bana.removeEventListener(MouseEvent.MOUSE_MOVE, _handleMouseEvent);
      break;
      
      case "mouseMove":
      clip.graphics.lineTo(mouseX,mouseY);
      
   }
}


This works fine. But i want to be able to erase the drawings, step by step this is ths tricky part, ive looked everywhere(ok not everywhere) but in a whole lot of places but the only thing i found is how i could delete everything with removeChild and that in not what i want.

Maybe i need to change the function abowe? Please help me to get in the right direction. What should i read about /look at?
Do you have som sample code, no one is happier than me.

Regards
Fredrik
(sorry for my bad english, please ask if you dont understand)

[MX04] Diagonal Line Hit Test Or Drawn Line Hit Test
i have this guy who maves around and you can draw i gave it an instance name of "linesd" i dunno and i want to make it so the square will not go through the line that i draw in the swf. if you cant help with that can you help me with diagonal line hitTest i ban do vertical and horozontal ut diagonal is realy hard because it does the hitTest for the movie clip box not the line itself
-jakeA

Trace
Do anyone know why "trace" action cannot be used in the standalone version like *.swf or *.exe or *.html?

thx for any help...

Cant Trace?
Hello, im trying to edit our company website and the guy who made it was fired and i have to make some changes to it. I need to use the trace command but cant for some reason, it wont trace anything!!!! Any idea why?? Any way i can re-enable it? Thanks a ton if you know.

-Ely

What Exactly Is Trace?
what exactly is the trace function and what does it do? The actionscript dictionary isn't much help.

Trace Cmd?
Got this from one of you guys. I'm tracing a in MC instance to see if anything's loading into it. Last night it worked great, today it's looping (just keeps repeating the output). Where or how did I make it do this?



Code:
onClipEvent (enterFrame) {
total = this.getBytesTotal();
loaded = this.getBytesLoaded();
trace("TOTAL: "+total+" bytes");
trace("LOADED: "+loaded+" bytes");
}


What would make it never end output?

Can I Trace *all*
Is there any way of having a trigger call the list variables command?
I need a full readout of everything at a very specific point, and the only way I can think is some sort of trace function. Any ideas?

much appreciated

The Trace
I heard about ppl doing trace bitmaps. How do you do this? I was told to do so to optimise my flash but I have no idea what it does or how to do it.

Trace URL
Hello, how can I make a trace give me the URL I try to ger with getURL? Iīve got this
on (press) {
getURL("javascript:void(window.open('foto_cocheras 1.htm','fotokox1','toolbar=no,location=no,status=n o,menubar=no, scrollbars=yes,resizable=yes,width=800,height=600, top=75,left=75 '))", "_self");

}


in the button and I want the trace to tell me if itīs actually doing it. Thank you.

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