ActionScript 3.0 :: Formatting Externally-loaded XML In A Textarea Component?
Feb 19, 2009
I've successfully loaded an xml file into a textarea component, but it creates A LOT of line-breaks which I can't seem to get rid of. Here's an example of the XML:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<resource name='Entertainment'>
[Code].....
I've thought of a way to cheat my way around this, but I'm still really frustrated by the fact that I was unable to get rid of those annoying line-breaks.
View 3 Replies
Similar Posts:
Apr 26, 2007
I'm having an issue with TextFormat tags that are appearing in textfields. Here's an overview of what I'm doing: Basically, I'm trying to grab the text from a textArea component: (myText = myTextArea.text")
Because I want to retain formatting, I have the textArea set to be html. Thus, myText becomes the text you see below
So the myText data is then stored in XML, but later when I try to access it, it fills that same textArea component with the literal code rather than the formatted text. How do I take that TextFormat string and convert it back to it's original form? I've
tried myTextArea.htmlText
View 1 Replies
Aug 8, 2007
I am trying to format externally loaded text into a Flash file, I realise I can use CSS but both the heading and body text use different obscure fonts, anyone know how to do this so the external text can be in one file? Or do I need to load heading and body text separately? And format the actual Text Fields in Flash by embedding the fonts?
View 3 Replies
Mar 25, 2009
i'm working on a game project and i got some trouble with displaying stuff in the game Launcher. everything is in AS3. I'm actually looking to achieve almost the same results as the World of Warcraft launcher with a news section. the way i think to work it is that i create either a textArea component or a textfield and display html page in it. This html page could contain text, image and flash SWF.
but here's the problem, textField and textArea component are very limited in displaying and formating HTML pages. So i don't know if i should continue to search and try developping this way or find another way for displaying dynamic stuff that can be easily updated.
View 2 Replies
Mar 31, 2010
I've got an action set to pull some information up on screen from a file.I'd like to find away to get the text to be White, Arial, Bold, and size 15... but i have no idea how! i've been trying to figure it out for over a week now and no luck at allBelow is my action.This is using ActionScript 3 in Flash CS3Code:
Code:
var externalReq:URLRequest = new URLRequest("SYM.txt");
var externalLoad:URLLoader = new URLLoader();
[code]....
View 3 Replies
May 17, 2011
I have a TextArea component called labels that will be populated by Strings in an Array called labelsArray.[code]...
I don't understand starting from "...specifying the end..." to the end. I don't understand how arrow keys come into play with formatting of text.
View 1 Replies
Jan 8, 2011
I am studying Flash and want to make a video player with where you can change video and the corresponding subtitles with a click on either "forward" or "back" button.
So far I have created 2 arrays of video files ("[videos]") and text strings ("[captions]"). By clicking on one of the buttons, the video in the FLVPlayback component changes as well as the the subtitles-text in the TextArea.
However I have a problem with text formatting.
I use the following functions for button click:
function playNextVideo():void
{
if (currentVideo < videos.length-1)
[Code]....
My problem is that the format changes only when I click the button, but it is not applied for the first subtitle.
So, for the first video I get a plain text, with black color, not italic and not with size "18". However, if I click on "forward" button (and thus execute the playCurrentVideo() again), the format will change. If I then will try to go back to the first video, the text will now be formatted.
So my question is - what causes this condition and how to handle it?
View 2 Replies
Feb 26, 2010
I would like create a text area with code highlighting in flex. Is there an advanced textArea witch suports css for real. For example:
myHtmltext:String = '<span class="keyword"> #include </span>';
myTextArea:TextArea = new TextArea();
myTextArea.htmlText = myHtmltext;
View 1 Replies
Aug 30, 2005
I am in the process of building a site for an Architect... Jamie Fobert Architects (projects) I am useing transitions between the projects and am loading details/text and images externally through flashvars, php and a mySQL database. Within my transitions I have a a preloader on the forst 2 frames the code is as follows (taken from a Voetsjoeba tutorial):
[Code]....
This works pretty well if the content is within the .swf, but when it is loaded externally it doesnt preload it at all. Does anyone know how I can adapt/improve this preloader? or somehow ensure that all the content being loaded externally is loaded before the transition plays?
View 2 Replies
Nov 19, 2008
I am using a List component. Each list item is divided in three lines.I want first line to be bold.
View 1 Replies
Jul 22, 2011
I am using CS5, AS3 and the scrollbar component as well as dynamic text from an XML file. I can format the text (color) in my XML that IS NOT being pulled into the scrollbar text. However, I have had no success formatting anything that is to scroll.
I have tried with and without CDDATA tags and nothing works. Is this allowed?
View 2 Replies
Feb 16, 2006
I am loading an externally loaded swf that uses a mask to transition in. When the user clicks a different button I am doing a gotoAndPlay that goes to a mask that "unloads" the content (it doesnt actually unload the info is just outside of the mask area. As soon As I jump to that section the movie is no longer loaded and just shows the container clip that I had created for it. The Container Clip is never changed and is the same throughout the whole process. The only thing that changes is the mask animation.I have tried both loadClip and loadMovie but no luck on keeping the clip loaded.
EDIT - I have narrowed it down. When I change the mask movieclip the movie unloads for some reason. Is there a way I can keep it loaded?
View 2 Replies
Aug 28, 2008
We have a TextArea that is created dynamically reading in XML data with the textFormat set to Arial font as the default. When we publish it the font tag for a subscript and superscript fonts is not displaying even though we have embedded the fonts. It displays
properly if the font is installed.
View 2 Replies
Jun 23, 2009
Is there a way to get a TextArea to automatically scroll down when text is added to it?I have had a look around but havent found anything that works.
View 2 Replies
Nov 20, 2009
The scroll policy for the textArea component appears to be "auto", and that works just fine.However, I want to be able to turn it off in certain situations, i.e., not have the scroll bar appear.I do the following which I thought would turn it off but the scroll bar still shows up.
Code Snippet:
myTF = new TextFormat("Arial", 10, 0xFFFFFF,false);
myText_mc.myTextArea.setStyle("textFormat", myTF);
myText_mc.myTextArea.verticalScrollPolicy = "OFF";
myText_mc.myTextArea.horizontalScrollPolicy = "OFF";
View 2 Replies
Jan 27, 2010
How does one customize the text area component ( I mean text font, text size, colour and so on). Nothing like that appears in Component Inspector.
View 5 Replies
Apr 10, 2010
I am facing a problem while using textAreacomponent in Flash cs4.I set the text of this component at run time with coding i.e dynamic text and after that i am rotating this component with -2.After rotation it dosen't show the text why is it so?
View 1 Replies
Mar 22, 2008
I'm working in ActionScript 3 and, yet again, I'm starting to regret trying to use components as it seems I always run into a brick wall when using them : (
I have a TextArea component instantiated and added to the display list programmatically via ActionScript 3 code (not AS2, which is all I could find reference to on the net about this).
How to disable the border so it doesn't show around the TextArea component? I've tried a bunch of things, like for example:
myTextArea.setStyle("border", "false");
and
myTextArea.setStyle("borderStyle", "none");
View 11 Replies
Sep 20, 2004
I'm using the textArea component, but i want to scale it to the size of the browser window. The problem is it scale the content(xml+css) and the scrollbar, and i want to just change the size. I've also tried to attach the Component and then setting the size, but that give the same problem.
View 3 Replies
Aug 12, 2009
I have got an array full of strings and I want to populate the elements into dynamically created textarea components. I have seen "this []" syntax used to dynamically create arrays, but I can not get something similar to work for text area components.
Here is the code that I am trying:
Code:
for (var i:int = 0; i < aActivities.length; i++) {
this["taNode_" + i] = new TextArea();
this["taNode_" + i].move(20,50 + (10*i));
this["taNode_" + i].height=26;
this["taNode_" + i].text=aActivities[i];
addChild(this["taNode_" + i]);
}
I get this message when I run my movie:
"1180: Call to a possibly undefined method TextArea."
I do have an instance of a textarea in my Library as I know you have to for things like data grid.
View 4 Replies
Nov 14, 2010
I have a TextArea component in a flash document, and this TextArea is loading text from a .txt file.
However, when you're viewing the textarea in a webpage, you can not only select the text that has been loaded into the textarea, but you can also delete the text written there, like it's a word document or something.
Is there any way I can disable this?
View 3 Replies
Nov 19, 2009
TextArea component does not load after publishing as AIR .I have a TextArea component in the library. Its Class is: fl.controls.TextArea I add it to the stage using the addChild method. Running it inside the flash CS4 the textArea component gets added to the stage as intended. But after publishing, the textArea component doesn't get loaded. What may be the problem? The stage is blank without any textarea.
View 2 Replies
Nov 30, 2009
I am just starting to use the TextArea component in Flash CS3. How do I change the font size, style, and color of the text within the textarea? Can I also change the textarea background color from white to something else?
View 3 Replies
Feb 26, 2010
Right now I just have a single color as its background via
textarea.setStyle("backgroundColor", "0xe3ecca")
However, is it possible to say, create a gradient (the only way I know how to do so is with the beginGradientFill that you use while using the drawing API) as a variable and then apply that as the background to the TextArea component somehow?
View 2 Replies
Jun 25, 2009
With the Flex 3 SDK you simply needed to set the borderThickness style to 0, or set borderStyle to none. With the Flex 4 SDK ad the Spark theme, this has no effect.
View 5 Replies
Sep 19, 2011
I've a TextArea component in my MovieClip. When I double click on it, I want to switch to TextField component, allowing me to change its content. When I click outside, I want to restart its original class (TextArea).
I'm doing this, but didn't work:
element.addEventListener(MouseEvent.DOUBLE_CLICK, changeName);
private function changeName(e:MouseEvent):void{
e.target.type = TextFieldType.INPUT;
}
Where element is a TextArea (classic and dynamic text).
This is how my MovieClip looks. "Name" is the TextArea that I want to allow user changes. I'm setting it like this:
Nombre de instancia = Instance name (empty)
Texto clasico (classic text)
Texto dinamico (dynamic text)
The MovieClip is controlling my by own base class (called 'ConfLayer'). Inside it I have this:
public function doStuff(e:MouseEvent):void{
// element = TextArea 'Name'
element.addEventListener(MouseEvent.DOUBLE_CLICK, changeName);
} private function changeName(e:MouseEvent):void {
var tarea:TextArea = e.target as TextArea;
var tf:TextField = tarea.TextField; // this line throwing error
tf.type = TextFieldType.INPUT;
}
Because AS3 gives me errors, I tried this:
private function changeName(e:MouseEvent):void {
e.target.TextField.type = TextFieldType.INPUT;
}
When I double-click on TextArea element, the previous string removes and I can't write nothing.
View 3 Replies
Jun 29, 2006
I'm importing text into a TextArea component and it all works fine and dandy.Though I want the textarea to not form a scrollbar but to actually just keep adjusting its height so there is never a scrollbar.I looked through all the properties and I have no idea what to test for to see if there is a scrollbar.
View 1 Replies
Oct 17, 2006
I am working on this website, but i can't figure out why i can't embed my pixelfont in my textarea.
[URL]
I read on the internet i had to do it with styles because the textarea is dynamically filled with content. So i wrote this code, but it doesnt work!
Code:
// **************************************************************
// Styles
// **************************************************************
var my_styles = new TextField.StyleSheet();
[Code]....
View 4 Replies
Feb 19, 2010
I have a TextArea component with a lot of content (images+text) - the content is coming from a xml file.. i need to print the textarea content and when i do - it is printing just the visible content area with scrollbar-is there anyway i can print the entire TextArea content using a print button on my flash file- im using AS2.
View 1 Replies
Jun 2, 2010
On my website Im trying to display examples of code. Ive been hitting a rather large wall when it comes to flash and how it deals with formatting text.
If I simply load as regular text I get a massive amount of extra white space and lose all my indenting. If I load as htmlText, I can get it to remove most of the white space but not all. I can also get some indenting using htmlText but it only applies to 'paragraphs' as a whole, which is obviously irrelevant with code, and requires me to go back to way too much white space.
Is there anyway I can get flash to load -exactly- what I see in notepad in regards to white space and indenting at the same time?
View 3 Replies