Flex :: Create XML Object From Poorly Formatted HTML?
Dec 29, 2010
I want to make an XML document from an HTML one so I can use the XML parsing tools. My problem is that my HTML is not guaranteed to be XHTML nor valid. How can I bypass the exceptions? In this string <p> is not terminated, nor is <br> nor <meta>.
var poorHtml:String = "<html><meta content="stuff" name="description"><p>Hello<br></html>";
var html:XML = new XML(poorHtml);
TypeError: Error #1085: The element type "meta" must be terminated by the matching end-tag "</meta>".
ow do you display HTML formatted text in a Spark custom item renderer (Actionscript)?
Sample Code:
The html content in item.post_content displays as plain text in the IconItemRenderer messageFunction snippet below (which is just the default generated code for Icon Item renderer):
I've been experimenting with MXML- and spark-textarea (and richtexteditor)when I copied some formatted texts like Test tes1 from MS Word 2007 and paste them inside the flash textarea , the formattings are gone (I only receive the plain texts)But when I do the same to the Jwysiwyg (a jquery wysiwyg text editor), the formatting doesn't disppear.Is there a way to make flash textareas receive formatted texts without destroying the formattings?
open google docs, new document, and type in: hello world (world bolded)
then download it as html(zipped)
i unzip the html file, and save it to the assets folder in src folder of my Flex app
i have a Spark:TextArea instance and i want to do:
var importer:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_FIELD_HTML_FORMAT); myTextArea.textFlow = importer.importToFlow(htmlSource);
where htmlSource should point to the saved html file somehow
how do i do this? i tryed embedding, converting to ByteArrayAsset and to String, but i always get the source of the html file and not it's rendered rich text (ie "hello world).
Whenever I draw a shape with Object Drawing turned on the blue bounding box that appears whenever it is selected isn't aligned properly to the outer edgers of the shape. Like this:
Admittedly it isn't a major problem it's just a bit irritating especially when people I'm teaching to use Flash ask me why it looks the way it does. Does anyone else have this problem?
I know that I can use CSS styles with HTML-formatted text in Actionscript. I have TextField, and there is HTML-text such as b and p tags. I want to change styles of those elements. I know a lot of CSS, but I don't know how to use it with Actionscript 3 and Flash. Here's my code.
How I can get this html formatted text to display correctly in the body of an email, when I am using mailto:? I am trying to avoid using a PHP aggregate, so I can use the mailto: and have it open the users email program directly. Here is what my code looks like, with the style of string that my client would like to use to populate the body of the email .
Code: public function handleEmailClick(e) { ...... var emailVar = "mailto:"+""+"?subject="+emailSubject+"&body="+big String; var request:URLRequest = new URLRequest(emailVar); navigateToURL(request); }
I have pre-formatted HTML in a textfile. Let me know if any of this might already be an error-source- I am currently too tired to try out alternatives: The textfile looks something like this:
HTML Code: <p><img src='biathlon' vspace='2' hspace='4' width='40' height='40'></img>Alot of text</p> <p><br></p> <p><img src='biathlon' vspace='2' hspace='4' width='40' height='40'></img>Even MORE Text</p> <p><br></p>
It's saved as a ".txt"-file... I didn't think that would really make a difference? What I want to do is load the file and dump it directly to an HTML-enabled textfield, using something like
Code: if (loaded) { TickerData_txt.htmlText = this; } in the function connected to the "onLoad".
If I use "LoadVars" as a handler to load the file, it gives me the raw data, something like "%3Cp%3E%3Cimg%20src=%27biathlon%27%20vspace%3D%27 2%27..." (you get the idea)... If I use an XML handler, it only gives me the first entry when I use "this" to send the file's content to the htmlText-field... probably because each entry in the file is enclosed by "<p>"-tags and the XML-handler considers the file to be over once the first closing "</p>" occurs?
What would need to be added to the file to make it load it all? Or what would I need to change about the function to make sure it sends the whole content of the file? When I use "trace" on the "this" that is loaded, it actually *does* give back only what it also sends to the textfield, even though the text-file contains several rows of that stuff.
I'm trying to load html-formatted text in from a file to put in a text area (which is set to render text as html text). The htmlFile instance is of XML type and it reads in the file correctly (I traced it) but when I assign it to the text area it reads as plain text instead of html-text. I use this code on loading event:[code]
I want to display HTML formatted content from various sources inside a Flash Flex application. Flash supports HTML formatting in its text fields, however it is very limited compared to a web browser. Are there any scripts out there that will convert common HTML formatted text into a format that Flash can handle? My particular use cases are:Displaying HTML formatted emails inside FlashDisplaying RTF files inside Flash (after running an RTF2HTML conversion on the server)Displaying random HTML content copied and pasted from other sources into Flash
I'm trying to load html-formatted text in from a file to put in a text area (which is set to render text as html text). The htmlFile instance is of XML type and it reads in the file correctly (I traced it) but when I assign it to the text area it reads as plain text instead of html-text. I use this code on loading event:
I'm using the techniques discussed in this thread on ActionScript.org to load formatted HTML text into flash. I also want to scroll said text, and for that purpose I'd like to use Flashscaper's scrollbar. I've run into a bit of a snag, however.
The text displays fine. However, the scrollbar does not appear when initiated and the mask (a red rectangle) can be seen on the right side of the content area; not the entire thing, just a red area about 5-10 pixels wide. The text can be scrolled using the mouse wheel, so the scrollbar functionality is intact. I think this has something to do with the transition within the ContentText function, but when I comment that out, the text doesn't display at all, nor does the scrollbar. Listed below are the three components to this project.
ContentText.as:
Code: package { import flash.display.MovieClip;
[Code].....
As an update, I did get this sort of working by adding a button that brings in the scrollbar as a separate function. This works after the text's transition has completed. Perhaps I can simply tie the scrollbar function to a timer that fires when the text begins to load?
I am trying to load in a text file into a flash movie which has some HTML formatting to it - there's very little i can find out about this on the web - it kinda works..
here's my external text file..
history=<B>History of BodyTalk</B> <B>World Wide Focus</B> The International Association (IA) <a href="http://www.bodytalksystem.com" target="_blank"> <font color="#0099FF"> www.bodytalksystem.com </font></a>
I'm trying in vain to store and retrieve HTML formatted text in a XML node.I know it has to be held in CDATA brackets, otherwise the XML is invalid, but... this means that Flash doesn't parse the data as HTML, rather it just displays it as the raw text.
I'm trying to set up a html formatted xml document that is called into flash. I'll give you my code so you can see what I have done. Each slide represents a different content page - each will be called from a corresponding swf movie.
The content is loading into the flash movie, but I can't figure out how to get words bold .. I tried some CDATA as you can see but all that displays in the flash movie is <b>BOLD</b> and the rest of the content after it is just gone ...I need to be able to place the html text straight into the xml file and have it display the formatted text in the flash movie .. no clue how to achieve this .. I'm using Flash MX.
I am using a dynamic text field to show html formatted text from .txt files. I have set the html property both in the properties panel and in AS, and it mostly works. All html formatting show up just fine, except for when "&" is used. Flash CS3 documentation indicates that & is supported, so.? All text after the & does not appear: the only text loaded is that that comes before it. I am using CS3, AS2, publishing in Flash Player 9. Sorry if this problem has been addressed elsewhere, but I've had no luck with my searches.
I am developing an web application in flex which have a feature of recording the runtime by having a snapshot of each frames then encoding it into a ByteArray for video playback. I am currently using NetStream.appendBytes() for playing the ByteArray FLV. It is working, but I just found out about OSMF and thinking bout integrating it in my application. It is it possible to play the flv byteArray in OSMF?
So I am loading some very poorly built AS2 swfs into an AS3 file.I am able to open them and close them (addChild and removeChild)The problem I am now faced with is each of these AS2 swfs contain video using the AS2 FLVPlayback component. When I open the first SWF, the video plays fine, I close the SWF(removeChild). Then I go to open the next and the video will not play.
If I reload the page and open that second video first, it works.It seems when I watch a video for the first time no matter which AS2 swf I pick, it works. Its when I close it and open another one is when it doesn't work..
I'm scaling text from small to large using tweens, but when the text is scaled, it turns into these unreable blobs. The text is still editable, just not useful. (The output looks fine, however.)Is there a setting, or a different method, I should be using to scale text in a tween to prevent this?
I am creating a flash object that does some heavy image lifting. What I am looking to do is load many flash objects onto the same page to take an image, modify it, and display it within the flash object.The problem I am running into is that when I try to add 100 flex objects to the page, the browser freezes as it tries to re-load/initialize each instance.Once they are all loaded, the processing of the images goes by quick.Does anyone know how to duplicate the flash piece without having to reload everything?
Basically i want to create XMLDesigner kind of thing in Flex, using which user can add/edit components and properties of view/dashboard. i am storing view structure in a xml file. i parsed that file at runtime and display view. How to convert an object (having properties and sub-objects) to xml node (having attributes and elements) and add that xml to the existing xml file. so that next time when i parsed xml file i'll get that new component in my view/dashboard. for e.g, object structure of component in xml file :
So I hava array Links and array Params with same langth NSo what I need is to create an object where for each link from Links I will be able to see param from ParamsAnd than for example to be abble to call something like
for each( item in object) if (item.param == "some value") { // some code
Here is where I am at this juncture... I have a requirement wherein I need to render an HTML text containing an '' tag which embeds a video, for example:-
[Code]....
Now I need to render this video into my Flex Web Application. One way to do it, as I see, is somehow extract the 'data' attribute and put it as a 'source' for spark VideoPlayer. Is there any better way to do this? Also note that, I require to render all video formats (avi, mov, wmv etc.) and not just flv or f4v.
I am designing a web application in Flex 4 and currently facing an issue rendering advanced HTML tags and entities in Flex 4. All I want to do is basically render an HTML text coming to me something like the one given below:-
So what I nedd is simple - how to create a drag and dropable circle with flex 4 and AS3 and using Box2d make it fly some more in the direction of drag and than stop?