Flash MX - HTML Parsing Problem: Custom Extension File Won't Parse As HTML
I am using Flash MX.
The problem is, I have a movieclip in my main timeline. This movieclip has a main key and a refresh key, which updates the dynamic textfield's contents with a loaded variable named content. The variable content is stored within a file named readme.ifh. When I load the variable in the textfield, it shows me the source of the HTML, not the rendered version.
What's wrong (and yes, I do have the "Render as HTML" option checked)?
FlashKit > Flash Help > Flash ActionScript
Posted on: 09-02-2002, 09:13 PM
View Complete Forum Thread with Replies
Sponsored Links:
[f8] Problem Parsing Html From .xml File
Hi Everyone,
it's me again. Hopefully someone will be able to help me this time. i've looked far and wide about this, and already put some examples to use, but it's still won't work.
I'm still working on my tarot card game, and it works fine so far, except when i started working on parsing html tags from my external .xml file to my dynamic textfield displaying text that relates to the tarot card the user has drawn.
I start off with loading some variables from an .xml file (the title of the card set, and the number of cards [noCards]). Next, i load the images of the cards from another .xml file (using the previously loaded variable of the number of cards (noCards) in the set). this works fine. The last .xml to load is the one containing the texts to the cards. The problem here is that it does, of course, load the first entry in the .xml file (where i still = 0), but then spits out the rest as 'undifined', as if it can't use the loaded variable of the number of cards (noCards). But the previous function loading the images worked fine, so i don't understand why it suddenly doesn't work.
Also, when tracing that first loaded text, it shows the html tags in the output window. Since i'm new to xml, i don't know it that's correct or not. As well as that, when trying to just view the text that WAS loaded, and it's corresponding image (the first entries in their respective arrays that they have been saved into), it did not show the text at all. Anyway...
Here's part of my .xml file:
Code:
<?xml version="1.0" encoding="utf-8"?>
<JOGO>
<CARTA><![CDATA[<b>20 Der Altar<b><br/><br/> - Wenn du diese Karte gezogen hast, scheint es an der Zeit zu sein, dass du etwas ganz allein für dich hast - etwas, was dir Kraft schenkt.]]></CARTA>
<CARTA><![CDATA[<b>IV Der Atem<b><br/><br/> - Hast du manchmal das Gefuehl, nicht genuegend Luft zum Atmen zu haben? Oder kennst du vielleicht auch das Gefuehl, deine Umgebung erstickt dich? Was wuerdest du empfinden, wenn jemand zu dir sagen wuerde: „Du bist wichtig“?]]></CARTA>
<CARTA><![CDATA[<b>6 Die Aura<b><br/><br/> - Unser körperliches und seelisches Befinden ist in unserem Energiefeld, d.h. in unserer Aura, spürbar und für manche Menschen auch sichtbar. Auch wenn du vielleicht die Aura nicht sehen kannst, können doch andere Menschen unterbewusst deine Aura wahrnehmen. Mit etwas Übung lässt sich unser Wohlbefinden über unsere Aura beeinflussen.]]></CARTA>
<CARTA><![CDATA[<b>13 Der Baum<b><br/><br/> - Das Thema dieser Karte ist die Stärke und das Fließenlassen von Kraft. Es wir dir guttun, dich in nächster Zeit mit Bäumen zu beschäftigen.]]></CARTA>
<CARTA><![CDATA[<b>15 Der Dank<b><br/><br/> - Du bist unzufrieden und siehst vermehrt die Dinge, die in deinem Leben nicht funktionieren und nicht im Fluss sind? Dann ist es an der Zeit, deine Gedanken auf das zu lenken, wofür du dankbar sein kannst und was du bereits erreicht hast.]]></CARTA>
<CARTA><![CDATA[<b>26 Der Engel<b><br/><br/> - Engel gibt es für die Menschen, die an sie glauben. Möchtest du deinen Engel kennenlernen? Ach, du denkst, es gibt gar keine?! Seltsam … Du hast doch die Karte gezogen …]]></CARTA>
<CARTA><![CDATA[<b>1 Die Erde<b><br/><br/> - Die Karte Die Erde ist ein Hinweis darauf, nicht verwurzelt zu sein. Was du brauchst, ist Verbundenheit mit Mutter Erde. Es kann sein, dass du oft kalte Füße hast oder dich nicht ganz „zu Hause“ fühlst. Eine gute Übung ist das „Erden“.]]></CARTA>
<CARTA><![CDATA[<b>5 Die Farbe<b><br/><br/> - Du fühlst dich in einer Situation unwohl? Hast du unangenehme Gefühle wie eine zugeschnürte Kehle, einen Stein im Magen, oder bist du aufgeregt oder weinerlich? Hast du körperliche Beschwerden oder sogar Schmerzen? Dann braucht dein Körper einen Ausgleich über Farben.]]></CARTA>
<CARTA><![CDATA[<b>14 Die Gabe<b><br/><br/> - Wann hast du das letzte Mal etwas nicht von Herzen annehmen können? Bereitet es dir Schwierigkeiten, Dinge anzunehmen? Ist es für dich einfacher, anderen zu geben? Was für ein Gefühl hast du, wenn du ein Geschenk erhältst? Ist es dir unangenehm, etwas nicht sofort ausgleichen zu können? Natürlich geht es nicht nur um materielle Werte. Gemeint sind vor allem Hilfeleistungen von anderen, die nur sehr schwer in materiellen Werten zu messen sind. Diese Karte weis dich darauf hin, dass du lernen musst, nicht nur zu geben, sondern auch anzunehmen.]]></CARTA>
<CARTA><![CDATA[<b>16 Der Gruß<b><br/><br/> - Es ist Zeit, anderen eine Freude zu machen. In unserer hektischen Zeit der schnellen Kommunikation über Mails und Telefon bleibt der schriftliche Gruß auf der Strecke. Doch eine Karte zu bekommen heißt: Es denkt jemand an mich. Du wirst merken, wie viel Freude es dir macht, deine Grüße auszusenden und viel dafür zurückzubekommen.]]></CARTA>
...
</JOGO>
Here's part of my code (where the .xml files are loaded, and their data used):
Code:
//XML for noCards and setTitle
variablenXml = new XML;
variablenXml.load("dateien/variablen.xml");
variablenXml.ignoreWhite = true;
variablenXml.onLoad = function(ok) {
for(i=0; i<variablenXml.firstChild.childNodes.length; i++) {
_root.variablen[i] = variablenXml.firstChild.childNodes[i].attributes.variablen;
trace(_root.variablenXml.firstChild.childNodes[i].attributes.variablen);
}
noCards = variablen[0];
_root.setTitle.text = variablen[1];
return noCards;
}
//XML for the images
jogoXml = new XML;
jogoXml.load("dateien/bilder.xml");
jogoXml.ignoreWhite = true;
jogoXml.onLoad = function(ok) {
for(i=0; i<noCards; i++) {
_root.cartas[i] = jogoXml.firstChild.childNodes[i].attributes.carta;
trace(_root.jogoXml.firstChild.childNodes[i].attributes.carta);
}
}
//XML for the texts
textsXml = new XML;
textsXml.load("dateien/texte.xml");
textsXml.ignoreWhite = true;
textsXml.onLoad = function(ok) {
for(i=0; i<noCards; i++) {
_root.texts[i] = textsXml.childNodes[i].childNodes[i].childNodes[i].nodeValue;
trace(_root.textsXml.childNodes[i].childNodes[i].childNodes[i].nodeValue);
}
sorteioCartas();
}
var linha = 0;
var linha2 = 0;
var linha3 = 0;
... some code
var criaCartas = function(){
for(i=0; i<nCartas; i++){
... some code
_root["carta_"+i].onRelease = function(){
criaCartaaberta()
x = Math.floor(Math.random()* noCards);
trace(x);
loadMovie(_root.cartas[x], _root.cartaaberta.load_image);
//_root.cartaaberta.frase.wordWrap = _root.cartaaberta.frase.multiline = _root.cartaaberta.frase.html = true;
_root.cartaaberta.frase.htmlText = _root.texts[x];
}
And here's what shows up in my output window:
Code:
100
36
LifeCards
dateien/karten/life/altar.jpg
dateien/karten/life/atem.jpg
dateien/karten/life/aura.jpg
dateien/karten/life/baum.jpg
dateien/karten/life/dank.jpg
dateien/karten/life/engel.jpg
dateien/karten/life/erde.jpg
dateien/karten/life/farbe.jpg
dateien/karten/life/gabe.jpg
dateien/karten/life/gru?jpg
dateien/karten/life/herz.jpg
dateien/karten/life/himmel.jpg
dateien/karten/life/klang.jpg
dateien/karten/life/kraft.jpg
dateien/karten/life/licht.jpg
dateien/karten/life/liebe.jpg
dateien/karten/life/meer.jpg
dateien/karten/life/mitte.jpg
dateien/karten/life/mond.jpg
dateien/karten/life/pferde.jpg
dateien/karten/life/raum.jpg
dateien/karten/life/regenbogen.jpg
dateien/karten/life/ruhetag.jpg
dateien/karten/life/salz.jpg
dateien/karten/life/scho?jpg
dateien/karten/life/segen.jpg
dateien/karten/life/sonne.jpg
dateien/karten/life/spirale.jpg
dateien/karten/life/stimme.jpg
dateien/karten/life/tanz.jpg
dateien/karten/life/universum.jpg
dateien/karten/life/wasser.jpg
dateien/karten/life/wasserfall.jpg
dateien/karten/life/wunderdose.jpg
dateien/karten/life/wurzeln.jpg
dateien/karten/life/zeit.jpg
<b>20 Der Altar<b><br/><br/> - Wenn du diese Karte gezogen hast, scheint es an der Zeit zu sein, dass du etwas ganz allein für dich hast - etwas, was dir Kraft schenkt.
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
Hopefully someone can help me with this. Thanks a TON in advance!
View Replies !
View Related
Parsing HTML Tags From Text File
I have a text file with a variable declared parsing out text within a paragraph element like so:
Code:
networkingText="<p> Networking in an interesting field if you are creative, driven, and eager to learn about the growing world of technology.</p>";
I set my text field to be dynamic, render as html and give it an instance name of networkingText_txt. The text loads fine in my action script layer but I can't get rid of the paragraph tags in my text box. In other words, the HTML tags are not parsing out correctly.
Am I missing something?? Any hints would be appreicated.
View Replies !
View Related
Parsing HTML Within Text Loaded Via An XML File
Hello Kirup-gurus,
I am loading in a bunch of text (and other data) from an XML file into Dynamic Text Fields on my stage via an XML.load call. Below is one example of one entry of my XML file:
PHP Code:
<stillDescriptions><text>Mack Trucks of North America came to us to help them create marketing materials for their MP7 Diesel Engine.</text></stillDescriptions>
I would like to be able to create HTML links within these strings between the <text> tags that I have in my XML file so that a user could click on the link that is inserted into the dynamic text field.
I can't get this to work. If I place typical HTML tags within my XML-tagged strings, it does not get parsed as HTML. Like this, this doesn't work -- text string gets truncated after hitting the first HTML tag. Makes sense since it may be expecting XML tags instead of HTML tags?
PHP Code:
<stillDescriptions><text>Mack Trucks of North America came to us to help them create marketing <a href = www.blah.blah>materials</a> for their MP7 Diesel Engine.</text></stillDescriptions>
Is there a trick to doing this, or is it not possible?
Any info would be most appreciated.
Thanks and good day,
-john
View Replies !
View Related
Open A Custom Html Window From A Flash File
Hail!
I'm doing a cd business card using flash mx. There is a section which I need to load in a custom html window.
I know you can do that inserting the flash file into a html file, but this is not the case, the flash file will not be inserted into a html file.
So my question is: how can I open a custom html window from a flash file?
also the flash file will be in fullscreen mode. How can I force the html file to be the first to be seen in the screen? (the problem is that when I open the html file, it loads minimized)
thanks in advance
Rodolfo Rogers
View Replies !
View Related
How To Open A Custom Html Window From A Flash File?
Hail!
I'm doing a cd business card using flash mx. There is a section which I need to load in a custom html window.
I know you can do that inserting the flash file into a html file, but this is not the case, the flash file will not be inserted into a html file.
So my question is: how can I open a custom html window from a flash file?
also the flash file will be in fullscreen mode. How can I force the html file to be the first to be seen in the screen? (the problem is that when I open the html file, it loads minimized)
thanks in advance
Rodolfo Rogers
View Replies !
View Related
Parse HTML In Flash
Hi,
How to parse html in flash.
Can any one tell abt this, Suppose i have 200 lines html is there, In that i want a particular tag. How can i parse that tag.
Plz help on this.
Thanks
Rajesh ...
View Replies !
View Related
Parse Html Bullets From Data Into Flash?
i realise that Flash has a fairly limited HTML/rich text, im using Generator also and retrieving data from a DB, and content inside it will contain bullets infact alot of them, I want to use the same DB for the html, rather than using a seperate DB for the flash site, is there a way to let Flash translate the bullet tags into flash as perhaps a placeholder for Generator/Flash??
thanks
RM
View Replies !
View Related
Flash Parse Inline Xml Code In HTML Page
I have a movie that loads data via an XML file and that works fine. My question is can I get that same information inline - ie can I have the Flash <object> tag or some xml equivelant on the same page as the xml?
If this is confusing, I am working within an application that allows me to add "panels" of HTML code to a page. I can copy the XML gue from an Office graph and paste it into my HTML and the ActiveX graph reads it. Can I add some xml gue to my HTML page and parse it in my SWF?
Thanks,
Rob.
View Replies !
View Related
Html Text Field Not Parsing Html
hi everyone
another problem. I have a text field marked at html text, and I want to dynamically apply text to it. Works fine and well, but the html (only a href tags) are not being parsed. I've also tried manually putting this into an html text field, and the same thing happens... nothing.
Any help? I'm desperate.
View Replies !
View Related
Parse Custom Text File
I've made a config application that output's a config file as below, what I'm wondering is if it possible to reload the text back into flash to pull the variables from it again.
It can ignore any line beginning with ';'
If it helps I'm using Flash MX 7.2 & the latest release of mProjector.
; display flubber anim
doStartupAnimation = 1
; do dvd drive check
doDvdDriveCheck = 0
; do not reset when pressing on eject
noResetOnEject = 0
; 255 characters max here, format is <drive>:<path_to_xbe>.xbe, e.g. "f:dashesavalaunch.xbe"
; keep all paths lowercase just in case you have any issues with dashboards booting
dash1Name = c:avalaunch.xbe
dash2Name = c:evoxdash.xbe
dash3Name = c:unleashx.xbe
dash4Name = c:xbmc.xbe
dash5Name = c:xboxdash.xbe
; the xbe name of the title image loaded from dvd on startup, 16 chars max!
dvdBootXbeName = default.xbe
; flubber (blob) colors
colorBlob = ff26ff3f
colorBlobGlow = 00a0ff40
colorGreenFog = 00a0ff60
colorFlubberScene = ff35ff19
colorFogGlowStart = ff00ff00
colorFogGlowEnd = 009fff66
View Replies !
View Related
AS 2.0: Custom Class Does Not Parse XML File
hi,
lately, I've been trying to mess around with self-made classes in actionscript 2.
I want to write a class that loads and manages XML data, but I fail already at parsing the XML file in my class (the class resides in a text file called "DataManager.as").
What's wrong with this basic construction?
PHP Code:
class DataManager {
private var xFile;
/////////////////////////////////
//no Constructor
/////////////////////////////////
public function initialize ()
{
xFile=new XML();
xFile.ignoreWhite=true;
xFile.onLoad=processXML;
xFile.load("matches.xml");
}// end initialize
private function processXML(success)
{
trace("processXML");
if (success){
trace(xFile.status);
trace("load success");
trace("FirstChild-ChildNodes: "+xFile.firstChild.childNodes.length);
trace(xFile.firstChild.nodeName);
}// end if
}//end processXML()
}//end class
The file is there, it gets loaded (success becomes true) but xFile.status, xFile.firstChild etc remain undefined. When I load and parse the file using these two functions outside of the class, everything's fine. What's wrong? Do I have to import something to make XML parsing possible in a custom class?
Any help is appreciated, thanks in advance...
View Replies !
View Related
Flash Parsing HTML
Hello all,
I have some HTML saved in my database and I pull this out into Flash using AMFPHP.
My question is how do I get the html too be parsed by Flash so that it shows up normaly in a text area or textfield?
Thanks all
View Replies !
View Related
Flash Parsing HTML
Hi, I have some action script that parses an HTML file and outputs it on screen in an swf file. However the html tags are just parsed as normal tags, i.e. if I have <b> tag I get it displayed on screen instead of outputting a phrase in bold. Is it possible to read the html tags in flash?
thanks.
View Replies !
View Related
Retrieving&Parsing HTML In Flash/XML/ASP
Hi,
I would like to pull an html page in , parse the html, select the text info that I want and then display it in flash.
Example:
Pull in wind.html from a live site.
Parse the html.
Take out the wind speed text - display it in a text box (either by searching and finding wind direction text in the html - or using the line that this info is on or something else).
Take out the wind direction - display in a text box.
Can any 1 help?
I can use flash, xmll and or ASP
Thanks
Dev
View Replies !
View Related
Retrieving&Parsing HTML In Flash/XML/ASP
Hi,
I would like to pull an html page in , parse the html, select the text info that I want and then display it in flash.
Example:
Pull in wind.html from a live site.
Parse the html.
Take out the wind speed text - display it in a text box (either by searching and finding wind direction text in the html - or using the line that this info is on or something else).
Take out the wind direction - display in a text box.
Can any 1 help?
I can use flash, xmll and or ASP
Thanks
Dev
View Replies !
View Related
Retrieving&Parsing HTML In Flash/XML/ASP
Hi,
I would like to pull an html page in , parse the html, select the text info that I want and then display it in flash.
Example:
Pull in wind.html from a live site.
Parse the html.
Take out the wind speed text - display it in a text box (either by searching and finding wind direction text in the html - or using the line that this info is on or something else).
Take out the wind direction - display in a text box.
Can any 1 help?
I can use flash, xmll and or ASP
Thanks
Dev
View Replies !
View Related
Parsing HTML Special Cahracters In Flash
Hi guys
I have a Database that is used for a flash site and for an html based accessible site. Text in teh DB contains special characters like the ones on thsi page:
http://www.htmlhelp.com/reference/ht...s/special.html
At the moment I have a function that replaces some of these strings:
Code:
_global.handleSpecialCharacters = function(inputString){
trace("handleSpecialCharacters: " + inputString);
if(inputString.indexOf("&") != -1){
trace("replacing special");
RE = new RegExp("&","g");
inputString = RE.replace(inputString,"&");
RE = new RegExp("<","g");
inputString = RE.replace(inputString,"<");
RE = new RegExp(">","g");
inputString = RE.replace(inputString,">");
RE = new RegExp(""","g");
inputString = RE.replace(inputString,""");
RE = new RegExp("'","g");
inputString = RE.replace(inputString,"'");
}
//trace("returning: " + inputString);
return inputString;
}
but it doesn't cover all of them. if I did cover all of them I would be getting concerned about how long this would take to process.
Is there a fucntion in flash that will parse these characters for me?
BTW - I know I could jsut use an html field but that would be a very big job to change everything and would require a lot of testing to make sure everythign had been changed over properly.
I hope someone can help.
View Replies !
View Related
Flash Parsing Html (reading Web Content)
Hi guys,
I'm wondering if someone could point me in the right direction (i.e. keywords or documentation)...I'm looking to have flash grab webcontent and display it in flash (Flash may be running as an .exe on a users desktop). As I remember it (been a while since I worked with flash + actionscript), flash can read xml files but what about just html?
For example if I wanted to grab random images from Google Images and display them in a movieclip and possibly file them away as well, would this be possible with standalone Flash (even on the desktop)?
Would I be better off trying some other technology? I like flash for the slick UI.
View Replies !
View Related
Any Way To Parse PHP/HTML Results?
There are a couple of personal profile sites that I peruse from time to time of an adult nature (grin) and the way they present the content is pathetic at best.
So my thought was this: I will create a custom interface in flash that uses the exact same PHP or URL calls that their pages do and it will basically be my own custom interface to give me the data the way I would like it.
Is this sort of thing possible? The truth is that I believe my new interface will be such an improvement that I can turn around and sell the interface and a couple of skins to the company who is providing the content.
If they don't buy it, I could always sell it outright or give it away if it works? Any suggestions, Ideas?
Thanks, Rowdy
View Replies !
View Related
Parse Html In Loadvars
For the life of me I cannot find a concise explanation of how to parse simple html using LoadVars
I can get the html from a simple web-page (no frames, no gimmicks, no embeds, just plain html 1.0) to load into my LoadVars object, but it creates a huge set of properties that don't make a lot of sense. When I iterate through them to add them to the htmlText of a TextField object, I get the text of the onLoad function of my LoadVars object even though I can see in the properties of the textField object, all of the htmlText in the htmlText property in the debugger.
What is going on?
Thanks in advance,
Jase
View Replies !
View Related
Parse Html Trough Xml Possible ?
First, I would like to load in Flash the next bit:
Code:
<IFRAME SRC="http://tickertape.beurs.nl/beursnl/ticker.aspx?width=750&speed=15" NORESIZE SCROLLING=NO HSPACE=0 VSPACE=0 FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 WIDTH=750 HEIGHT=25></IFRAME>
I know this is not possible in Flash, but I thought maybe there is a roundabout to get this to work anyway..
Is it maybe possible to load in the above mentioned bit of code with XML ???
And if yes, what is the way to do so ???
Hope someone knows and can help me...
Greetings Irene
View Replies !
View Related
Remote Php To Parse Csv, Return Html?
Here's the problem:
Our main server doesn't run php, but a secondary server does. (long story, just follow along for now, don't ask why). I'm building a flash file that needs to go through a CSV file, (comma separated values, output from Excel) and php seems to be the ticket there. Is there a way to tell flash to call a php page that'll go through the csv file and return the values to the flash file?
Please?
View Replies !
View Related
Problem With XMLSchema, It's Not Parse Extension From Wsdl
Hi, I working on webservice in AFM, and have some bug in file XMLSchema.asc
Sending error message: D:DevAdobe_Flash_Media_Server_3scriptlibwebservicesXMLSchema.asc: line 586: TypeError: restrictionNode has no properties
Failed to execute method (XML.onData).
There is not code for parsing extension, only restriction for simple type. It's serious bug and big problem for my project, because in normal project services from server working with typed data, something common with inheritance.
Please help me!!!
View Replies !
View Related
Call An Swf File To Load Into Html Document From Seperate Swf File In HTML.
I am trying to get advise on the best way to do this or how to do this. I have a layout that the customer is happy with, in an HTML document, but the SWF files will be seperated because of the layout. If you go to this link, you will see what I mean. It all takes place inside of the black bar...
http://www.hairdrezzersonfire.com
I want the icon movie on the left to play first and after it is done, I want to be able to call the main SWF file to play in the center of the black area. After that's done, I want that main SWF file to call the text logo movie to play that comes in on the right side of the screen.
I assume that I will use a placeholder of some sort in an HTML cell and it will be replaced by the swf file, but I don't know how to call it with actionscript. Any ideas?
View Replies !
View Related
Html Parsing
Is there a way to parse text with html tags with AS?
I know I can use the 'render as html' option with the text properties, but want to do it with actionscript. any ideas anyone?
View Replies !
View Related
Html Parsing
Hi,
I need to be load in an external .txt file with a url in the text, so that the url link works in the text field, how would i do that?
thanks for any help.
regards
boombanguk
View Replies !
View Related
Parsing HTML
This question has probably been asked loads of times, but I couldnt find the answer. But I was wondering, how the hell do you parse HTML in flash?
I use
Code:
myData = new LoadVars();
myData.onLoad = function() {
home.text = this.myVariable;
};
myData.load("home.txt");
To display text from home.txt in a dynamic text field, I have Render Text as HTML selected, but nothing works. I have tried <p> , <br /> <b> and others...
How do you do it?
View Replies !
View Related
Parsing XML As HTML
the goal- to get an XML to parse like html text. Attached is a very simple example. The xml (wrapped in a tag called 't'- no meaning) has p, font and a tags in its list. I would like to capture those nodes, and parse them to an html textfield....at present, the code attached breaks in three places. i expect it to break only at the p tags
Code:
var b:XML=XML(<t>
<p class='imageDescription'>this is a test <font color='#ff0000'> this breaks</font></p><p>
<a href='event:http://www.sdfds.com'><font color='#005568'> so does this</font></a>
</p>
</t>);
var tf:TextField= new TextField()
tf.width=400;
tf.height=200;
tf.multiline=true
tf.wordWrap=true
tf.border=true
tf.htmlText=b.children().toString()
trace()
addChild(tf)
View Replies !
View Related
Html Parsing
HI,
I have html page , I want to display that html page into flash, for that i need to parse all html tags into flash, extract the data from html and display that into flash.
How can i do this in flash? I mean parsing of html.
Is there anyway to convert html to xml dynamiccally in flash(through flash scritping)? Then parsing will be easy in flash using xml
Can anyone help on this problem?
View Replies !
View Related
[HTML] Parsing?
I have external text loaded into a flash movie that is html formatted:
&myInfo=<b>Hello all!!!<>
but, i want it to be displayed in a text box without the html formatting e.g. minus the <b> and <>.
cheers,
neb
View Replies !
View Related
Flash Custom Action Extension
sorry ,my English is very poor.
I made Movement.mxi, Movement.xml ,Movement.swf .
I installed Movement.mxp by Extension Manager
No error occurred in processing installment
Flash restart, Movement folder and rotateTo method and smoothMove
is appeared in action panel
but testFile...
Method do not work in its own way
Movement.mxi--------------------------------------
<macromedia-extension
name="Movement"
version="1"
type="flash custom action"
requires-restart="false">
<!-- List the required/compatible products -->
<products>
<product name="Flash" version="6" primary="true" />
</products>
<!-- Describe the author -->
<author name="somebody" />
<!-- Describe the extension -->
<description>
<![CDATA[no-item]]>
</description>
<!-- Describe where the extension shows in the UI of the product -->
<ui-access>
<![CDATA[sorry no description]]>
</ui-access>
<!-- Describe the files that comprise the extension -->
<files>
<file name="Movement.xml" destination="$flash/ActionsPanel/CustomActions" platform="pc" />
<file name="Movement.swf" destination="$flash/WindowSWF" platform="pc" />
</files>
</macromedia-extension>
Movement.xml------------
<customactions>
<actionspanel>
<folder version="6" name="Movement"
id="Movement" index="true"
tiptext="Movement">
<folder version ="6" id="Methods"
name="Methods"
tiptext="Movement">
<string name="rotateTo"
object="Movement"
text=".rotateTo()"
version="6"
tiptext ="object rotation."/>
<string name="smoothMove"
object="Movement"
text=".smoothMove()"
version="6"
tiptext="object smoothMove at the speed."/>
</folder>
</folder>
</actionspanel>
</customactions>
Movement.fla---------------------------
function Movement(mc){
this.mc=mc;
this.x = this.mc._x;
this.y = this.mc._y;
this.r = this.mc._rotation;
}
//Movement.prototype=new Object(); //??
Object.registerClass("Movement",Movement); // is this code right??
Movement.prototype.setPos=function(){
this.mc._x = this.x;
this.mc._y = this.y;
this.mc._rotation = this.r;
}
Movement.prototype.rotateTo=function(tx, ty){
var dx = tx - this.x;
var dy = ty - this.y;
this.r = Math.atan2(dy,dx)*180/Math.PI;
this.setPos();
}
Movement.prototype.smoothMove=function(speed, tx, ty){
this.x += speed*(tx - this.x);
this.y += speed*(ty - this.y);
this.setPos();
}
testFile.fla--------------------
m0=new Movement(_root.rect);
_root.onEnterFrame=function(){
m0.smoothMove(0.03, _root._xmouse, _root._ymouse);
}
testFile do not work.....
View Replies !
View Related
Parsing Variable From HTML - How
Hi,
I need a header done in Flash which simply will be copied over several pages and I want to have unique text on it. I don't know how but probably it's possible to send variable directly form html into Flash object - can you suggest me any solution?
B R
Lee
View Replies !
View Related
HTML Parsing Problem
Hello guys,
I'm trying to load html formatted text into my flash movie. It works fine for normal text, except when I use <b> or <i> tags, the text encased in the tags doesn't display. <u> seems fine. Below is the script I use to display the text:
scroller.html=true;
myLoadVar = new LoadVars ();
myLoadVar.load("textfile.txt");
contents in the text field
myLoadVar.onLoad = function (success){
if (success == true) {
scroller.htmlText=myLoadVar.myText;
}
}
Question is, how do I display bold and italic text? I have a basic grasp of HTML so it's not the way I've coded - I know simple HTML tags.
I'm using Flash MX.
Thanks
View Replies !
View Related
Wierd HTML Parsing
Ok I have a problem ... and I'm half way done ... but I can't seem to figure the last part out ...
basically the setup goes as follows
I have text field the don't render HTML tags ... when you highlight a selected peice of text you can add html tags (to be rendered later)
The tags I have given are: bold, italic, underline, font size, font color, a href
so if I setup like this (example)
This is just a test [Now I want test to be bold and underline]
so I create the new string to look like this This is just a <b><u>test</u></b>
here is the code i use
Inside the MC that holds the text field
code:
onClipEvent (mouseUp) {
if (_xmouse > 0 && _xmouse <= this._width) {
if (_ymouse> 0 && _ymouse <= this._height){
_root.selStart = Selection.getBeginIndex();
_root.selEnd = Selection.getEndIndex();
if (_root.selEnd<>_root.selStart) {
_root.t_Start = this.text1.substring(0, _root.selStart);
_root.t_Middle = this.text1.substring(_root.selStart, _root.selEnd);
_root.t_End = this.text1.substring(_root.selEnd, this.text1.length);
_root.currentIndexes = _root.selStart+"-"+_root.selEnd+" __ "+this.text1.substring(_root.selStart, _root.selEnd);
}
}
}
}
Then when I push one of the text control buttons
code:
on (release) {
mcText1.text1 = t_Start+"<b>"+t_Middle+"</b>"+t_End
}
What I need to be able to do is ... know which words where selected and wraped with HTML tags ... then I need to be able to remove any given tag
I know it sounds wierd ... its like reverse HTML parsing ... I don't even know if it can be done
Can anyone please give me some insight ...
thanks
-S
View Replies !
View Related
Parsing Out HTML Tags
I am parsing in an rss feed in AS. The desc node contains the <img> path. Although, I can set the textified to html and display the image I want to parse the tag out and place in a new array. .split(); does not seem to working. Does anyone know a good way to do this?
View Replies !
View Related
Html/xhtml Parsing
can i get a normal webpage and parse with actionscript (regexps) to get the information i need if yes please help me a bit (I can not apply xml parsing if it is not valid xhtml right ?)
View Replies !
View Related
Custom Easing Extension Work With Flash 8
The extension used in Lee's tutorial, I 've managed to download it now from laco.wz.cz but extension manager won't install it, is there a way around this to get it to work with flash 8 or is there an alternative that still works in a dialogue box rather than with action script.
Thanks
Ricky55
View Replies !
View Related
Plz Help ( Parsing HTML Form Variables )
I want to read an html file in flash and invoke different
functions according to the values of variables. This process
would be the html file first and then the following link or
flash page. The variables declared in forms in the HTML pages is what i m trying to read in my flash and invoke different functions or maybe print that back simply. Please
advice as that i m working on a project involving Novell Portal Service and has to be completed sooon .... but i m stuck at the very first trial of prototype
is this at all possible without a middleware ?????
thank you
View Replies !
View Related
XML Parsing/HTML Text Problem....
Allright guys, I have this wierd problem with HTML text.
I can't get it to display normal text, instead HTML tags with text show up. I've used the following code,
scrollComponent_mc.text_txt.html = true;
scrollcomponent_mc.text_txt.htmlText = desc_array[this.id];
------------------------------------------------------------
Basically what I'm going is parsing through an XML document using a "for" loop throwing nodes such as topic, desc, and image, into seperate arrays.
Here's the XML document snippet that I'm reading in...
<rootNode>
<topic name="topic name">
<desc><![CDATA[<B>Topic Name</B><br><br><p>this is text</p><br><p>this is text</p><br><p>this is text</p><br>]]></desc>
<image title="some photo">image.jpg</image>
</topic>
topicname 2
topicname 3
topicname 4
and so on....
</rootNode>
Here's the Code....
"guideDoc" is the name of the XML document I'm passing the this function....
function parseGuide(guideDoc) {
topic_array = new Array();
desc_array = new Array();
image_array = new Array();
guide_xml = new XML(guideDoc);
guide_xml.preloadXml(guideDoc);
guide_xml.ignorewhite = true;
guide_xml.onLoad = function(success) {
if (success) {
var rootNode = this.firstChild;
var len = rootNode.childNodes.length;
var children = rootNode.childNodes;
for (i=0; i<len; i++) {
var section = rootNode.attributes.name;
var topic = children[i].attributes.name;
var desc = children[i].firstChild.firstChild;
var image = children[i].firstChild.nextSibling.firstchild;
topic_array.push(topic);
desc_array.push(desc);
image_array.push(image);
}
buildGuideNav(section);
}
};
}
function buildGuideNav(section) {
if (attached == false) {
attachMovie("submenu_mc", "submenu_mc", 700);
submenu_mc._x = 60;
submenu_mc._y = 100;
}
submenu_mc.geartext_txt.text = section;
for (i=0; i<topic_array.length; i++) {
submenu_mc.attachMovie("button_mc", "subNav_mc"+i, i+800);
submenu_mc["subNav_mc"+i]._x = 0;
submenu_mc["subNav_mc"+i]._y = 40+(i-1)*21;
submenu_mc["subNav_mc"+i].id = i;
submenu_mc["subNav_mc"+i].textBox_txt.text = topic_array[i];
submenu_mc["subNav_mc"+i].textBox_txt.autoSize = "left";
submenu_mc["subNav_mc"+i].onRollOver = function() {
this.grow();
};
submenu_mc["subNav_mc"+i].onRollOut = function() {
this.shrink();
};
submenu_mc["subNav_mc"+i].onRelease = function() {
scrollComponent_mc.text_txt.html = true;
scrollcomponent_mc.text_txt.htmlText = desc_array[this.id];
submenu_mc.arrow_mc.Vmove(this);
};
attached = true;
}
}
So with the onRelease I'm just retrieving the htmlText stored into the desc_array. By using the
scrollComponent_mc.text_txt.html = true;
scrollcomponent_mc.text_txt.htmlText = desc_array[this.id];
sould render the text as normal text, right?
When I was working on this, only the HTML text shows up, instead of plain text. Does anyone know why this is?
Thanks...
View Replies !
View Related
XML Parsing/HTML Text Problem....
Allright guys, I have this wierd problem with HTML text.
I can't get it to display normal text, instead HTML tags with text show up. I've used the following code,
scrollComponent_mc.text_txt.html = true;
scrollcomponent_mc.text_txt.htmlText = desc_array[this.id];
------------------------------------------------------------
Basically what I'm going is parsing through an XML document using a "for" loop throwing nodes such as topic, desc, and image, into seperate arrays.
Here's the XML document snippet that I'm reading in...
<rootNode>
<topic name="topic name">
<desc><![CDATA[<B>Topic Name</B><br><br><p>this is text</p><br><p>this is text</p><br><p>this is text</p><br>]]></desc>
<image title="some photo">image.jpg</image>
</topic>
topicname 2
topicname 3
topicname 4
and so on....
</rootNode>
Here's the Code....
"guideDoc" is the name of the XML document I'm passing the this function....
function parseGuide(guideDoc) {
topic_array = new Array();
desc_array = new Array();
image_array = new Array();
guide_xml = new XML(guideDoc);
guide_xml.preloadXml(guideDoc);
guide_xml.ignorewhite = true;
guide_xml.onLoad = function(success) {
if (success) {
var rootNode = this.firstChild;
var len = rootNode.childNodes.length;
var children = rootNode.childNodes;
for (i=0; i<len; i++) {
var section = rootNode.attributes.name;
var topic = children[i].attributes.name;
var desc = children[i].firstChild.firstChild;
var image = children[i].firstChild.nextSibling.firstchild;
topic_array.push(topic);
desc_array.push(desc);
image_array.push(image);
}
buildGuideNav(section);
}
};
}
function buildGuideNav(section) {
if (attached == false) {
attachMovie("submenu_mc", "submenu_mc", 700);
submenu_mc._x = 60;
submenu_mc._y = 100;
}
submenu_mc.geartext_txt.text = section;
for (i=0; i<topic_array.length; i++) {
submenu_mc.attachMovie("button_mc", "subNav_mc"+i, i+800);
submenu_mc["subNav_mc"+i]._x = 0;
submenu_mc["subNav_mc"+i]._y = 40+(i-1)*21;
submenu_mc["subNav_mc"+i].id = i;
submenu_mc["subNav_mc"+i].textBox_txt.text = topic_array[i];
submenu_mc["subNav_mc"+i].textBox_txt.autoSize = "left";
submenu_mc["subNav_mc"+i].onRollOver = function() {
this.grow();
};
submenu_mc["subNav_mc"+i].onRollOut = function() {
this.shrink();
};
submenu_mc["subNav_mc"+i].onRelease = function() {
scrollComponent_mc.text_txt.html = true;
scrollcomponent_mc.text_txt.htmlText = desc_array[this.id];
submenu_mc.arrow_mc.Vmove(this);
};
attached = true;
}
}
So with the onRelease I'm just retrieving the htmlText stored into the desc_array. By using the
scrollComponent_mc.text_txt.html = true;
scrollcomponent_mc.text_txt.htmlText = desc_array[this.id];
sould render the text as normal text, right?
When I was working on this, only the HTML text shows up, instead of plain text. Does anyone know why this is?
Thanks...
View Replies !
View Related
Parsing XML With Html Tags For Style
I'm using flash to pull in XML data, but I want to use html tags to be able to style the text. When I add any html, it treats it as a sub-node and ignores the data. Also, line breaks in the xml are being converted to double spaced paragraphs? The relevant code is basically this:
if (element.nodeName.toUpperCase() == "TEXT")
{//add text to text array
ar_text[s]=element.firstChild.nodeValue;
}
textbox1.text = ar_text[0];
View Replies !
View Related
FMX - Parsing Xml Document With Html Tags
Hello!
I am having trouble parsing an xml document in flash.
The problem is that flash breaks the node content into different subnodes because it considers that html tags belong to a new different node.
How can you make flash ignore html tags (<b>,<i>,<u>, etc) when parsing an xml document?
The xml is something like:
<data>
<property><title>messed up text </title><description>this text is broken into<b> two parts</b>, how can you fix that?</description></property>
</data>
So for example, I'd like to have the text within the description tag in one piece and not in two. Right now flash gets to the <b> tag and breaks that node right there, creating a subnode including the text "two parts".
Any help welcome. Thanks to All!!
View Replies !
View Related
XML Parsing/HTML Text Problem...
Allright guys, I have this wierd problem with HTML text.
I can't get it to display normal text, instead HTML tags with text show up. I've used the following code,
scrollComponent_mc.text_txt.html = true;
scrollcomponent_mc.text_txt.htmlText = desc_array[this.id];
------------------------------------------------------------
Basically what I'm going is parsing through an XML document using a "for" loop throwing nodes such as topic, desc, and image, into seperate arrays.
Here's the XML document snippet that I'm reading in...
<rootNode>
<topic name="topic name">
<desc><![CDATA[<B>Topic Name</B><br><br><p>this is text</p><br><p>this is text</p><br><p>this is text</p><br>]]></desc>
<image title="some photo">image.jpg</image>
</topic>
topicname 2
topicname 3
topicname 4
and so on....
</rootNode>
Here's the Code....
"guideDoc" is the name of the XML document I'm passing the this function....
function parseGuide(guideDoc) {
topic_array = new Array();
desc_array = new Array();
image_array = new Array();
guide_xml = new XML(guideDoc);
guide_xml.preloadXml(guideDoc);
guide_xml.ignorewhite = true;
guide_xml.onLoad = function(success) {
if (success) {
var rootNode = this.firstChild;
var len = rootNode.childNodes.length;
var children = rootNode.childNodes;
for (i=0; i<len; i++) {
var section = rootNode.attributes.name;
var topic = children[i].attributes.name;
var desc = children[i].firstChild.firstChild;
var image = children[i].firstChild.nextSibling.firstchild;
topic_array.push(topic);
desc_array.push(desc);
image_array.push(image);
}
buildGuideNav(section);
}
};
}
function buildGuideNav(section) {
if (attached == false) {
attachMovie("submenu_mc", "submenu_mc", 700);
submenu_mc._x = 60;
submenu_mc._y = 100;
}
submenu_mc.geartext_txt.text = section;
for (i=0; i<topic_array.length; i++) {
submenu_mc.attachMovie("button_mc", "subNav_mc"+i, i+800);
submenu_mc["subNav_mc"+i]._x = 0;
submenu_mc["subNav_mc"+i]._y = 40+(i-1)*21;
submenu_mc["subNav_mc"+i].id = i;
submenu_mc["subNav_mc"+i].textBox_txt.text = topic_array[i];
submenu_mc["subNav_mc"+i].textBox_txt.autoSize = "left";
submenu_mc["subNav_mc"+i].onRollOver = function() {
this.grow();
};
submenu_mc["subNav_mc"+i].onRollOut = function() {
this.shrink();
};
submenu_mc["subNav_mc"+i].onRelease = function() {
scrollComponent_mc.text_txt.html = true;
scrollcomponent_mc.text_txt.htmlText = desc_array[this.id];
submenu_mc.arrow_mc.Vmove(this);
};
attached = true;
}
}
So with the onRelease I'm just retrieving the htmlText stored into the desc_array. By using the
scrollComponent_mc.text_txt.html = true;
scrollcomponent_mc.text_txt.htmlText = desc_array[this.id];
sould render the text as normal text, right?
When I was working on this, only the HTML text shows up, instead of plain text. Does anyone know why this is?
Thanks...
View Replies !
View Related
Parsing Text/variables From Html
I am working on a Flash file that requires being able to load HTML from another domain and parse it. Obviously I am therefore unable to format it how I would like, etc.
An example:
<br>Banshee<br><img src="g005st.xpf" direction=16 animation=yes>
<table border=0 width=280>
<tr><td>Influence</td><td>25 </td></tr>
<tr><td>Slots</td><td>10 </td></tr>
<tr><td>Max Weight</td><td>64 kg</td></tr>
<tr><td>Max Space</td><td>15 L</td></tr>
<tr><td>Unit Weight</td><td>50 kg</td></tr>
<tr><td>Type</td><td>Biological </td></tr>
<tr><td>Base Health</td><td>1200 </td></tr>
<tr><td>Base Armor</td><td>3 </td></tr>
<tr><td>Speed</td><td>4 m/s</td></tr>
<tr><td>View Range</td><td>7.5 m</td></tr>
<tr><td>View Type</td><td>Omni </td></tr>
</table><br><table border=0 width=280>
<tr><td>The Mechanic is a jack of all trades, able to repair fellow vehicles, destroy enemy mines, and even shortcircuit retreating foes. This chassis is naturally repairable.</td></tr>
</table><br><table border=0 width=280>
<tr><td>Engines</td><td><a href="http://www.sgalaxy.com/manual_oml/I-G1001.txt">view list</a></td></tr>
<tr><td>Storage</td><td><a href="http://www.sgalaxy.com/manual_oml/I-G2001.txt">view list</a></td></tr>
<tr><td>Computers</td><td><a href="http://www.sgalaxy.com/manual_oml/I-G3001.txt">view list</a></td></tr>
<tr><td>Weapons</td><td><a href="http://www.sgalaxy.com/manual_oml/I-G4005.txt">view list</a></td></tr>
<tr><td>Armors</td><td><a href="http://www.sgalaxy.com/manual_oml/I-G5001.txt">view list</a></td></tr>
<tr><td>Bonus</td><td><a href="http://www.sgalaxy.com/manual_oml/I-G6001.txt">view list</a></td></tr>
<tr><td>Misc</td><td><a href="http://www.sgalaxy.com/manual_oml/I-G7000.txt">view list</a></td></tr>
<tr><td>Specials</td><td><a href="http://www.sgalaxy.com/manual_oml/I-G8005.txt">view list</a></td></tr>
</table>
For example, I would want to be able to set the variable "influence" to be equal to 25, or whatever it would be later (the stats are changed often).
I have never come close to attempting something like this, is there anything you can point me at?
View Replies !
View Related
Button Going To Html File, Want Html To Be Specific Size In Window
When I click on a button in my flash project, it takes the user to a html file. In that file the user can click on different .pdf files. I would like to make the html file a certain sized window example 300x400. I do not know what code (or where to put it in the html file) to use to make the window constrain to 300x400. Also, I would like the users computer to open acrobat reader in a seperate window, when they click on a .pdf link. Right now, it just opens in the original html file so the user has to hit the back button to get back to the original html file. If anyone can help I'd appreciate it muchly!
Stittch
View Replies !
View Related
FMX - How To Ignore Html Tags When Parsing Xml Document
Hello!
I am having trouble parsing an xml document because the nodes contain text that has html tags. When I parse it in flash, it considers that the html tags are new nodes. How do you avoid this?
Everything loads into a variable: mainNode=xml document. And then it's parsed.
Some nodes look something like:
<property><description>my name is <b>boris</b> and I like flash</description></property>
The problem is that any text in html tags (<i>,<b>,<u>,etc) is broken into a different node.
Any help welcome.
View Replies !
View Related
FMX - How To Ignore Html Tags When Parsing Xml Document
Hello!
I am having trouble parsing an xml document because the nodes contain text that has html tags. When I parse it in flash, it considers that the html tags are new nodes. How do you avoid this?
Everything loads into a variable: mainNode=xml document. And then it's parsed.
Some nodes look something like:
<property><description>my name is <b>boris</b> and I like flash</description></property>
The problem is that any text in html tags (<i>,<b>,<u>,etc) is broken into a different node.
Any help welcome.
View Replies !
View Related
|