RE: [PHP] FLASH AND PHP

2001-04-04 Thread Richard Kirk

If you put this code behind a button in Flash 5 (for example):

on (release) {


//Construct and XML object to hold request type
requestXml = new XML();
requestElement = requestXml.createElement("REQUEST");
requestElement.attributes.request = "MyRequest/";
  requestXml.contentType = 'text/xml';
requestXml.appendChild( requestElement );
requestXml.contentType = 'text/xml';

//Construct an XML object to hold the servers (webobject's) reply
requestReplyXml = new XML();
requestReplyXml.onLoad = onRequestReply;

//debug
requestXml.xmlDecl = "?xml version=\"1.0\" ?";
trace( "Request sent" );
trace( requestXml.docTypeDecl );
trace( requestXml.xmlDecl );


//Send the request object to the server
cRequest = "Sent request...";
requestXml.sendAndLoad( "http://www.foo.com/dataretriever.php",
requestReplyXML );
cRequest = "Waiting For Reply...";

}

function onRequestReply () {

//Get the first XML element
var e = this.firstChild;
var _level0:TotalStoreNumber = 0;
var i = -1;

if( e != null ){
do {

if( e.nodeName == "REQUESTREPLY")
e = e.firstChild;
else
//Do what you want with the xml data
//
if( e.nodeName == "STORE") {
cStoreList += ( e.attributes.NAME + " - " + 
e.attributes.ADDRESS +
newline );
if( i == -1 )
i = 1;
else
i++;
eval( "_level0:n" + i ) = i;
eval( "_level0:s" + i ) = e.attributes.NAME;
eval( "_level0:c" + i ) = 111;
}
e = e.nextSibling;
} while( e != null )
}
}


dataretriever.php can then query your DB/build an xml document (see php.net
on how to read/create XML files in PHP) and output it as normal. Flash will
recognise the xml and then you can parse the xml doc returned from your php
script and build the flash object accordingly.
Of course, you don't have to pass xml to your php script, you could just
pass a URL parameter but xml gives you a great framework for expansion
without breaking existing code.

This line is the key:
requestXml.contentType = 'text/xml';
and you won't find it mentioned in the current flash 5 documentation!

HTH


 -Original Message-
 From: Godd [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 03, 2001 8:57 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] FLASH AND PHP


 EXPLAIN !!

 I am not an XML expert

 Please explain. I have only now begun to read up on XML




 ""Richard Kirk"" [EMAIL PROTECTED] wrote in message
 000d01c0bc55$6db38ee0$720a@proj00014">news:000d01c0bc55$6db38ee0$720a@proj00014...
  Or alternatively use the xml object to send an xml (flash 5) document to
 php
  which then waits for an xml response.
 
  Cheers
 
   -Original Message-
   From: Lindsay Adams [mailto:[EMAIL PROTECTED]]
   Sent: Monday, April 02, 2001 10:00 PM
   To: PHP
   Subject: Re: [PHP] FLASH AND PHP
  
  
   If you are wanting to use pregenerated FLASH scripts ( and not
   build them on
   the fly with libswf or ming) then what you want to do, without
   having to buy
   Generator for your server is...
  
   In the beginning of you falsh file, do a load variables from
 a PHP page,
   that queries a database or whatever, gets the data, and echoes it
   out to the
   FLASH file in the format expected by load variables. Tack on
 a variable
 at
   the end called loadDone and set it to 1 (or true)
   In flash, you have to put in a loop in the second frame, or after the
   loadvariables command, that checks to see if loadDone==1, to make
   sure that
   all the variables have loaded.
  
   You cannot assume that the variables will load within a certain
   time period.
   If they don't, the rest of your scripts will break.
  
   That, is how you can pass a lot of dynamic information into your
   flash file,
   without the use of server side generator install from macromedia.
  
  
  
   On 4/2/01 11:14 AM, "Godd" [EMAIL PROTECTED] wrote:
  
Now VRML and PHP may be possible but if you can get Flash to
   get in the mix
