Re: [Flashcoders] AS3 for each loop / splice issue

2008-08-28 Thread Kenneth Kawamoto

If you post your XML as well that'll help, but this:

cue_points[cue].splice(1,1,cueIn);

...looks dodgy to me. cue needs to be an uint for this to work but 
it's an XML, also you set cueIn = cue ???


Kenneth Kawamoto
http://www.materiaprima.co.uk/

noentourage wrote:

Hey flashcoders...
I'm parsing an xml doc and building an array then later trying to stuff a
value in to each object
in the array at the second part of each object.
[code]
//at the top of my class I have the variable for the cue_points array

// create array with text prompts and a dummy value

for each (var prmpt:XML in xmlData.prompt) {
//this works fine
cue_points.push([prmpt.text,2]);
}

// now add cue points to the previously created array

for each (var cue:XML in xmlData..step.training.cuein){
var cueIn = cue;
//following line returns the correct values from the xml nodes
trace(cueIn -- +cueIn);
//the following line does not splice in the cueIn value to the
previously created
// array.
cue_points[cue].splice(1,1,cueIn);
}

[/code]

I'm trying to first push the text prompts into the array and build it with
to values in the one object so that
I can later come in and splice in new values to go along with the prompt
text.

I've tried to trace this out and can't seem to find the issue and can't find
anyone else that has done this.
So since it's new AS3 code I figured that maybe someone would have a tip.

Thanks!

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AS3 for each loop / splice issue - RESOLVED

2008-08-28 Thread Gerry
I fixed it myself...I was staring at the code too long so after a long  
break I came up with this to be able to get through the cue_points  
array...

//
var count:Number = 0;
for each (var cue:XML in xmlData..step.training.cuein){
//
trace(cue -- +cue+ count: +count);
//
cue_points[count].splice(1,1,cue);
count++;
}

It works for my situation.

Thanks.

On Aug 28, 2008, at 5:28 AM, Kenneth Kawamoto wrote:


If you post your XML as well that'll help, but this:

cue_points[cue].splice(1,1,cueIn);

...looks dodgy to me. cue needs to be an uint for this to work but  
it's an XML, also you set cueIn = cue ???


Kenneth Kawamoto
http://www.materiaprima.co.uk/

noentourage wrote:

Hey flashcoders...
I'm parsing an xml doc and building an array then later trying to  
stuff a

value in to each object
in the array at the second part of each object.
[code]
//at the top of my class I have the variable for the cue_points array
// create array with text prompts and a dummy value
  for each (var prmpt:XML in xmlData.prompt) {
  //this works fine
  cue_points.push([prmpt.text,2]);
  }
// now add cue points to the previously created array
  for each (var cue:XML in xmlData..step.training.cuein){
  var cueIn = cue;
  //following line returns the correct values from the xml nodes
  trace(cueIn -- +cueIn);
  //the following line does not splice in the cueIn value to  
the

previously created
  // array.
  cue_points[cue].splice(1,1,cueIn);
  }
[/code]
I'm trying to first push the text prompts into the array and build  
it with

to values in the one object so that
I can later come in and splice in new values to go along with the  
prompt

text.
I've tried to trace this out and can't seem to find the issue and  
can't find

anyone else that has done this.
So since it's new AS3 code I figured that maybe someone would have  
a tip.

Thanks!

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] [Flashcoders tweening glowfilter from inner to outer

2008-08-28 Thread allandt bik-elliott (thefieldcomic.com)
can you input negative values into one or the other?

On Wed, Aug 27, 2008 at 9:06 PM, Hans Wichman 
[EMAIL PROTECTED] wrote:

 Hi,

 I don't think tweening from inner to outer is possible, unless you use
 multiple glow filters.

 greetz
 JC

 On Wed, Aug 27, 2008 at 9:43 PM, eric e. dolecki [EMAIL PROTECTED]
 wrote:
  Can tweenfilterlite tween from inner to outer glows elegantly? The server
  isn't responding for me to check myself without setting up test code.
 Might
  do anyway.
  Eric
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] XML and best method

