RE: [Flashcoders] load/send XML data | Flash/JavaScript Integration Kit

2006-07-28 Thread Merrill, Jason
Is it possible they can send you an XML string through a webservice?  I
was in a similar situation and my team developed a SOAP webservice I
call from Flash which is just an XML string.  

Jason Merrill
Bank of America 
Learning & Organization Effectiveness - Technology Solutions 
 
 
 
 
 

>>-Original Message-
>>From: [EMAIL PROTECTED] [mailto:flashcoders-
>>[EMAIL PROTECTED] On Behalf Of Maziak, Peter
>>Sent: Friday, July 28, 2006 2:14 PM
>>To: flashcoders@chattyfig.figleaf.com
>>Subject: [Flashcoders] load/send XML data | Flash/JavaScript
Integration Kit
>>
>>I have a flash app that gets populated by parsing data from an
external
>>XML file.  However, my JSP development team tells me that to keep the
>>XML in a session it would be better to load the XML as a string from
the
>>HTML (JSP).  Is it possible to put the XML into a hidden input field
>>within a form on the containing HTML?  How easy is it to have Flash
>>communicate with the HTML and vice-versa?  Or is there a better
approach
>>to get the XML in and out of Flash (other than an external file)?
>>
>>Also, I've looked into the Flash/JavaScript Integration Kit [
>>http://osflash.org/doku.php?id=flashjs OR
>>http://weblogs.macromedia.com/flashjavascript/ ] but am confused by
the
>>installation instruction:
>>
>>  Copy the following library files from source/flash/actionscript
>>into your Flash Authoring classpath:
>>  com/macromedia/javascript/JavaScriptProxy.as
>>  com/macromedia/javascript/JavaScriptSerializer.as
>>
>>Where is the Flash Authoring classpath!?
>>
>>Thanks,
>>-Pete
>>___
>>Flashcoders@chattyfig.figleaf.com
>>To change your subscription options or search the archive:
>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>Brought to you by Fig Leaf Software
>>Premier Authorized Adobe Consulting and Training
>>http://www.figleaf.com
>>http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] load/send XML data | Flash/JavaScript Integration Kit

2006-07-28 Thread Telmo Dias

Hi Peter,

I'm not sure this is what you are looking for, but I have used this 
approach several times and it works great for me.


I usually connect flash to PHP, but it should be the same way for JSP.

This is PHP code. Have your JSP process whatever it has to process in 
order to get the data. The write the data as if you were outputing a 
regular XML file, but in this case not to a file, but just output with 
prints or something similar (I don't know JSP).


$xml =''."\n";
$xml.=''."\n";
$xml.='This is text inside item 1'."\n";
$xml.='This is text inside item 2'."\n";
$xml.=''."\n";

$xml.=''."\n";
header("Content-type: text/xml; charset=UTF-8");
echo utf8_encode($xml);


Inside flash I use a trick I found. We can use a LoadVars object to make 
the request to the server, sending info through POST or GET, and have it 
load directly into a XML object.


_global.dynamicLoadedXml = new XML();
_global.dynamicLoadedXml.ignoreWhite = true;
_global.dynamicLoadedXml.onLoad = function(success){
   //This code is executed once the load is complete. In other words 
once your JSP file is processed and returns a code similar to the above.

   if(sucess){
   //the file was successfully loaded. Do whatever you need in 
terms of parsing.

   var root:XMLNode = this.firstChild;
  _global.dataArray = new Array();

   for(var i:Number = 0; i_global.varsToUseByJSP.id = valueToSend; //whatever value you want to 
send to JSP through POST


//use this to avoid cache problems loading the XML
var rnd = Math.round(Math.random()*1);
var urlToGo = "http://www.xpto.com/process.php?rnd="; + rnd;

_global.varsToUseByJSP.sendAndLoad(urlToGo, _global.dynamicLoadedXml, 
"POST");




Good Luck!  :-)

Telmo Dias


Maziak, Peter wrote:

I have a flash app that gets populated by parsing data from an external
XML file.  However, my JSP development team tells me that to keep the
XML in a session it would be better to load the XML as a string from the
HTML (JSP).  Is it possible to put the XML into a hidden input field
within a form on the containing HTML?  How easy is it to have Flash
communicate with the HTML and vice-versa?  Or is there a better approach
to get the XML in and out of Flash (other than an external file)?
 
Also, I've looked into the Flash/JavaScript Integration Kit [

http://osflash.org/doku.php?id=flashjs OR
http://weblogs.macromedia.com/flashjavascript/ ] but am confused by the
installation instruction:

Copy the following library files from source/flash/actionscript
into your Flash Authoring classpath:
com/macromedia/javascript/JavaScriptProxy.as
com/macromedia/javascript/JavaScriptSerializer.as

Where is the Flash Authoring classpath!?
 
Thanks,

-Pete
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


  


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] load/send XML data | Flash/JavaScript Integration Kit

2006-07-28 Thread Matthew Simpson
Or is there a better approach to get the XML in and out of Flash (other
than an external file)?

Yes, load the data dynamically from the servlet and forget the external
XML file altogether.

 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Maziak,
Peter
Sent: Friday, July 28, 2006 2:14 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] load/send XML data | Flash/JavaScript Integration
Kit

I have a flash app that gets populated by parsing data from an external
XML file.  However, my JSP development team tells me that to keep the
XML in a session it would be better to load the XML as a string from the
HTML (JSP).  Is it possible to put the XML into a hidden input field
within a form on the containing HTML?  How easy is it to have Flash
communicate with the HTML and vice-versa?  Or is there a better approach
to get the XML in and out of Flash (other than an external file)?
 
Also, I've looked into the Flash/JavaScript Integration Kit [
http://osflash.org/doku.php?id=flashjs OR
http://weblogs.macromedia.com/flashjavascript/ ] but am confused by the
installation instruction:

Copy the following library files from source/flash/actionscript
into your Flash Authoring classpath:
com/macromedia/javascript/JavaScriptProxy.as
com/macromedia/javascript/JavaScriptSerializer.as

Where is the Flash Authoring classpath!?
 
Thanks,
-Pete
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com