msg1 {
max0matic[+],
posted: 06.28.03 7a•07.08.03 11a,
top [^]
}
/*
I just started to work on a "real" integration of XMLSA into XML
so stay tuned...
XMLSA 2.0 is coming...
*/
msg2 {
hemoglobina[+],
posted: 07.08.03 10a•-,
top [^]
}
Hello maxomatic! First of all thanks a lot for this great prototype! A real work saver. Hoping to see ver. 2.0 kicking and alive :)
I suppose there are a few lines missing from the "usage" section above, probably regarding the search function. Well, could you please complement the info that is missing? I would love to see how the search works!
Thanks a lot for your help,
HEMOglobina (BraziL)
msg3 {
max0matic[+],
posted: 07.08.03 11a•-,
top [^]
}
I added the Usage-Example into the first comment below the code.. as it wouldn't fit into
the "normal" usage box...
regards Max
msg4 {
biffario[+],
posted: 07.31.03 10a•07.31.03 10a,
top [^]
}
hi max - just to let you know i've finished www.moretons.co.uk - which has a fully integrated WYSIWYG CMS. Many thanks ;) and catch up with you soon .
PS!!! = can you do an example of using the loader with a session attribute? sounds interesting :)
Biffer.
www.ifdnrg.com
msg5 {
max0matic[+],
posted: 08.01.03 8a•-,
top [^]
}
Very nice site...
I like it.. nice design and nice RIA...
Good Work!
msg6 {
max0matic[+],
posted: 08.01.03 8a•08.01.03 8a,
top [^]
}
To your question about Session handling:
the answer is hidden in the code as a comment
// use the attribute 'session' in the root tag to
// submit a sessionID if you transmit the word
// 'timeout' or 'end' the session gets deleted
This feature just makes sense if you load your XML via
a PHP Scrip that gets the XML via a DB or some other
source.
So the idear behind this is to add a "seesion" attribute to the root
Tag of the first loaded XML file.
<root session="1234567890">
<somedata/>
</root>
now every next call via XMLSA.sendAndLoad , XMLSA.load and XMLSA.send
the session ID will be avaible at Serverside in the $_GET['session'] (<--PHP)
this is because XMLSA transmites it as a addition to the called URL...
So the way I use it is to check if $_GET['session'] is set and do something then:
if (isset($_GET['session')){
// restore the session data via the session ID
// see PHP.net/manual
} else {
// start a session and get the session ID
// add it to the root tag of the returned XML-Data
// in the sesson attribute
}
hope this helps...
PS: there is also a _global.onSessionStart and a _global.onSessionEnd
callback that gets executed ... so if you want the interface to do anything on these events assign a function here...
msg7 {
biffario[+],
posted: 08.15.03 3a•-,
top [^]
}
yup - thanks Max :) Makes perfect sense. It will def come in handy in my next project :)
Cheers,
Biffer
www.ifdnrg.com
msg8 {
dark sylkro[+],
posted: 09.04.03 12p•-,
top [^]
}
Add this code to the function and you'll be able to use it with the LoadQue Class.
As long as there are a load(), getBytesLoaded() and getBytesTotal() function in any class,
the loadQue should work ...
right?
msg9 {
biffario[+],
posted: 09.08.03 2p•09.08.03 3p,
top [^]
}
Im having real problems maintaining CDATA tags in xml. I am trying to collect data from an html textField as html, which i can do, then to re-apply CDATA tags to either side of the value, then set that using setValue :
Now why wont that set the value when i wrap CDATA tags round it. Arhg! ;)
Nop, it's not possible to use <![CDATA[]]> tag in flash mx.
Whate I did. I made a tag called <cdata> sned it to php and use some regex to change all tags called <cdata> to <![CDATA[ and all </cdata> to ]> and this works for me.
Ps. send all data as UTF8
msg12 {
davidjgc[+],
posted: 09.30.03 10a•-,
top [^]
}
Hi max0matic!, its really cool this class!..
i have a dude.. what u recommend to integrate a preloading of large xml with this class? ( im trying of use the preloading class of bokel - http://www.helpqlodhelp.com/blog/ - but maybe i dont use of best way ) :)
thnx so much in advanced
Dj - Mexico
msg13 {
biffario[+],
posted: 10.18.03 8a•-,
top [^]
}
msg14 {
fetdirect[+],
posted: 10.19.03 11a•-,
top [^]
}
are you able to add images?
msg15 {
biffario[+],
posted: 10.27.03 11a•-,
top [^]
}
yup i add images by FTP using a little app i built using Flash & Flash Studio Pro from MDM.
Hey MAX! - i think there is a bug in the reParse section
Shouldnt the second parameter of the _parse call be this instead of this.$parent ? I noticed it because i was having problems, then changed that & it worked ;)
Am i right in saying that? Or is it just working for me in this case?
msg16 {
biffario[+],
posted: 11.12.03 5p•-,
top [^]
}
Hi Max, hope all is good. Would you find it massively difficult to convert this to a Flash 7 compatible class?
msg17 {
HotTaco[+],
posted: 11.21.03 11a•-,
top [^]
}
For some reason I am unable to control a MC (using the imported xml data designating a frame for example) with this example. I loaded a MC to _level1 but still couldn't tell it to go to a specific frame. I can control the MC properties however. Odd, huh?
Other than this problem the XMLSA prototype is TOO FANTASTIC for words. Thank you maxomatic and alinear!!!
msg18 {
max0matic[+],
posted: 11.21.03 11a•-,
top [^]
}
Be sure to alway check the type of the data and to convert it!
this has to be done by default in ActionScript 2.
And a Flash7 version will have to wait as I don't own it buy now.
But as soon as I got some cashflow.. to buy it..
I will be on the task.
msg19 {
HotTaco[+],
posted: 11.21.03 11a•-,
top [^]
}
Thanks Max. I figured it out but by the time I came back to delete my (ridiculous) question you had already posted a response. =] My problem was as simple as not having a unique name for my MC. I had it named the same as my XML root variable.
<dork>
But thanks for the quick response!!
msg20 {
biffario[+],
posted: 02.11.04 2p•02.15.04 4a,
top [^]
}
Ok here is the AS2.0 Class - Couldn't get the code tags to work properly so have placed it here:
msg21 {
max0matic[+],
posted: 02.13.04 1p•-,
top [^]
}
Hey.. nice work.. but maybe you shoulod repost it it seams to be cut of.. at the end..
I still cant check if its valid and runnig... as I still don't own MX2004.
regards
Max Ziebell
msg22 {
biffario[+],
posted: 02.19.04 4a•02.21.04 1a,
top [^]
}
Ok I have fixed onLoad aswell. :) Enjoy - (replaced link above)
msg23 {
Maxkuri[+],
posted: 03.20.04 11a•-,
top [^]
}
Hi Maxomatic! Your proto works fine, really fine...It's very useful...but I have a question...
How can I make a preloader method for your prototype?...I want to have show the preload status...
Can you help me? Thanks in advance...
msg24 {
achraf[+],
posted: 07.16.04 5a•-,
top [^]
}
i use this class to laod rssxml file and i have some problems with <dc:date> tag ????
how can i read the content of this tag ?
thanks.
msg25 {
davidwesten[+],
posted: 08.09.04 7p•-,
top [^]
}
Max...great class--thanks. One question: I need to POST some variables to a script, but I can't get sendAndLoad() to work. Is this method working? Do you have an example of usage?? Many thanks in advance! -David
msg26 {
valerian[+],
posted: 09.09.04 6a•09.09.04 6a,
top [^]
}
Hi,
Thank you for the class,
I've made one correction to the _maheURL method to prevent problems when parameters are passed in the url.
Now it search for a question mark and if one is found the nocahe var is corrected.
msg27 {
orangechicken[+],
posted: 09.30.04 11a•-,
top [^]
}
Hmm... it seems that I can assign parts of an XMLSA object to variables.
For example:
var myInfo = new XMLSA( "imagine this is valid xml" );
var partOfInfo = myInfo.shouldBeAnArray; // but unfortunately is assigned
if( partOfInfo != undefined ) do something; // unfortunately, because of the assignment above this is undefined
The problem is the getValue() method. Why does it return undefined if it's not a text field (instead of returning the tree at that point)?
-chicken
msg28 {
orangechicken[+],
posted: 09.30.04 8p•-,
top [^]
}
I'm stuck... for some reason. Does this work for you guys?
var myXMLSA = new XMLSA( '<the_node an_attribute="106" ><a_node>something</a_node></the_node>' );
var myXML = new XML( myXMLSA.$xml );
msg29 {
orangechicken[+],
posted: 09.30.04 8p•-,
top [^]
}
Ahh... figured it out... apparently you can't just pass in a string of XML but an actual XML object.
So, in my failing example above, just change the first line to:
var myXMLSA = new XMLSA( new XML( '<the_node an_attribute="106"><a_node>something</a_node></the_node>' ) );
... and *POOF* it works.
msg30 {
inntheory[+],
posted: 12.13.04 2p•-,
top [^]
}
I have noticed that using XMSLA it doesn't allow for node names to have hyphens.
Is there any way to work around this?
msg31 {
max0matic[+],
posted: 12.14.04 3a•-,
top [^]
}
You can use anything supported by XML but not every char is supported by the dott-Syntax in AS
to still use them uses the evaluation brakets of AS:
rootnode["some-node-with-hyphens"].getValue();
regards
Max
Also look at my littler proto makeXMLSA working only oneway...
msg32 {
inntheory[+],
posted: 12.14.04 10a•-,
top [^]
}
Yeah thanks, I just had a friend tell me the same thing.
Wonderfull! Can you please update this code for actionscript 2.0 Macromedia FlashMX 2004 ver 7.2.
XMLSA.prototype._online = function() {
// are we online?
return (_root._url.subStr(0,7) == "http://");
}
this method fails
thanks,
Yuri
msg34 {
Panda[+],
posted: 02.07.05 5p•-,
top [^]
}
I would like to add preloading progress bar while static XML file is loading into Flash.
My first idea was to use myXML.getBytesLoaded() and myXML.getBytesTotal() methods, but it in my mind XMLSA prototype does not support those two methods.
Am I right here?
I can use workarounds, starting from storing XML data inside TextField that is buried inside SWF file, but If I am empowered, then I would like to use plain old check for getBytesLoaded() for loading of external XML via XMLSA prototype.
msg35 {
paulvortex[+],
posted: 03.18.05 3a•-,
top [^]
}
This is great.
Nice work!
I have been learning how to use this a bit... and I have worked out how to edit and move stuff around with it... Now how do I save the changes to my original *.xml file?
Would I have to use a seperate script? And how to I send the edited XML data out to that script?
-Paul
msg36 {
RomantorV[+],
posted: 03.26.05 1a•-,
top [^]
}
Sori! But I can't run this scripts on Flash MX 2004 even Flash MX.
in Flash MX it show:
E:\quangvinh\anthaibinh\web\XMLSA.as: Line 1: ';' expected
/*---------------------------------------------------------------------------
and any line, it also warning this.
I don't know how! Please help me!
msg37 {
rotaerc[+],
posted: 04.20.05 6p•-,
top [^]
}
is there a as2 version for this?
this only works in as1. :(
msg38 {
ifeelfree[+],
posted: 04.20.05 8p•-,
top [^]
}
Hi,
Seems there is alot of people trying to get a preloader for XMLSA..
I made a referende to the loader called XMLSAloader on the _root..
[code]
XMLSA.prototype.load = function() {
var loader = this._makeLoader(this);
arguments[0] = this._makeURL(arguments[0]);
_root.loadMsg_txt.text = "Loading class data: ";
loader.load.apply(loader, arguments);
_root.XMLSAloader = loader;
};
[code]
You can then use _rootXMLSAloader.getBytesLoaded() etc.. nit sure if this is the wrogn way to do it but works for me... I
msg39 {
ifeelfree[+],
posted: 04.20.05 10p•-,
top [^]
}
> Just to add to my last comment..
it is probably best to delete the _root.XMLSAloader var onLoad..
msg40 {
rdaneel[+],
posted: 10.06.05 5a•-,
top [^]
}
HI, did someone write the AS2 class version of this already? seems like the obvious thing todo.
or can i find it on class.layer51.com ?:)
msg41 {
max0matic[+],
posted: 10.06.05 10a•-,
top [^]
}
Biffario wrote a AS 2 version... see further up...
msg42 {
ssdesign[+],
posted: 10.29.05 11a•-,
top [^]
}
hi YULI,
the sbStr fails if you are using MX2004
This is a case sensitivity issue.
in MX2004 "subStr" is now "substr" instead
msg43 {
kalel[+],
posted: 02.02.06 9p•-,
top [^]
}
can somone post a workinglink or just paste the working XMLSA class for as 2.0
thanks
msg44 {
inntheory[+],
posted: 02.03.06 4a•-,
top [^]
}
msg45 {
kalel[+],
posted: 02.06.06 1a•-,
top [^]
}
thank yuo so much for that post inntheory, bu I am no tto suere how to load the class.
I thought just putting it in the same dir as the flash file then using #include "xmlsa.as" on frame 1.
i got an error saying it needs to be in com.t1o1
so I made the fodlers com then 101.
but I cant include it... exactly how do I use the class and where can I change that dir in the class file?
thanks again
msg46 {
inntheory[+],
posted: 02.07.06 6a•-,
top [^]
}
In pulish settings in the flash tab there is a settings button next to the Actionscript version, click that and make sure the root dir you are specifying the other folders in the class is set there. I am pretty sure that is your problem.
msg47 {
kalel[+],
posted: 02.08.06 1p•02.08.06 1p,
top [^]
}
yes I have done that ponited the class file dir in publish settings............ and after ponting do I need to use #include "xmlsa.as" on teh first frame?
**Error** M:\Bangalbino\development\flash\xmlsa.as: Line 31: Classes may only be defined in external ActionScript 2.0 class scripts.
dynamic class com.t101.XMLSA
**Error** M:\Bangalbino\development\flash\xmlsa.as: Line 32: The class 'com.t101.XMLSA' needs to be defined in a file whose relative path is 'com\t101\XMLSA.as'.
{
msg48 {
inntheory[+],
posted: 02.08.06 7p•-,
top [^]
}
use this on the first frame in the actions
import com.t101.XMLSA;
msg49 {
kalel[+],
posted: 02.11.06 2p•-,
top [^]
}
dude I get nothing but errors.
exactly what do I do from start to begining just to install this class and import it.
msg50 {
inntheory[+],
posted: 02.12.06 11a•-,
top [^]
}
Have you ever used a class in Flash?
Maybe you should try to look at some of the original examples from this thread on implimentation of one and then perhaps it will become more clear. If that doesn't work I will try but currenlt I don't hve the time to stop and write that outmaybe later this week.
I was trying out a tutorial by flashMagazine site on XMLSA - I am getting this error.
I am using Flash 8 Pro
----------------
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 39: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.load= function(){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 46: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.send= function(){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 56: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.toString= function(){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 61: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.sendAndLoad= function(host, target, method){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 67: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.search = function(criteria, recursive){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 76: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.getXML= function(){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 81: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.getValue= function(){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 86: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.setValue= function( text ){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 103: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.getNodeName= function(){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 108: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.appendChild= function(element){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 117: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.cloneNode= function(rekursiv){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 123: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.appendElement= function(name,value,attribs){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 141: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.removeChildByIndex= function(name,idx){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 147: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.removeNode= function(){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 153: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype.insertBefore= function(node){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 163: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype._parse= function(node, parent){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 191: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype._reParse= function(){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 197: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype._cleanup= function(){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 205: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype._makeURL= function( host ){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 218: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype._online = function() {
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 224: ActionScript 2.0 class scripts may only define class or interface constructs.
XMLSA.prototype._makeLoader= function(target){
**Error** C:\Documents and Settings\Administrator\Desktop\testing\xmlsa_tut\XMLSA.as: Line 264: Action
msg52 {
rvdijk[+],
posted: 06.06.06 3a•-,
top [^]
}
Hi,
I have a question: I use the above code to make an RSS Reader in Flash Professional 8.
This works like a charm when i watch the movie in flash (ctrl + enter) but when I publish the website and watch it outside flash for example in the flash player/ internet explorer/ Mozilla Firefox. It doesn't work. In Firefox it says he's waiting for a reply from the RSS feeder but the RSS-feeder is online so that can't be it :S.
Does anybody know the answer to this??? Or have the same problem??
Thanks
msg53 {
rvdijk[+],
posted: 06.06.06 3a•-,
top [^]
}
Nevermind,
i solved the problem. Apperently you can't load data from a diffrent server than from the server you are working from.
msg54 {
dabears[+],
posted: 09.13.06 10a•-,
top [^]
}
Hi, wondering if anyone can shed some light on this. I'm trying to count
how many occurrances of the following the nfl-score node and it either
returns a zero or a "NaN".
Anyone know how to handle this. I'm using flash Pro ver. 8.0
Original code was:
rssCount = newsNode.item.length;
My failed attempt:
rssCount = newsNode.["sports-scores/nfl-scores/nfl-score"].length;
Original line worked because in the exapmle all nodes are at level 0 and
my rss is heavily nested. I've included a snippet of what I'm dealing with to
create a sports ticker for our website. Any help would be greatly appreciated.
msg55 {
kirtimaan[+],
posted: 09.29.06 5p•-,
top [^]
}
Hi,
I am try to parse a iTune RSS feed with flash. I have successfully parsed the basic RSS feed using flash. (http://www.flashmagazine.com/967.htm) here is the tutorial link which I followed.
In iTunes RSS feed, there are some element which names like :
<itunes:image href='http://www.google.co.in/images/hp0.gif' />
<itunes:subtitle>This is my subtitle</itunes:subtitle>
Now, whenever I try to read such tags, flash returns undefined.
// First, you will need to download (or copy) the latest version of XMLSA
// into an .as file. You can find it at: http://proto.layer51.com/d.aspx?f=957 #include "XMLSA.as"
// Setup text fields
body.autoSize = "right";
head.autoSize = "right";
//body.text = "Loading news stories";
// URL if the user clicks before data is loaded
rssURL = "http://www.initsoft.com/files/podcasts/";
// Load the XML/RSS
news = new XMLSA();
// Load the RSS file
news.load("http://www.initsoft.com/files/podcasts/OnlineMarketing101.xml");
news.onLoad = function(success){
if (success) {
// Check RSS version and make shorthand
if(news.channel[0].item){
// Where to find data items for RSS 0.91
newsNode = news.channel[0];
} else {
// Where to find data items for RSS 1.0 and 2.0
newsNode = news;
}
// Store the number of news items
rssCount = newsNode.item.length;
// Call the showNext function every 5 seconds
//setInterval(showNext,5000);
showNext();
} else {
// Show error message
body.text = "Error loading XML";
}
}
// Function for getting next entry
showNext = function(){
// Zero the counter if the last article has been shown
if(rssCounter == rssCount || rssCounter == undefined){ rssCounter = 0; }
// Get values from XMLSA array
head.text = newsNode.item[rssCounter].title.getValue();
body.htmlText = newsNode.item[rssCounter].description.getValue();
link.htmlText = newsNode.item[rssCounter].link.getValue();
// body.htmlText = newsNode.dumpHTML(); //used this and this is parsing the itunes:image tag
logopat.htmlText = newsNode.item[rssCounter].itunes:image.attributes.href; //returns undefined.
rssURL = newsNode.item[rssCounter].link.getValue();
// Position the body text below the heading
body._y = head._y + head._height;
// Increment the counter
rssCounter++;
}
Hi All,
I'm trying to use the XMLSA class to send and receive xml data to and from a server. I will also need to change some of the object's attributes before it's send to the server. The server then returns an XML based on what is sent.
I've tried using myXMLSA = new XMLSA(new XML("a valid XML string")) and myXMLSA = new XMLSA("a valid XML string"). In both cases, if I trace(myXMLSA.getXML()) I get back the XML string but if I trace(myXMLSA.nodeName.attributes.attributeName) I get undefined.
Does anyone have any examples/code of sending XML data with the XMLSA class?
I have loaded a static XML file of what the server will send back and tried trace(myXMLSA.nodeName.attributes.attributeName). It works a treat.
TIA,
Dee
msg58 {
MongFish[+],
posted: 04.24.08 4a•-,
top [^]
}
Can you please implement Valerian's change (msg 26) on any future versions. This is a serious bug!