2008-08-28 Thread Lehr, Theodore M (N-SGIS)
I have a project that involves xml... I am wondering how I should
organize my xml... would it be best (from a flash perspective) for it to
be on huge xml file with lots and lots of children - or would I be
better off breaking it into multiple xml files where one xml tag
references another xml file and so on...

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] [Flashcoders tweening glowfilter from inner to outer

2008-08-28 Thread eric e. dolecki
Here is my post about it:
http://www.ericd.net/2008/08/tweening-from-inner-to-outer-glow.html

TweenMax to the rescue.

On Thu, Aug 28, 2008 at 8:21 AM, allandt bik-elliott (thefieldcomic.com) 
[EMAIL PROTECTED] wrote:

 can you input negative values into one or the other?

 On Wed, Aug 27, 2008 at 9:06 PM, Hans Wichman 
 [EMAIL PROTECTED] wrote:

  Hi,
 
  I don't think tweening from inner to outer is possible, unless you use
  multiple glow filters.
 
  greetz
  JC
 
  On Wed, Aug 27, 2008 at 9:43 PM, eric e. dolecki [EMAIL PROTECTED]
  wrote:
   Can tweenfilterlite tween from inner to outer glows elegantly? The
 server
   isn't responding for me to check myself without setting up test code.
  Might
   do anyway.
   Eric
   ___
   Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] XML and best method

2008-08-28 Thread Merrill, Jason
I think it depends on how much data there would be in one big file, and
how complex it would be loading in separate other files - how big each
of those would be. 

I would try and keep it all in one file if possible, but if it's a huge
amount of data, I would separate them and load them one at a time - you
could build a cool loader animation for them.  

Also, consider the content of the XML - if it's all related, makes sense
to have them in the same file, but if the XML server totally different
purposes, I think it can make sense to make the files separate.  For
example:

settings.xml --- application settings
media.xml  --application content
services.xml  --application web services

But then those are OK to all put in the same file too so it's both
an architecture performance question, and also a style question.  

Be careful of creating references in one XML to another, that can get
messy and buggy unless you do it right - doesn't mean it's bad, it just
depends on how you implement it.

Jason Merrill 
Bank of America 
Enterprise Technology  Global Risk LLD 
Instructional Technology  Media

Join the Bank of America Flash Platform Developer Community 

Are you a Bank of America associate interested in innovative learning
ideas and technologies?
Check out our internal  Innovative Learning Blog  subscribe. 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] XML and best method

2008-08-28 Thread Matt S.
Speaking from recent experience, lots of little XML files is ok if
you're accessing them one at a time, but if you need to pull up more
than one at a time, it can get slow quick. I had a project where I had
to load 5-10 small xmls (really small, just basic image galleries, 10
items max each), and it seemed like the initial process of loading the
XML files (load one, increment xml ID, load the next, etc) was the
lions share of the load time, so that when it was 10 xmls at once it
started to take annoyingly long (especially since that was then
followed by the actual images needing to be loaded). In the end we
compiled all the xmls into one big XML and loaded that up front. But
on other projects, when I was just loading single small xml files one
at a time, it wasnt a problem.

I would be curious though, my impression from that experience was that
alot of the load time on an XML file comes from that initial loading
of the file, not so much the stepping through the XML, is that
accurate? And is there any difference in load time between this:

image
   pathimageurl/path
   nameimagename.jpg/name
   width800/width
   height600/height
/image

vs this:

image path=imageurl name=imagename.jpg width=800 height=600 /

.m

On Thu, Aug 28, 2008 at 9:35 AM, Lehr, Theodore M (N-SGIS)
[EMAIL PROTECTED] wrote:
 I have a project that involves xml... I am wondering how I should
 organize my xml... would it be best (from a flash perspective) for it to
 be on huge xml file with lots and lots of children - or would I be
 better off breaking it into multiple xml files where one xml tag
 references another xml file and so on...

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] XML and best method

2008-08-28 Thread allandt bik-elliott (thefieldcomic.com)
yes the second one is shorter :)

i try to keep child nodes to a minimum - 1 per 'object' and only really use
them when describing one of several same-level objects

