View Full Version : LoadVars Separator Question
Random Hero
May 12th, 2004, 11:30 PM
I would like to use a different symbol other than the "&" operator to seperate my variables in my loadVars...how do I go about doing this?
Random Hero
May 13th, 2004, 04:40 PM
Still need assistance on this issue, was thinking of converting the mass to XML if I can't find a resolution, but REALLY want to try to avoid this...is anybody interested/need more info from me to help?
kode
May 14th, 2004, 10:53 PM
Do you want to send or receive the variables? And what's the format you want to use to send/receive them? :)
Voetsjoeba
May 15th, 2004, 12:49 AM
Still need assistance on this issue, was thinking of converting the mass to XML if I can't find a resolution, but REALLY want to try to avoid this...is anybody interested/need more info from me to help?
Why would you want to avoid it ? Once you get to know it, it's great to work with. It's so much more structured than a big line of loadVars data. It's easy to change as well, not quite like the loadVars line where you could spend more time searching the data than replacing it. Anyway. If you're interested, here's a very good tutorial on how to use XML with Flash: http://www.actionscript.org/tutorials/intermediate/XML/index.shtml
ehman
May 15th, 2004, 05:37 AM
i tend to use loadvars for simpler data rather than loadxml because it seems to process faster than xml.
Random hero you can use another seperator and then use the split function in flash (or if you sending variables, the split function in php) to break it into an array after load the variable into flash if you want.
i.e.
have php echo something like
echo "flashresources=kirupa- The shocked flash resource ||flashkit - A flash developers resouce||werehere- Intelligent design and development||ultrashock";
echo "&urls=h"
and in flash load the two variables and use
something like
resource_array =flashresources.split("||") ;
to breakit into an array.
Random Hero
May 15th, 2004, 04:15 PM
Funny you should mention it...
var format = new TextField.StyleSheet();
var path = "styles.css";
format.load(path);
format.onLoad = function(success) {
if (success) {
swapper.output1.styleSheet = format;
swapper.output2.styleSheet = format;
lv = new LoadVars();
lv.onData = function(raw) {
var arr = raw.split("|");
pages = {};
for (i in arr) {
pages["page"+(i)] = arr[i];
}
}
lv.load("MnSect.htm");
}
};
Next Frame:
swapper.output1.text = pages.page0;
swapper.output2.text = pages.page1;
stop();
:) all done. Just to anyone reading, make SURE the external text file is straight HTML (don't /" the ") or it'll blow up. Hard, scary lesson learned today.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.