SWiSH MAX Communicating with PHP - SWiSHMax Tutorials
 
  Buy Ebooks, Video Games, DVDs, Electronics and more !
Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads Make Money Online Blog . Free Image and Photo Sharing and Hosting

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Free image hosting
   Web Design Pakistan
   Swish Templates
   SWiSH Climax
   Talkfreelance Community
   Template Desire
   Lite boards
   Script Sector
   GimpTalk
   13dots
   Idea Designs
   PHP Cafe
   Sposatoettore
   Free swishmax templates
   Swishzone

Manage your site with Flax Article Content Management System
SWiSH MAX Communicating with PHP
Category : SWiSHMax | Level : Intermediate | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

SWiSH MAX Communicating with PHP

Assumption

It is assumed that the reader has knowhow to create an input textbox
or a dynamic textbox in SWiSH MAX.

[quote]
Remember : The text object name and variable name must be different
from eachother.
e.g.
Object Name : mytextobj
Variable Name : mytext

NOTE : If you don't know how to attach variable with a text
object, then CLICK HERE
[/quote]

What is this Tutorials for?
This tutorial demonstrates : how to send information from SWiSH MAX
to a PHP script; and response back from PHP script to SWiSH MAX.


TUTORIAL STARTS

There are two methods of sending information on HTTP protocol (GET and POST).

Both of the methods may be used in SWiSH MAX to send information.
A function loadVariables() is used for doing so.
In this function you specify the script file (e.g. myfile.php), method
to be used (GET or POST), and level (from where) to send information.

[quote]
If you do not have knowledge of variables, '_root', '_parent', and 'this',
then CLICK HERE.
[/quote]

Now we will create a small SWiSH MAX applciation which will send a vaiable
(containing text data) to the PHP script, the script will response back, and
the response back text shown in SWiSH MAX ill be reverse ordered of actual.

Here are some steps to do this
Follow the Steps:

  • Open new SWiSH MAX movie
  • Create an input textbox
  • Set text Object name 'myobj'
  • Set text Object variable name to 'myvar'
  • Create a simple button
  • Select the button and goto script window
  • Write SWiSHScript in
    CODE


    on(release) {

        loadVariables("myfile.php",'POST');

    }


  • Create a new text file in notepad and save as 'myfile.php'
    tip : while saving file use file name with quotes, e.g. "myfile.php"
  • Write PHP code in file 'myfile.php' as
    CODE


    <?

       $newvalue = strrev($myvar);

       echo "&myvar =$newvalue";

    ?>


    [quote]
    Tip : The '&' sign specifies that the data for preceeding variable (if applicable) has ended
    and a new variable's data starts.
    [/quote]
  • Export your html, but remember to set SWF version to 6 from 'Export' property tab
  • upload files to some server (supporting PHP, or you may test on localhos, if
    apache webserver is installed on your system)
  • Now its done, open your html file from specific url.



© 2002-2005 Flaxweb Network | Article Manager | Gimp Tutorials Library | RAD C++ Library | Free C/C++ Sourcecode |
Sites of interest : Web Design Blog | Swish Templates | Swishmax Ebook | Photoshop Templates | Gimp Tutorials | Text Forum | Make Money Online