On Thu, Aug 28, 2008 at 2:58 PM, Matt S. [EMAIL PROTECTED] wrote:

 Speaking from recent experience, lots of little XML files is ok if
 you're accessing them one at a time, but if you need to pull up more
 than one at a time, it can get slow quick. I had a project where I had
 to load 5-10 small xmls (really small, just basic image galleries, 10
 items max each), and it seemed like the initial process of loading the
 XML files (load one, increment xml ID, load the next, etc) was the
 lions share of the load time, so that when it was 10 xmls at once it
 started to take annoyingly long (especially since that was then
 followed by the actual images needing to be loaded). In the end we
 compiled all the xmls into one big XML and loaded that up front. But
 on other projects, when I was just loading single small xml files one
 at a time, it wasnt a problem.

 I would be curious though, my impression from that experience was that
 alot of the load time on an XML file comes from that initial loading
 of the file, not so much the stepping through the XML, is that
 accurate? And is there any difference in load time between this:

 image
   pathimageurl/path
   nameimagename.jpg/name
   width800/width
   height600/height
 /image

 vs this:

 image path=imageurl name=imagename.jpg width=800 height=600 /

 .m

 On Thu, Aug 28, 2008 at 9:35 AM, Lehr, Theodore M (N-SGIS)
 [EMAIL PROTECTED] wrote:
  I have a project that involves xml... I am wondering how I should
  organize my xml... would it be best (from a flash perspective) for it to
  be on huge xml file with lots and lots of children - or would I be
  better off breaking it into multiple xml files where one xml tag
  references another xml file and so on...
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] XML and best method

2008-08-28 Thread alpha
 I have a project that involves xml... I am wondering how I should
 organize my xml... would it be best (from a flash perspective) for it to
 be on huge xml file with lots and lots of children - or would I be
 better off breaking it into multiple xml files where one xml tag
 references another xml file and so on...

There is no hard and fast answer. My personal preference is to have fewer
XML files--one is ideal, because then you only have one to download. And
XML files are just text, so it typically takes less time than a single
audio file. If you're using AS3, you can use the XML and XMLList classes
to break the file into manageable chunks. It's very fast.

It depends on how big the file is, though. If it's really huge and
complex, it can be cumbersome to maintain, and difficult for the next
programmer to grok.

It's your call ^_^

Cordially,

Kerry Thompson

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] AMF objects storing in database

2008-08-28 Thread Jiri Heitlager
I came across a post on storing custom classes as an AMF object. It 
explains how to do the following.


If you ever need to store the state of a custom object in a ByteArray 
or SharedObject, or send a custom object through a LocalConnection, 
there are a few simple steps you can take that will allow your object's 
state to be serialised (converted to AMF) and preserved for future 
restoration.


src: http://www.si-robertson.com/go/serialise-custom-classes


I wanted to know, can I then just send the AMF object to a server and 
store it as a binary in a mysql database? And also is this adviceable?


Thank you,

Jiri

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Re: saving local (XML) files, two projectors talkin'

2008-08-28 Thread sebastian
ok well I haven't found any solutions for writing XML files to disk... 
how weird is that???


I've decided to go ahead and reprogram the whole XML reader so that it 
reads in SharedObjects instead... as I need to finish this project by 
Friday.


It took a little while to figure out I had to use localPath to share 
between SWFs and AMF0 encoding to share between AS3 and AS2, but I am on 
my way to success... quite the hassle, lost hours, but I think this is 
the only way?


Thanks,

Sebastian.

sebastian wrote:

Hello,

Been searching for answers and I was wondering what options there was 
for saving local XML files; as this seems to be a stickler... (?)


I have two flash files; the two flash applications will run on different 
screens connected to the same computer.


One of them is an already built application that I don't want to edit 
very much, cause it's an ugly monster. Previously it loaded XML files 
from a web-server [which collected SMS/text entries from users], but now 
it needs to read the XML file from the local disk where it is running 
and there is NO internet access anymore. As it reads items from the XML 
it needs to delete the entries. It's display is actually a very large 
projector/LCD mounted on a wall for everyone to see.


