ActionScript 2.0 :: Read XML Huge Linebreaks?
Apr 14, 2009
Well I was loading a xml file (using CDATA) into my flash app. I'm still using AS2 and everyting works perfectly with linebreaks and everything. The only thing I can't understand is why a linebreak is so huge? When I load the XML-file into PHP to edit, it looks good. But when I save it and load it again into flash one linebreak is like two linebreaks.
[Code]...
View 2 Replies
Similar Posts:
May 14, 2011
I'm trying to experiment with taking text from a textarea in a flex project and open it up in a php page. But the php isn't line breaking where it should be. An Example of the text i'd like to bring over to php would be:
You: Hi there
Them: Hello
You: This is a great example
Them: I know right?
Here's my php:
<?php
$text= $_GET['text'];
echo $text;
?>
Right now I came up with something like this in the actionscript...
var chatBox:String=chat_box.text;
navigateToURL(new URLRequest("savelog.php?text="+chatBox), '_blank');
I also tried something like:
var chatBox:String=chat_box.text.valueOf().replace("
","<br/>");
and
var chatBox:String=chat_box.text.toString().valueOf().replace("
","<br/>");
But apparently the isn't translating over no matter how I get the chatBox var so its not even making a <br/>. But, even if i did get that to work it wouldnt be ideal. Because eventually in the end I want to be able to just incorporate the pastebin API to paste this GET data and post it on there. And I don't think it would look too pretty with having <br/> after every line...Is it possible to bring this text over to php and recognize the line breaks in a way that would work well with what im eventually trying to accomplish?
View 1 Replies
Nov 20, 2011
Can a TextField can contain different kinds of linebreaks?
I save and load text from an input field into an XML. I save it as CDATA tags including linebreaks.
This is what happens:
I type a text with linebreaks into the textfield I save the text to the XML I empty the textfield I load the xml into the textfield - everything looks as expected, linebreaks are present I save the exact same textfield again (the only difference this time the content was loaded and not handtyped)This time the XML does not contain any linebreaks when I load it again, the text doesn't have linebreaks
How can this be?
//here is an example that demonstrates the issue:
var xml1 = <xml>
<elm/>
</xml>;
[Code]....
View 1 Replies
Jan 15, 2009
When you want to have linebreaks in a multiline text in AS you should write this, right?
Code:
var mytext:String="This is
what
I want";
so you have a 3-line text. ok, so i have a textfield, and its content will be loaded from a xml file. in my xml i have something like this:
[Code]...
View 6 Replies
Mar 4, 2005
how does one get <br> to work in flash when the <br> is located in an external file?Ive tried <br>,/n, </p> and a bunch of others. Nothing renders properly in flash. it just displays whatever linebreak code im trying to use.here is the flash code. the variable it's grabing is just a string or items pulled from a DB.
Code:
text1.html = true;
unicodeData = new LoadVars();
[code].....
View 4 Replies
Feb 21, 2011
I need to remove some redundant ' 's from the end of a csv I'm importing before it divides the lines up into an array (otherwise I get extra empty rows).
[Code]...
View 2 Replies
Aug 4, 2009
I've got a TextArea with some text in it. Sometimes there are linebreaks.
I'm using SelectionBeginIndex and SelectionEndIndex, along with substring() to get the current selection.
The only problem I'm running into is that if that selection includes any line breaks, it doesn't understand.
For example, if the text was:
Code:
This is my first line of text.
ABCDEF
Let's say I selected from the first letter all the way to, and including, B.
The output of the substring() with the begin and end selection, because of the linebreaks, would be:
Code:
This is my first line of text.ABCD
Here's the AS Code I used to illustrate the problem.
ActionScript Code:
checkButton.addEventListener(MouseEvent.CLICK, checkSelection);
myText.alwaysShowSelection = true;
myText.textField.alwaysShowSelection = true;
[Code].....
How can I capture those linebreaks? htmltext isn't an option, because there's no selectionBeginIndex and selectionEndIndex for htmltext...
View 1 Replies
Aug 23, 2008
I have a dynamic text field in flash that is populated by an input box. The dynamic text field has a maxmium width it can be. So i have it as multiline WITH wodrwap on. My problem is that I have to send this data to server and for the php to be able to text the text and output the text as it is displayed in flash. There seems to be no way of finding the linebreaks and passing them in the string as far as I can see?
View 16 Replies
Oct 20, 2009
I'm freaking a bit here. I've committed to building this branded, simple quiz for a client, and I've got the basic functionality running now in an un-designed shell UI. The app is just a landing state, a string of 15 questions built dynamically using a single state, and a result state. Minimal Actionscript controls these rather sparse three layouts, and my 'release' exported .swf file is 308 KBytes. That's a bigger .swf than this giant, giant scrapbook application I was just working on strictly in Actionscript. And I haven't even added the design assets (including animations) to the project yet! I'd hate to see what size this file will be once the graphics assets are added.
Is this simply a drawback of using Flex? Is there some way to slim down the library of classes that are exported into the .swf or something? The amount of code I've written in this thing is ridiculously small, so I'm now wondering if simply using the Flex framework adds this much dead weight to the .swf file?
View 2 Replies
Sep 5, 2010
I need to load a very big image on AS3 (currently sized at 8192x8192). I am aware that it does not fit any of the limits imposed by Flash regarding drawing to screen or creating a BitmapData of that size. I just want to load the image so I can copyPixels() some parts of it here and there.The thing is, I'm loading the .jpg file of that size with no problems. The size is recognized correctly from my Loader object. I load it like this:[code]But I am greeted with the #2015 "Invalid BitmapData" error usually reserved for BitmapDatas that are too big. The error also happens if I try to do a copyPixels(), which is what I need to do.Is there any workaround I can use so I can get data from an image this big on AS3?
View 1 Replies
Dec 16, 2009
I've started learning Flash two weeks ago and I have the challenge of creating an interactive political map with about 4000 cities. Some cities will have more than 600 lines defining their limits which will make this project very demanding on processing.People will be able to zoom in/out, select cities and see information about them.As a starting point, I've begun working with 500 cities. I've imported a vectorial drawing of these cities and converted each one of them to symbols using flash javascript, resulting of course in 500 symbols. I don't know if it was a good way of starting this project but worked for me. Then my problems begun.
First I tried to use the mouse roll over and roll out events to change the (fill) color of cities but the city limits (stroke) changed also.Second I want to add some properties to the cities such as city code, name, etc. but I wasn't able to do that using class inheritance. Would I have to create a different City class for every symbol I would like to extend? This approach looks like a lot of headache and redundant work.
View 4 Replies
Apr 14, 2009
I would like to show the top-left corner in my browser and allow user to use automatic browser scrollbars to navigate it.When I publish my swf file, this is well done in Safari, but not in Firefox.Which are the exact publish settings to make it ? I've tried several settings options, but I can't get what I want on Firefox.
View 1 Replies
Jun 24, 2009
I'm running the same flash file ([URL]) on my desktop and my laptop. The dekstop's specs are:
[Code]...
Using firefox and Flash Player 10.0.2.54 The weird thing is, the laptop runs much better than the desktop. The actual calculations (update) take about 1.1ms on the laptop, and more like 3.15ms on the desktop. Even the render time on the desktop seems to be longer. When I publish, I need to make sure that EVERYONE can play the game as it's meant to be played. So I need to know if I should be benchmarking off my desktop or my laptop. I'm guessing something is messed up on the desktop, as it really doesn't make sense atm.
View 2 Replies
Jan 13, 2010
I have a web app that prints reports, most are just one page, or two, so I just create a component that shows the data and print it.
But I have this one report that can have thousands of lines, with a custom format, Flash will slow down with this.
Is it posible to print it without showing the actual data on screen? or is there a component to print reports with custom format?
View 2 Replies
Sep 11, 2009
How can I run huge array in my computer.
Ex: array[0]....................................array[1000000000000]
Any theory to do that?
View 3 Replies
Feb 26, 2009
im making a Flash Project using adobe flash cs3 using action script 2, my problem is when i go to test moive flash closes straight away, when i click on certain scences flash again closes, i can't delete the scences because when i press shift + f2 and go to click on that scence flash again closes
View 3 Replies
Sep 28, 2009
I imported 26 .mp3 files into my library, and linked their classes via AS3 to 26 instances of buttons.
My file size went from about 2MB before I imported them to about 1.6 GB after I imported them. Each of the files is only about 2-3 MB.
View 2 Replies
Apr 2, 2011
I need to scroll a sprite horizontally, that I attach movieclips to at run time. Once all the clips are attached, the width of Sprite is larger than Flash max width. It ends up being something like 18000 px wide.
Is there a smart way to simply update the clip's labels and create the ilusion of scrolling all the content? I wish the content was not so wide but it has to be.
View 1 Replies
Oct 12, 2010
I am making an rpg type game and the map is as big as flash will allow a movie clip. Around 6000 width or something.
To simulate movement, the player is stationary in the center of the screen and moves the map beneath them.
The problem: On computers with slower CPU's it lags very badly.
Is there a way to cache the map or somehow have it so it is less processor intensive?
View 3 Replies
Aug 4, 2011
As the title says, suppose I have an hypothetical XML containing this:
[Code]....
I can check if a certain speech has a bg change by simply doing this:
if(bgs[i])
{
//true!
}
what should I compare in the case of sounds, I've tried many, like:
[Code]....
View 2 Replies
Oct 11, 2009
When I run my flash app in the default player it runs at 60 fps (the code is ~2ms a frame), but when I run it in firefox, the rendering phase is incredibly slow (~50ms).This is a relatively new symptom. I have not increased the amount of data to be rendered, but I have modified the type of data from MovieClips cached as Bitmaps, to straight Bitmap data... if that's relevant.[code]
View 3 Replies
Jul 14, 2010
Is there a way of setting a swf so that it doesnt go huge when viewed on larger monitors? I want my site to scale in size, but when i viewed it on a 27" monitor it just looked way too big really (text looks silly big), even scaling it down can then be too small on regular monitors, is there a happy medium ?
View 7 Replies
Feb 28, 2011
I would love to get some information from some of the old pros on here as to best practices using flash for large scale environmental displays:
1. Flash supports High Definition correct? I did a google search, and see that it does - but unsure whether I need a plug-in or it's just a setting? My question is more along the lines of - can the flash animation be highDef, or only the videos it displays?
2. I am working on a very large (like 40ft tall) environmental graphic, and curious .how you deal with images at that size? I remember vaugely, that they don't need to be 300dpi, but do i still need to maintain a certain resolution?
View 2 Replies
Jul 31, 2009
I'm trying to show image files (jpg, png, gif) that can be larger than the available display area. I've embedded an Image inside a cCanvas (to get scrolling), but the large images are not completely displayed.
Very large images (e.g. 2480 x 3507) have the top or the top and bottom of the image clipped withing the scrolling Image.
What is the largest graphic one can display using the mx.controls.Image ?
View 3 Replies
Sep 14, 2011
I'm having an issue sending a huge (~4MB) block of data from flash, to my java servlet, currently I'm transferring the data using URLVariables, however it seems there's a limit to this (because it seems to work, with smaller data blocks), how do I suppress this limit, or in any other way, get my data to my servlet.My flash code so far:
var variables:URLVariables = new URLVariables();
variables.name = name_string; //Plenty of these small attributes
variables.data = data_string; //And the huge BLOB
[code]....
View 3 Replies
Sep 16, 2011
When properly loading and stopping .swfs imported via the loader class the .swf is loaded into the memory. When i have close to 25 vids beeing played and each of them is about 5mb, it goes without saying that it takes alot of memory. When playing a video, selecting a new video, then going back to the old one, it loads 3 videoes intoo the memory because i use 1 single loader variable.. how you can prevent the memory leak?
View 9 Replies
Apr 8, 2010
I'm on the brink of finishing the first iteration of my first game ever o/ and of course the last item I need to complete is the hardest. I am making a simple word game, and all details aside, the task at hand is a conditional block to determine whether the word the user has entered is real, and in order to do this I need to somehow compare it to a dictionary list.
1 hour of research has quickly opened up an entire universe of data structures, open source xml documents, people willing to take my money for spell checkers, and of course RegExp which I have no experience using (but am willing, and wanting, to learn!). One of the main problems Google is giving me is the addition of the Dictionary class in AS3, which "lets you create a dynamic collection of properties, which uses strict equality (===) for key comparison on non-primitive object keys..." So finding previous literal dictionary uses is tough.
I soon found taking a dictionary txt file (118619 lines) and converting it line by line into an array takes 3 minutes on my beast of a laptop gaming rig (Asus W90), and while I knew this was a bad idea, it was a nice learning experience (to give me a gauge of processing abilities).
I am wondering whether using XML is an appropriate alternative, or if there is a way to externally access a dictionary somewhere online. Looking at the XMLList Class available I see text() and toString() methods; yet I still see heavy iterations in accessing the dictionary.
Which brings up the next point: easiest way to find a String match. I understand that comparing each word one by one would be tedious for the program, so maybe splitting up the list by letter (or maybe string length, looking at the file), or first and last letter.
View 2 Replies
Mar 30, 2010
i need to upload a ridiculously huge text file into Flash MX 2004 and turn it into an array. The loading part is not a problem: the issue is splitting the array.
The original string is approximately 531,000 characters long and needs to be turned into a multi-dimensional array of 3500 elements split into another 20 elements (array[3500][20]). Unfortunately when I try to make the initial split into 3500 elements (which I would later need to split again into 20 using a for loop) the Flash takes a ridiculous amount of time to load.Most of the time Flash just crashes: I tried splitting the string into just 50 elements and it took me around 7 seconds. My computer usually has no problems with basic tasks like these.
So, what should I do? Is there a way to change memory allocation to Flash? Should I split the string? Should I create multiple text files, load them into separate loadVars objects and split those? Or am I just trying to do something too big for Flash?
View 4 Replies
Mar 16, 2009
I'm trying to make an xml based tracklist for a music mix on a website. The code loads the info from the XML file, and displays it in the text field, and I have a UIScrollbar component as well. When I test movie, everything seems to be working fine. However, the swf file is 14.1 MB. The .FLA is only 690kb... so where the hell is the size coming from? I only have text in the xml file, and the code is pretty compact. Why is the swf so big?[code];If anyone knows how this could be done so I can create one shell swf file, and load the xml file in the html/php code.
View 5 Replies
Apr 25, 2011
I have a list component filled with text of varying length.
I currently have this
But I'm trying to get this
And is it possible to manually wrap the row height depending on the size of the text inside the row?
View 1 Replies