Making Various Levels Line Up?
This is a very baisic question:
I have loaded an image from an outside directory into a new level. I would like to be able to move the image to a new location within that level as it does not line up the way I want to on the main stage. What is the correct way to tell this laoded movie clip within the new level to switch to a specified location?
Thank you
DevShed > Flash Help
Posted on: July 10th, 2004, 11:16 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Drawing Line Between 2 Mcs In Different Levels
I have a movieclip on the main stage of one end of a cable. Also in the main stage, I have another movieclip of an electronic breadboard-like item (a box with a few holes in it that looks like the female end of a computer cable) and within it I have a movieclip of the other end of the cable. I want to have a line drawn dynamically between each end of the cable, so that it looks like the 2 ends are connected. The problem, though, is that each mc is in a different coordinate system, so when I say to go from one movieclip's position to the other's position, it looks like the cable is off the screen to the left, when in reality it is on the right side of the screen.
Can someone please tell me how to get the 2 coordinates to coincide with each other?
Chris
Loading Levels Under Elements In Time Line
I have a master container file that holds elements like a navigation, border, logo and other items that need to be visible at all times. I put these elements on the stage in various layers.
Upon clicking on buttons within the navigation, external .swf files are then loaded into this container file. The loaded .swfs go into an empty movie clip called "target_mc", created using ActionScript:
this.createEmptyMovieClip("target_mc");
here's the AS for one of the buttons:
on (release) {
loadMovie("MM/01_home_SR_3404.swf", "target_mc");
}
Everything works fine, however the loaded .swfs are coming in on top of the elements in my timeline. Is there a way to have then come in under these elements? I know using AS to load these elements in the same way as the .swfs will solve the problem, but I like being able to see them in the time line so that it's easier to make adjustments. I also know that creating an empty movie clip that sits on the time line in a lower layer to hold the .swfs will solve the problem, however I need to load them into levels so I can eventually do things like swap depth and load to the next highest level.
any advice would be greatly appreciated.
thanks!!
Making MC's Swap Levels
hello people,
is it possible to make MC's swap levels within the same layer? i have 8 MC's in the same layer and need to alternate which is at the top on the press of respective buttons... please help if you can, thanks john
p.s. need help quick on this one...
Making Levels... If Statement
hey guys, im new to this forum so im sorry for posting this message 2 times, and once into the rong forum L , but anyways.. here is my problem, im trying to write an if statememnt so that in the game im making when the score hit a certain number the level changes,
ive tried this and nothing worked, ( i dont know if this is correct )
if ("score" =< "30000") then
gotoAndPlay(1)
i dont think this is correct but if someone could please help me, it will be most apreciated.. .thanx
-baleric
Making Man Jump And Gun With Calling Different Levels
I am making man walk and jump and pull out a gun by placing in different levels of dot syntax. I got him to jump and to walk. But I cant figure out how to pull out a gun on the second level and I want to contiue go father in levels by calling it up different movemnets for him. Another question which is better to use realtive or Abosulte? How do you write that. My action script is below. Also, It slows down when I play it. How do I make it go smoother.. Is there a better way to write a man to move and do actions. Thanks I have included the FLA file.
on (keyPress "<Left>") {
_x -= 20;
with(dude) {
_root.man.gotoAndPlay("walk");
}
}
on (keyPress "<Right>") {
_x += 20;
with(dude) {
_root.man.gotoAndPlay("walk");
}
}
//Pulls gun out
on (keyPress "<Tab>") {
with(pull_gun)
{
_root.man.dude.gotoAndPlay("gun");
}
}
on (keyPress "<Space>") {
with(dude)//This is the instance name for scene man
{
_root.man.gotoAndPlay("jump");
}
}
Making Lower Levels Unselectable
i like creating my sites into levels for fast loading purposes. if i bring up a page that purposely covers the menu and other buttons on lower levels, how do i make those buttons on the lower levels unselectable until the user closes(unloads) the top level movie. right now on the user can select anything below without even seeing it because the mouse changes to a finger. please help thanks...
this can be seen here by going to the about, then services page and click on web design. you'll see that you can select the menu still. it doesn't matter if the "background" is opaque, or if i create a graphic and alpha it for the background and if i just make a solid background, you can still always select the levels below...
http://www.richardson-graphics.com/newsite/main.html
thanks for you help
Making A Line Transform
Hello all,
I'm brand spankin new to this forum and kinda to flash. I've done a couple of intros for sites but there's a lot of stuff I don't know. I want to have a box get drawn around a logo, starting with a line. How can I make that animated? Thanks and sorry for the simple question. Stangdesign
Making An Animated Line
Hi again, all you wonderful, creative, intelligent, flashers!
How do I draw a line so that it is animated: I want a line to come down from the top of my page, where I will "draw" out the boxes for my link buttons. On rollover they will be filled with a colour and then linked to their respective page. I have seen lines being drawn out in animated style before, but I don't know how it's done. Is there a tut for it somewhere? Thanks ahead of time for any help. -BR
Making A Line Expand
Hey im just having some simple trouble with lines. I wan't to say before i proceed that i learnt this thing by myself but the problem im having is that i can't remember how to do it. It goes like this:
Lets start with a round cirkel (draw it up and place it), then i want it to expand to a line so it looks almost like a writing effect, like im drawing with a pencil. Like this: (Phase 1) - (lets say that line is the dot) and it expands to: -----------. The line where it began doesnt move its stays, i just want it to expand forth or follow the guidlines i assign it to. I remember only using guidelines and morphing, more than that i dont know so pls help me :'(
Making Line Draw Itself
I've hit a wall. I need to make a line look like it's drawing itself, as if an invisible hand is drawing on the screen. For some reason, though, I can't figure out or find how to do this.
Could anybody link me to a tutorial or tell me how I might do this? I really appreciate any input in advance.
-Jacob
Making A Line Move Across Screen
it's not just a simple motion/shape tween!
Trying to be as clear as possible:
I want to make a line move across the screen and have the endpoint of it follow the beginning point. However I want it to follow slowly behind it. does this make sense? so that if the line begins off the page, it comes onto the page, then the end point lags behind it following the path. can this be done in flash? i thought i had seen it in other sites but i couldn't find any expamples. I think it could be simple, could someone help please?
thanks
ciao
Making 'blinds' Out Of A Line Clip?
Hi,
Im trying to dupe/ attach movie clip menthod that lines up a set of line clips like 'blinds', and then have each blind tween in say the left direction incrementally with some sort of easing. Any clues?
Making Part Of A Line Look Closer
Ok, well, here is what i am trying to do.
I have three boxes in a row, each box is connected to the box next to it by a line.
Randomly a user will select one. And when they do select one that box will then enlarge.
My problem, is that I would like the line to scale with it. However, since the line connects two boxes, one that is enlarged, and one that isn't, then one side of the line should be enlarged, while the other side should not. So it can give a sense of depth. Does that make sense?
I know I can easily make each box a mc and enlarge the mc dynamically with actionScript. However, I'm kind of lost on how to do the line. You can't just scale part of a movie clip can you? Perhaps make one side taller while the other side remains the same?
anyone have any ideas?
Thanks
tyler
Making MC Dragable When Aligned To A Line
hello..
getting tired of searching so is there anyone who could help me out?
i want to get an movieclip dragable that is connected to a line.
or making the mc moving first vertical, and if it gets to the endpoint the horizontal moveability will start.
the movieclip has to control another movieclip, so i have to readout the y- and x variables to control the timeline of the other mc.
i figured out how to do this. but once i reached the end of the vertical line(frame 2-30) and the mc is moving on the horizontal (frame30-60) i can't go back to the vertical.
i realized it with a function or with if. but thats not the right way.
my problem in this case is here in the first lines..
how can i program it that the user can move the movieclip inside of this L-shape to control it?
btw.: the form will get more complex, so if theres a possibility to move the mc along a pregiven line and only read out the variables that would be much better.
if(calc>=1 && calc<=30){
mover(1100,420,1100,560,1,30);
}
if(calc>=30 && calc<=60){
mover(1000,560,1100,560,30,60);
}
function mover(startx,starty,endx,endy,framestart,frameend) {
ct_mover.onPress=function(){
startDrag(ct_mover, false,startx,starty,endx,endy);
this.onEnterFrame = function() {
if(startx==endx){
if(starty<endy){
calc=Math.round(((_root.ct_mover._y-starty)/(endy-starty))*(frameend-framestart)+framestart);
out2=endy;
}
if(starty>endy){
calc=Math.round(((_root.ct_mover._y-endy)/(starty-endy))*(framestart-frameend)+frameend);
}
}
if(starty==endy){
if(startx>endx){
calc=Math.round(((_root.ct_mover._x-startx)/(endx-startx))*(frameend-framestart)+framestart);
}
if(startx<endx){
calc=Math.round(((_root.ct_mover._x-endx)/(startx-endx))*(frameend-framestart)+framestart);
}
}
}
}
ct_mover.onRelease=ct_mover.onReleaseOutside=funct ion(){
delete this.onEnterFrame
stopDrag();
}}
_root._content.gotoAndStop(calc);
thanx for help.
Making A Line Disappear After Being Drawn?
Hello
Heres the code
PHP Code:
createEmptyMovieClip("drawfeild", 1);drawfeild.lineStyle(10, 0xff00ff, 100);onEnterFrame = function () { drawfeild.lineTo(_xmouse, _ymouse);};
How would i go about making the line that is drawn disappear after a set amount of time bit by bit? So it would look like kind of like a trail that keeps deleting itself.
anyone?
Making A TextArea Component Single-line Only.
Hi guys,
How can I make a TextArea component single-lined? As a TextArea component doesn't have a multiline property. I tried myTextArea.textField.multiline but that didn't work out, so any other suggestions? (A simple way of removing all
's out of the String would be fine either)
Thanks, Tilpo.
Making A Line Follow A Curved Path
Hello all:
I need to make a line move along a path. The end result will be an animation depicting a piece of paper traveling through a roller path.
Please help!
Thanks
Making Heartbeat Line Loop Continuously
Please help me out anyone!,
Im trying to make a heartbeat line loop continuously without going away.
I added the .FLA file, im sure there is an easy solution i just can't figure it out by myself .
U see that the line will be eaten when the mask has completely scrolled over my line. I want to prevent it from being eaten and start over again without having the old line dissapear.
Thanks in advance
Here is the link to my .FLA:
http://members.lycos.nl/infernalmajesty/Banner_Beta.fla
[F8] Talking About Levels..controling Levels, Loading Swfs Into Levels, Etc
Hello, people!
I have a little tweaking i need to adjust.
To get to the point:
if (1==1)
{
loadMovieNum("test.swf", 3);
_level3.gotoAndStop(10);
}
else (...)
The problem is that on the if cycle, it doesnt consider the level as being loaded. I've tryed a while to wait for the level to load, nothing worked.
I've tested with a button to see if the level exist and is possible to control it and it is, with the onRelase.button etc etc.
Any ideas?
Ricardo
Thanks!
Simply Making Layers Longer In The Time Line
This is driving me mad..
In flash 5 when you have a 1 frame movie on the timeline and you want to make it longer you just grab the end of it press alt and pull
in flash6 and 7 it leaves a key frame at the end..
also when you go to pull the ends of the movies in the timeline it just show a black selection mark and dosent move them..
what have they done!
I've looked over the help files and cant find a thing.
It's like it's so simple they havent bothered to document it..
or am i so simple i just cant find it!
please help!
[F8]Making Command Line From Variables: Can't Get This Script To Work
Code:
onLoad= function() {
//XML
var menu_opt:XML = new XML();
menu_opt.ignoreWhite = true;
//XML placement
var xmlPos = menu_opt.firstChild;
menu_opt.onLoad = function() {
trace([xmlPos+'.childNodes[1]']);
};
menu_opt.load("menu.XML");
};
I'm trying to record what XML node flash has 'in focus' in the variable xmlPos and use that value as part of a command line. In this code, I'm trying to trace the value of the node menu_opt.firstChild.childNodes[1]. It's not working. The following are some of the variations I've tried (without any luck).
Code:
trace(xmlPos+'.childNodes[1]'); //(with xmlPos as string value) traces 'menu_opt.firstChild.childNodes[1]' instead of it's value in the XML file
//(witout xmlPos as string) traces 'null.childNodes[1]'
trace(xmlPos+.childNodes[1]); //(both with xmlPos as string and non string) Traces error "Line 13: Operator '+' must be followed by an operand"
I couldn't find anything in the manual on this subject.
If you could point out where I'm going wrong, I would be very grateful.
Nostalgia.
Making Line Move Connecting Two Sprite Objects
Hello there so I need some help in animating this thing. The concept is two circles connected to each other at the circle center by a line. The balls are draggable and I want the line connecting the two balls to also change and move along with the ball so that the two balls are always connected. I am so new to graphics programming and I am quite clueless to make this work. However I have a class that creates the two balls and draws a line connecting them. Can anyone help me out on this? Thanks!
Edit: ok so the program shows what I am attemting to do EXCEPT I want the line to move along with the ball not just appear after I have dropped the ball. I don't know how dynamic this code here is and I would like to get it so that I can connect an undefined number of dynamically generated nodes but thats a problem I will tackle after I get this going.
ConnectedCircles.as:
ActionScript Code:
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
public class ConnectedCircles extends Sprite
{
private var dragTarget:Sprite;
public var node1:Ball;
public var node2:Ball;
public var edge:Sprite;
public function ConnectedCircles()
{
init();
}
public function init():void
{
node1 = new Ball();
node1.id = "node1";
node1.x = Math.random() * stage.stageHeight;
node1.y = Math.random() * stage.stageHeight;
node2 = new Ball();
node2.id = "node2";
node2.x = Math.random() * stage.stageHeight;
node2.y = Math.random() * stage.stageHeight;
node1.addEventListener(MouseEvent.MOUSE_DOWN, dragStarter, false);
node1.addEventListener(MouseEvent.MOUSE_UP, dragStopper);
addChild(node1);
node2.addEventListener(MouseEvent.MOUSE_DOWN, dragStarter, false);
node2.addEventListener(MouseEvent.MOUSE_UP, dragStopper);
addChild(node2);
// connect the nodes to each other
node1.connectedToNode = node2;
node2.connectedToNode = node1;
edge = new Sprite();
edge.graphics.lineStyle(1, 0, 1);
edge.graphics.moveTo(node1.x, node1.y);
edge.graphics.lineTo(node2.x, node2.y);
addChild(edge);
}
private function dragStarter(event:MouseEvent):void
{
if (event.target is Sprite) {
dragTarget = event.target as Sprite;
dragTarget.startDrag();
/*if (event.target.edge >= 0) {
edges[event.target.edge].addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
}*/
}
}
private function dragStopper(event:MouseEvent):void
{
dragTarget.stopDrag();
edge.graphics.clear();
edge.graphics.lineStyle(1, 0, 1);
edge.graphics.moveTo(event.currentTarget.x, event.currentTarget.y);
edge.graphics.lineTo(event.currentTarget.connectedToNode.x, event.currentTarget.connectedToNode.y);
}
private function onMouseMove(event:MouseEvent):void
{
//trace("df");
/*edges[event.target.edge].graphics.clear();
edges[event.target.edge].graphics.lineStyle(1, 0, 1);
edges[event.target.edge].graphics.moveTo(nodes[event.target.edge].x, nodes[event.target.edge].y);
edges[event.target.edge].graphics.lineTo(mouseX, mouseY);*/
}
}
}
Ball.as:
ActionScript Code:
package {
import flash.display.Sprite;
public class Ball extends Sprite {
public var radius:Number;
public var id:String;
public var edge:Number;
public var connectedToNode:Ball;
private var color:uint;
public var vx:Number = 0;
public var vy:Number = 0;
public function Ball(radius:Number=40, color:uint=0xff0000) {
this.radius = radius;
this.color = color;
init();
}
public function init():void {
graphics.beginFill(color);
graphics.drawCircle(0, 0, radius);
graphics.endFill();
}
}
}
On a side note..when I try to do
ActionScript Code:
node1.id = "node1";
I get an error that 'id' is not part of the Ball class. If Ball extends Sprite I would have thought the 'id' attribute was inherited?
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
[levels] Snapto And _levels Targeting Levels
This code is on the root of a movie, it workks fine. However, when i load it into level 100(from another movie) , the snap-to code no longer works.
I've worked with levels a lot, but this really stumps me.
I've tried many many variations to taget the correct path, _levels. _root, this._name, targetPath,
The basic code appear below.
//code on root movie
onEnterFrame = fsnapto;
function fsnapto(){
//trace("pushed @ snapto ==" +choices);
// target1
area_oftarget_x = target1._x;
area_oftarget_y = target1._y;
//target2
area_oftarget_x2 = _root.target2._x;
area_oftarget_y2 = _root.target2._y;
}
// == end snap to==
// code on buttons
on(release){
if(_root.a3._droptarget == "/target1"){
trace("dropped 3================" +this.targetPath);
_root.fchoice("a3");
_root.a3._x= area_oftarget_x;
_root.a3._y= area_oftarget_y;
}
}
Swapping Levels - Levels Infinate?
Hi
im trying to produce a little news panel that you can swap between news items. The problem im having is the following... when I click a 'next' button I want a new story swf to load over the top - and so on for anouther 5 or 6 times. I want to be able to click forwrd randomly between stories - BUT how do I make sure that the next storie loaded is always on the next level up - and that the last swf is unloaded when the new one has loaded?
thanks for your help
PS: I thought of just putting all the news items in the same SWF but this would meen loading them and all their pictures at the same time and also make it harder to change/update indivdual stories
[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
|