The other application, which is connected to a touchscreen interface 
[replacing the need for a user's mobile/cell phone], needs to generate 
lines that feed into the same XML file the beast is reading, so that it 
can generate a sort of queue for it to run through.


The original beast is in AS2 and messy [read: painful to edit any code], 
the new touch screen is clean and in AS3. It's running on all on local 
Window computers as a pair of dual full-screen projectors [.exe files], 
no PHP facilities or local DB I'm afraid.


My question is:

* is there anyway at all to have these two applications read and 
write/delete entries from the XML files?


* If not, what workarounds do I have at my disposal? Can I read/write to 
a text file (*.txt) instead?


* I know shared objects exist, am I forced to use this in this situation?

* finally, is there any 'smart' way to lock a file or have one of the 
flash files prevent the other from writing/reading to the same file at 
the same time? I don't know if this is an issue, but I could foresee 
file corruption if both flash files try and write to a file at the same 
instant.


Thanks for your insight!!

With kind,

Sebastian.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] XML and best method

2008-08-28 Thread Matt S.
Thanks. Do you know if the difference is dramatic?  Just curious,
especially since most experts eg Moock's books dont shy away from
node-heavy XML generally, but if there are serious performance
considerations you'd think they would.

.m

On Thu, Aug 28, 2008 at 10:27 AM, allandt bik-elliott
(thefieldcomic.com) [EMAIL PROTECTED] wrote:
 yes the second one is shorter :)

 i try to keep child nodes to a minimum - 1 per 'object' and only really use
 them when describing one of several same-level objects

 On Thu, Aug 28, 2008 at 2:58 PM, Matt S. [EMAIL PROTECTED] wrote:

 Speaking from recent experience, lots of little XML files is ok if
 you're accessing them one at a time, but if you need to pull up more
 than one at a time, it can get slow quick. I had a project where I had
 to load 5-10 small xmls (really small, just basic image galleries, 10
 items max each), and it seemed like the initial process of loading the
 XML files (load one, increment xml ID, load the next, etc) was the
 lions share of the load time, so that when it was 10 xmls at once it
 started to take annoyingly long (especially since that was then
 followed by the actual images needing to be loaded). In the end we
 compiled all the xmls into one big XML and loaded that up front. But
 on other projects, when I was just loading single small xml files one
 at a time, it wasnt a problem.

 I would be curious though, my impression from that experience was that
 alot of the load time on an XML file comes from that initial loading
 of the file, not so much the stepping through the XML, is that
 accurate? And is there any difference in load time between this:

 image
   pathimageurl/path
   nameimagename.jpg/name
   width800/width
   height600/height
 /image

 vs this:

 image path=imageurl name=imagename.jpg width=800 height=600 /

 .m

 On Thu, Aug 28, 2008 at 9:35 AM, Lehr, Theodore M (N-SGIS)
 [EMAIL PROTECTED] wrote:
  I have a project that involves xml... I am wondering how I should
  organize my xml... would it be best (from a flash perspective) for it to
  be on huge xml file with lots and lots of children - or would I be
  better off breaking it into multiple xml files where one xml tag
  references another xml file and so on...
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] XML and best method

2008-08-28 Thread allandt bik-elliott (thefieldcomic.com)
there might be - for loops are a pretty slow way of accessing an array for
instance (although they look lovely and keep things neat) - it's actually
faster to add each node of an array manually so in theory, the fewer times
the app has to loop through large nests of xml (similar process), the
better.

for really large xml files, i suppose the extra file weight of the extra
verbosity (is that a word?) of a heavy nest over one that makes more use of
attributes might make a difference in load times as well although i think
it'd have to be a seriously large file (or for a seriously slow connection)
to really be a consideration

that said, i would use a child node for large amounts of text / data - you
wouldn't put a whole paragraph into an attribute, for instance. Nor would
you want to put html formatted text into an attribute (i don't even think
you can?)

so:

?xml version=1.0 encoding=UTF-8?
trainupdate result=success currtime=1219755890344
targettime=122002920 distance=180 weather=rain winddir=45
windspeed=18
train position=26 speed=40 departing=Departing 1pm
stoptext=Leaves on line /
Here is a paragraph of copy describing the function and focus of the
train in question. I could go on like this for hours. Would you like me to?
/train
train position=65 speed=60 departing=Departing 3pm
stoptext=Signal failure /
Not as much but we're following a precedent
/train
/trainupdate