that will be so bad.
   
What I really want to do is to get a flash file that will use
   the pictures
that I send to it via php and let it use that picture to do the
   animation.
   
No

RE: [PHP] FLASH AND PHP

2001-04-03 Thread Richard Kirk

Or alternatively use the xml object to send an xml (flash 5) document to php
which then waits for an xml response.

Cheers

 -Original Message-
 From: Lindsay Adams [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 02, 2001 10:00 PM
 To: PHP
 Subject: Re: [PHP] FLASH AND PHP


 If you are wanting to use pregenerated FLASH scripts ( and not
 build them on
 the fly with libswf or ming) then what you want to do, without
 having to buy
 Generator for your server is...

 In the beginning of you falsh file, do a load variables from a PHP page,
 that queries a database or whatever, gets the data, and echoes it
 out to the
 FLASH file in the format expected by load variables. Tack on a variable at
 the end called loadDone and set it to 1 (or true)
 In flash, you have to put in a loop in the second frame, or after the
 loadvariables command, that checks to see if loadDone==1, to make
 sure that
 all the variables have loaded.

 You cannot assume that the variables will load within a certain
 time period.
 If they don't, the rest of your scripts will break.

 That, is how you can pass a lot of dynamic information into your
 flash file,
 without the use of server side generator install from macromedia.



 On 4/2/01 11:14 AM, "Godd" [EMAIL PROTECTED] wrote:

  Now VRML and PHP may be possible but if you can get Flash to
 get in the mix
  that will be so bad.
 
  What I really want to do is to get a flash file that will use
 the pictures
  that I send to it via php and let it use that picture to do the
 animation.
 
  Now what I am looking at is a flash file that displays info on
 a product.
  now given the picture of the product and the information on the
 product, I
  want flash to use that info with the events that I will place
 in the flash
  file and let it do its thing.
 
  now that will be good. I am not sure what macromedia has along
 this line.
 
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] urlencode

2001-03-17 Thread Richard Kirk

No, its set to "off".


-Original Message-
From: John Lim [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 17, 2001 5:14 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] urlencode


You have magic_quotes_runtime enabled which causes this behaviour. You can
disable it by turning it off in your PHP.ini.

 See http://php.net/manual

"rkirk.com Mail" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Help - I've a problem when using urlencode/decode functions (same with
 rawurl...).
 If I encode :
 mnemonic = "lnkphoto"

 I get:
 mnemonic+%3D++%22lnkphoto%22

 And if decode it during the same script execution it converts back to
 exactly:
 mnemonic = "lnkphoto"
 which is what I'd expect.

 However, if I pass this value as a URL argument and decode it in the
 receiving script I get:
 mnemonic = \"lnkphoto\"
 which causes me all sorts of problems!
 Is this a "feature" or have I misunderstood the way this should work?

 Thanks










 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP Editors

2001-02-16 Thread Richard Kirk

Whilst on this theme... it there a PHP syntax file available for textpad
(.syn I think). I can't see any on the textpad website.

Cheers

 -Original Message-
 From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
 Sent: Friday, February 16, 2001 8:18 AM
 To: 'Dallas Kropka'; 'Michael McGlothlin'; Matt DeLong
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] PHP Editors


 I know, I was a TextPad fun too untill I found EditPlus ...
 It is better, at least I though so.

 Try it, it's a good alternative to TextPad ... especially for
 html/css work
 ...
 supports PHP as well and has VERY COOL RegEx replacement and
 search in files
 (whether opened or in folder)

 0.2c


 Cheers,
 Maxim Maletsky




 -Original Message-
 From: Dallas Kropka [mailto:[EMAIL PROTECTED]]
 Sent: Friday, February 16, 2001 5:20 PM
 To: Maxim Maletsky; 'Michael McGlothlin'; Matt DeLong
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] PHP Editors



 www.textpad.com

 Wonderful app, highlighting, keeps your tabs lots of keyboard
 shortcuts and lots of customization.

 This is what all my developers prefer.


 Dallas K.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]