On Thu, Aug 28, 2008 at 6:05 PM, Matt S. [EMAIL PROTECTED] wrote:

 Thanks. Do you know if the difference is dramatic?  Just curious,
 especially since most experts eg Moock's books dont shy away from
 node-heavy XML generally, but if there are serious performance
 considerations you'd think they would.

 .m

 On Thu, Aug 28, 2008 at 10:27 AM, allandt bik-elliott
 (thefieldcomic.com) [EMAIL PROTECTED] wrote:
  yes the second one is shorter :)
 
  i try to keep child nodes to a minimum - 1 per 'object' and only really
 use
  them when describing one of several same-level objects
 
  On Thu, Aug 28, 2008 at 2:58 PM, Matt S. [EMAIL PROTECTED] wrote:
 
  Speaking from recent experience, lots of little XML files is ok if
  you're accessing them one at a time, but if you need to pull up more
  than one at a time, it can get slow quick. I had a project where I had
  to load 5-10 small xmls (really small, just basic image galleries, 10
  items max each), and it seemed like the initial process of loading the
  XML files (load one, increment xml ID, load the next, etc) was the
  lions share of the load time, so that when it was 10 xmls at once it
  started to take annoyingly long (especially since that was then
  followed by the actual images needing to be loaded). In the end we
  compiled all the xmls into one big XML and loaded that up front. But
  on other projects, when I was just loading single small xml files one
  at a time, it wasnt a problem.
 
  I would be curious though, my impression from that experience was that
  alot of the load time on an XML file comes from that initial loading
  of the file, not so much the stepping through the XML, is that
  accurate? And is there any difference in load time between this:
 
  image
pathimageurl/path
nameimagename.jpg/name
width800/width
height600/height
  /image
 
  vs this:
 
  image path=imageurl name=imagename.jpg width=800 height=600 /
 
  .m
 
  On Thu, Aug 28, 2008 at 9:35 AM, Lehr, Theodore M (N-SGIS)
  [EMAIL PROTECTED] wrote:
   I have a project that involves xml... I am wondering how I should
   organize my xml... would it be best (from a flash perspective) for it
 to
   be on huge xml file with lots and lots of children - or would I be
   better off breaking it into multiple xml files where one xml tag
   references another xml file and so on...
  
   ___
   Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] XML and best method

2008-08-28 Thread alpha
 Thanks. Do you know if the difference is dramatic?  Just curious,
 especially since most experts eg Moock's books dont shy away from
 node-heavy XML generally, but if there are serious performance
 considerations you'd think they would.

I don't think the difference is dramatic. It may be noticeable in a very
large XML file, but not dramatic.

The thing to remember is that, while the XML classes are in machine
language, and very efficient, you are parsing text, which is always
inefficient. If performance is an issue, you want as little text (XML) as
possible. The XML classes may be doing something under the hood to
optimize that, but there's no getting away from the fact that accessing
XML involves parsing text.

The books on Flash may not be the best references for XML. They are
oriented to teaching you ActionScript, and their XML structures are often
driven more by what they are teaching than by XML best practices.

If you really want to learn about preferred styles, and things like
advantages of attributes vs. child nodes, I'd pick up a book specifically
on XML. I'm afraid I can't recommend one--I've been doing XML so long I've
lost touch with the references--but I'm sure some people here or over on
Flash_Tiger can recommend good XML references.

Cordially,

Kerry Thompson

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: saving local (XML) files, two projectors talkin'

2008-08-28 Thread Ian Thomas
Sebastian,

You can achieve file writing and reading using one of the many
available flash wrappers.

I'd take a look at Northcode's SWFStudio:
http://www.northcode.com/swfstudio.php

or SWHX:
http://www.haxe.org/com/libs/swhx

Or Adobe's own AIR, but you would have to wrap your AS2 application in
some AS3 code to make it work.

HTH,
   Ian

On Thu, Aug 28, 2008 at 6:05 PM, sebastian [EMAIL PROTECTED] wrote:
 ok well I haven't found any solutions for writing XML files to disk... how
 weird is that???

 I've decided to go ahead and reprogram the whole XML reader so that it reads
 in SharedObjects instead... as I need to finish this project by Friday.

 It took a little while to figure out I had to use localPath to share between
 SWFs and AMF0 encoding to share between AS3 and AS2, but I am on my way to
 success... quite the hassle, lost hours, but I think this is the only way?

 Thanks,

 Sebastian.

 sebastian wrote:

 Hello,

 Been searching for answers and I was wondering what options there was for
 saving local XML files; as this seems to be a stickler... (?)

 I have two flash files; the two flash applications will run on different
 screens connected to the same computer.

 One of them is an already built application that I don't want to edit very
 much, cause it's an ugly monster. Previously it loaded XML files from a
 web-server [which collected SMS/text entries from users], but now it needs
 to read the XML file from the local disk where it is running and there is NO
 internet access anymore. As it reads items from the XML it needs to delete
 the entries. It's display is actually a very large projector/LCD mounted on
 a wall for everyone to see.

 The other application, which is connected to a touchscreen interface
 [replacing the need for a user's mobile/cell phone], needs to generate lines
 that feed into the same XML file the beast is reading, so that it can
 generate a sort of queue for it to run through.

 The original beast is in AS2 and messy [read: painful to edit any code],
 the new touch screen is clean and in AS3. It's running on all on local
 Window computers as a pair of dual full-screen projectors [.exe files], no
 PHP facilities or local DB I'm afraid.

 My question is:

 * is there anyway at all to have these two applications read and
 write/delete entries from the XML files?

 * If not, what workarounds do I have at my disposal? Can I read/write to a
 text file (*.txt) instead?

 * I know shared objects exist, am I forced to use this in this
 situation?

 * finally, is there any 'smart' way to lock a file or have one of the
 flash files prevent the other from writing/reading to the same file at the
 same time? I don't know if this is an issue, but I could foresee file
 corruption if both flash files try and write to a file at the same instant.

 Thanks for your insight!!

 With kind,

 Sebastian.

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] XML and best method

2008-08-28 Thread Matt S.
On Thu, Aug 28, 2008 at 1:25 PM, allandt bik-elliott
(thefieldcomic.com) [EMAIL PROTECTED] wrote:

 that said, i would use a child node for large amounts of text / data - you
 wouldn't put a whole paragraph into an attribute, for instance. Nor would
 you want to put html formatted text into an attribute (i don't even think
 you can?)

When we need to pass in html text via an xml attribute we use
urlencoded text, which works pretty well.

.m
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flash apps via bluetooth

2008-08-28 Thread Weyert de Boer

Hi Glen,

You can consider using RoomWare. More information at: 
http://www.roomwareproject.org/


Yours,
Weyert de Boer

Hi,

  I am working on a project with a control interface that has a 
little brother for Pocket PC, but I was wondering if it is possible 
to develop another version for mobiles that can be downloaded via 
bluetooth.


  The idea is that the mobile interface could be used to control a 
system in close proximity and the SWF would be served via bluetooth 
from something close by.  The app would also need to be able to talk 
to a central server using XML or similar and I am not sure whether I 
would need an internet connection or if this could be done over 
bluetooth too?


  Can anyone give me any pointers to useful info - I have found the 
Mobile  Devices Devnet site on Adobe and also googling, but any 
good sources would be useful.


  Cheers

  Glen


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: saving local (XML) files, two projectors talkin'

2008-08-28 Thread sebastian

Thank you Iam for the information.

Seeing as I was already half done portiong over my XML reader into a 
SharedObject reader, I just went ahead and finished the code conversion...


However I am encountering one really frustrating issue, and I can't seem 
to find the solution...

:(

One of my SWFs writes to a SO, the other reads and deletes entries as 
they are read.


When I remove an entry from the SO {=SharedObject} in the reader SWF, it 
is NOT updated in the SO of the writing SWF unless I completely close 
the writing SWF (flash player) and re-open it. But I need the writing 
SWF to correctly share the SO with the reader so that they can both 
write and delete entries in the SO...


I have tried many solutions, here is my code with my failed solutions 
included:


//
//writing SWF:
//AS3:
public function addEntry (_entry:String) {

//tried to re-assign SO to another file every time I write to make it
//'refresh' the SO's values:
so = SharedObject.getLocal(bogus,localPath);

//tried here to make it re-read the SO every time I write but it still
//refuses to read in changed values:
so = SharedObject.getLocal(movieQ,localPath=/);

//i also tried making so a var so so that it was not persistent, but 
somehow it still remembers the values... enve if i make it a var!


if (!so.data.Qlist) {
so.data.Qlist = [];
} else {
	//debug this list ALWAYS has the same values and is never updated by 
the writing SWF:

trace (Qlist entries:  + so.data.Qlist);
}

if (_entry != ) {
so.data.Qlist.push (_entry);
}

trace (Qlist entries AFTER push:  + so.data.Qlist);
so.flush ();//saving to disk works fine, as the reader does see changes
so.close ();//tried this command in case it made it re-load the SO next 
time around, but even with close() it still doesn't re-read the SO... :(


}
//

the reader is very simple it just does this:

//
//reading SWF
//AS2

var so:SharedObject = SharedObject.getLocal(movieQ,localPath=/);

trace (reading:  + so.data.Qlist);
//this always updates correctly if the writer adds an entry

so.data.Qlist.shift();

trace (reading after shift:  + so.data.Qlist);
//this does remove an entry successfully from the SO
//but the writer does NOT update its reference to the SO UNLESS
//I close the writing SWF completely and re-open it...

so.flush();//saving data to disk...

//



If anyone can help I would be very grateful, not getting any joy here...
:(

Sebastian.


Ian Thomas wrote:

Sebastian,

You can achieve file writing and reading using one of the many
available flash wrappers.

I'd take a look at Northcode's SWFStudio:
http://www.northcode.com/swfstudio.php

or SWHX:
http://www.haxe.org/com/libs/swhx

Or Adobe's own AIR, but you would have to wrap your AS2 application in
some AS3 code to make it work.

HTH,
   Ian

On Thu, Aug 28, 2008 at 6:05 PM, sebastian [EMAIL PROTECTED] wrote:

ok well I haven't found any solutions for writing XML files to disk... how
weird is that???

I've decided to go ahead and reprogram the whole XML reader so that it reads
in SharedObjects instead... as I need to finish this project by Friday.

It took a little while to figure out I had to use localPath to share between
SWFs and AMF0 encoding to share between AS3 and AS2, but I am on my way to
success... quite the hassle, lost hours, but I think this is the only way?

Thanks,

Sebastian.

sebastian wrote:

Hello,

Been searching for answers and I was wondering what options there was for
saving local XML files; as this seems to be a stickler... (?)

I have two flash files; the two flash applications will run on different
screens connected to the same computer.

One of them is an already built application that I don't want to edit very
much, cause it's an ugly monster. Previously it loaded XML files from a
web-server [which collected SMS/text entries from users], but now it needs
to read the XML file from the local disk where it is running and there is NO
internet access anymore. As it reads items from the XML it needs to delete
the entries. It's display is actually a very large projector/LCD mounted on
a wall for everyone to see.

The other application, which is connected to a touchscreen interface
[replacing the need for a user's mobile/cell phone], needs to generate lines
that feed into the same XML file the beast is reading, so that it can
generate a sort of queue for it to run through.

The original beast is in AS2 and messy [read: painful to edit any code],
the new touch screen is clean and in AS3. It's running on all on local
Window computers as a pair of dual full-screen projectors [.exe files], no
PHP facilities or local DB I'm afraid.

My question is:

* is there anyway at all to have these two applications read and
write/delete entries from the XML files?

* If not, what workarounds do I have at my disposal? Can I read/write to a
text file (*.txt) instead?

* I know shared objects exist, am I forced to use this in this

Re: [Flashcoders] Re: saving local (XML) files, two projectors talkin'

2008-08-28 Thread sebastian


ok I finally manged to resolve the issue, though I am still not sure why 
it was occurring.


When in the writing SWF I moved the script away from the class file it 
was calling and just copy-pasted it into the calling object, it no loner 
was persistent... how odd...

:/
??

It would make more sense to encapsulate my SO in a seperate class 
file... but at least I have a solution.


I was initializing my SO file like this:

//...//
import com.Data.SO;
//...//
private var mySO:SO;
//...//
mySO = new SO (movieQ,/,true);
//where the parameters are 'name',
//'path' and a boolean for if its an AS2 SO

//and then I was calling:

mySO.addEntry (entryValue);
//where entryValue is a new item to add to the array [see code below]


PHEW!!!


Seb.



sebastian wrote:

Thank you Iam for the information.

Seeing as I was already half done portiong over my XML reader into a 
SharedObject reader, I just went ahead and finished the code conversion...


However I am encountering one really frustrating issue, and I can't seem 
to find the solution...

:(

One of my SWFs writes to a SO, the other reads and deletes entries as 
they are read.


When I remove an entry from the SO {=SharedObject} in the reader SWF, it 
is NOT updated in the SO of the writing SWF unless I completely close 
the writing SWF (flash player) and re-open it. But I need the writing 
SWF to correctly share the SO with the reader so that they can both 
write and delete entries in the SO...


I have tried many solutions, here is my code with my failed solutions 
included:


//
//writing SWF:
//AS3:
public function addEntry (_entry:String) {

//tried to re-assign SO to another file every time I write to make it
//'refresh' the SO's values:
so = SharedObject.getLocal(bogus,localPath);

//tried here to make it re-read the SO every time I write but it still
//refuses to read in changed values:
so = SharedObject.getLocal(movieQ,localPath=/);

//i also tried making so a var so so that it was not persistent, but 
somehow it still remembers the values... enve if i make it a var!


if (!so.data.Qlist) {
so.data.Qlist = [];
} else {
//debug this list ALWAYS has the same values and is never updated by 
the writing SWF:

trace (Qlist entries:  + so.data.Qlist);
}

if (_entry != ) {
so.data.Qlist.push (_entry);
}

trace (Qlist entries AFTER push:  + so.data.Qlist);
so.flush ();//saving to disk works fine, as the reader does see changes
so.close ();//tried this command in case it made it re-load the SO next 
time around, but even with close() it still doesn't re-read the SO... :(


}
//

the reader is very simple it just does this:

//
//reading SWF
//AS2

var so:SharedObject = SharedObject.getLocal(movieQ,localPath=/);

trace (reading:  + so.data.Qlist);
//this always updates correctly if the writer adds an entry

so.data.Qlist.shift();

trace (reading after shift:  + so.data.Qlist);
//this does remove an entry successfully from the SO
//but the writer does NOT update its reference to the SO UNLESS
//I close the writing SWF completely and re-open it...

so.flush();//saving data to disk...

//



If anyone can help I would be very grateful, not getting any joy here...
:(

Sebastian.


Ian Thomas wrote:

Sebastian,

You can achieve file writing and reading using one of the many
available flash wrappers.

I'd take a look at Northcode's SWFStudio:
http://www.northcode.com/swfstudio.php

or SWHX:
http://www.haxe.org/com/libs/swhx

Or Adobe's own AIR, but you would have to wrap your AS2 application in
some AS3 code to make it work.

HTH,
   Ian

On Thu, Aug 28, 2008 at 6:05 PM, sebastian [EMAIL PROTECTED] wrote:
ok well I haven't found any solutions for writing XML files to 
disk... how

weird is that???

I've decided to go ahead and reprogram the whole XML reader so that 
it reads

in SharedObjects instead... as I need to finish this project by Friday.

It took a little while to figure out I had to use localPath to share 
between
SWFs and AMF0 encoding to share between AS3 and AS2, but I am on my 
way to
success... quite the hassle, lost hours, but I think this is the only 
way?


Thanks,

Sebastian.

sebastian wrote:

Hello,

Been searching for answers and I was wondering what options there 
was for

saving local XML files; as this seems to be a stickler... (?)

I have two flash files; the two flash applications will run on 
different

screens connected to the same computer.

One of them is an already built application that I don't want to 
edit very

much, cause it's an ugly monster. Previously it loaded XML files from a
web-server [which collected SMS/text entries from users], but now it 
needs
to read the XML file from the local disk where it is running and 
there is NO
internet access anymore. As it reads items from the XML it needs to 
delete
the entries. It's display is actually a very large projector/LCD 
mounted on

a wall for everyone to see.

The other application, which is