Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Getting Started With Amfphp And Rias, first steps in creating RIAs
sanbeand
post Nov 2 2005, 02:12 AM
Post #1


Member [Level 1]
****

Group: Members
Posts: 51
Joined: 28-October 05
From: mexico
Member No.: 13,497



AMFPHP in a short way is a library of php files that let u manage in
JUST ONE FILE what u would do in many files like for example queries
to mysql. So u can have tons of queries to mysql and all of them in
just ONE FILE!

so what is a RIA? a RIA is a Rich Internet Application commonly given
to flash applications, not the animations or presentations we see
daily on the internet but very useful and cool programs made in flash.

the fisrt step u need to take is to download the AMFPHP library
directly from its site at www.amfphp.org, in some free hosted sites
the latest versions doesnt run but the .9 version does...happily at
trap17.net i could run the latest version 1 milestone 3 and some of
the main changes (since the milestone 1) include the utf8_decode so u
can store frech, spanish, german names, streets etc.

ok now while u are downloading AMFPHP lets go to the flash side, u can
download the latest version at macromedia.com (latest is 8) and as we
want to trace every action we perform we should (for sure) download the
remoting components (http://www.macromedia.com/software/flashremoting/downloads/components/) it helps to build easily our RIA..ok i'll wait
while u download it... unsure.gif ... unsure.gif ... well i think u
alredy downloaded it... so lets go to the construction of our first
mini RIA: smile.gif

Installation NOTE: first install Flash 8 and then the remoting components

the first time u open flash u'll see the welcome window and a bunch of
typefiles u can choose from... and as we want to just start, choose
the flash file (fla), after u load ur new document by default Flash
has some opened panels but maybe the components panel is not! so if it
is not opened in the right panel go to Window>Component Panel and u'll
see that that new panel opens and some "compenent directories are
shown", look very closely to the User Interface and Data Components
that are the ones we are gonna use... oh! we finished downloading
AMFPHP good!... we are not gonna change anything from any file just
uncompress the folder and give a name like "flashservices" (just for
fun rolleyes.gif ) and then opload the "flashservices" folder to ur
hosting server, site or just move the folder if u are running a
webserver in ur computer to the root folder of the folder that ur
server use to use the files eg. for IIS the folder is
C:\Inetpub\wwwroot and for apache in my computer is C:\Program
Files\Apache Group\htdocs...

now it fits just like this:
>http://localhost/flashservices<

lets leave AMFPHP and continue with flash...now that we have seen the Groups's Components drag a Combobox, a DataGrid, a TextArea and Three buttons give each component an instance name for the combobox>cb, for the Datagrid> dg fo the textArea> ta_txt and for the buttons> btn1, btn2, btn3 and put each button below each component i mean below the combobox the btn1 and so on...
ok now that u have the compoents positioned in the stage go again to the Components Panel and drag 3 Dataset from the Data group and 3 RemotinConnector from the Data Components Group(in flash 8, in previous versions both are under Data Componets) and give an instance name for each component such as ds_1 and r_con1 and so on....
ok now lets bind each component to be able to drive the data to the correct place...
select the r_con1 and in the component inspector(if it is not opend go to Window>Component Inspector) select BINDINGS and click on the big + and select Results:Object and then click ok...u'll see an item is added below, click the item and in its properties select "bound to:" and select the ds_1... do the same thing with the rest of the components...
now u finished binding the components click on the FIRST frame and go to ACTIONS (if it is not opend press F9) and paste this code:

CODE
btn1.onPress=function(){
r_con1.trigger();
}

btn2.onPress=function(){
r_con2.trigger();
}

btn3.onPress=function(){
r_con3.trigger();
}


ooops! i almost forget select the remoting connectors and modify its gateway to ur current location (where u put the flash services folder) e.g. http://localhost/flashservices/gateway.php and for the service write myTest and for the method of each component write myCb for the remotingconnector of the combobox, myDg for the datagrid's and myText for the TextArea's...

ok now we finished the flash side laugh.gif smile.gif ..now lets finish the last part...

in amfphp files are stored as classes it means the name of the file is gonna be called as the class conatained in it... also is good to mention that u must declare each function that is gonna be used in order to be recognized by php...
copy this file under flashservices>services folder and save the file as myTest.php


CODE
<?php
class myTest{
       //change to match your needs
       var $dbhost = "localhost";
       var $dbname = "ur database name";
       var $dbuser = "ur user";
       var $dbpass = "ur password";

     function myTest(){
       $this->methodTable = array(
        "myDg" => array(
             "description" => "Returns products table",
             "access" => "remote" // available values are private, public, remote
             //"arguments" => array ("message")
           ),
           "myCb" => array(
             "description" => "Returns products table",
             "access" => "remote" // available values are private, public, remote
             //"arguments" => array ("message")
           ),
           "myText" => array(
             "description" => "Echoes the passed argument back to Flash (no need to set the return type)",
             "access" => "remote", // available values are private, public, remote
             "arguments" => array ("rs")
           )
       );

                       // Initialize db connection
                       $this->conn = mysql_pconnect($this->dbhost, $this->dbuser, $this->dbpass);
                       mysql_select_db ($this->dbname);
}

     function myDg(){
       return mysql_query("select * from mydg");
     }
     function myCb(){
       return mysql_query("select * from mycombo");
     }
       function myText(){
        return mysql_query("select myText from mytext")
}
?>


ok we are almost done... now set up three tables with phpMyAdmin called "mydg, mycombo and mytext" for the mydg table set up these fields ID, Name; for the mycombo set up JUST myNames and for text use ID and myText...
in the mydg table write new records as follows:
ID Name
1 Andrés
2 Güero

fo mycombo table set:

myNames
Andrés
Güero

and finally for myText:
Andrés is a Güero friend


after u save all this info u can return to flash publish ur work and pressed ur buttons to see the results! and using the utf8_decode....

now we are done! cool.gif u can start building powerful applications and RIAs!! hope it helps....
cheers!

Notice from BuffaloHELP:
Too busy posting forgot to add CODE tags? Tisk tisk...


This post has been edited by BuffaloHELP: Nov 5 2005, 12:15 AM
Go to the top of the page
 
+Quote Post
iGuest
post Aug 7 2008, 07:43 AM
Post #2


Hail Caesar!
*********************

Group: Members
Posts: 5,876
Joined: 21-September 07
Member No.: 50,369



Problems in IIS 7
Getting Started With Amfphp And Rias

Hallo my frined,
Firstly let me thank you for this helpfull example.
I followed all the steps of the example one after the other but unfortunatelly it doesn't working.
I also found that when I am typing in url: //localhost/flashservices/browser/ then it comes up a page that needs a simple registration (which unfortunately doesn't works).
I have Windows Vista Premium with IIS 7.
Could you please post an example for Vista and IIS 7, or give some details who to solve this problem ?
Thank you

-reply by kostas
Go to the top of the page
 
+Quote Post
freeflash
post Aug 19 2008, 11:37 PM
Post #3


Newbie
*

Group: Members
Posts: 8
Joined: 19-August 08
Member No.: 66,638



hey bro my friend was looking for this i gave him the link and he like everything you said and he want me to say thank you so thank you very much
and hope this will help other people like it helped my friend
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Creating a Compiler(6)
  2. How To Create The Army System(11)
  3. Making Money Creating Logo's(19)
  4. Creating Links In Images(18)
  5. How Can I Create A Gui Using C++(5)
  6. Creating Profiles In Php/mysql ?(7)
  7. Creating Subdomain Hosting On Other Hosts?(3)
  8. Evilboard (forum Software) - Multiple Categorys - Don't Work :((6)
  9. Creating Msn Account Without A Hotmail Account(3)
  10. Three Steps To Become A Runescape Member(5)
  11. What Are The Steps To Making A Website?(19)
  12. Runescape 2 Private Server: Code/guide 1(11)
  13. Next Generation Pokemon Games(3)
  14. How You Started Your Dating?(7)
  15. Help Creating A Profile Website(14)
  1. How To Get Started Fishing: What You Will Need (uk)(2)
  2. How To Get Started Fishing: At The Lake(0)
  3. Creating A Good Website, How?!(18)
  4. I Think That They Should Start Making Boxers For Girls.(4)
  5. Creating A Fully Featured Cms(0)
  6. Just Started Cpc Advertising... Any Suggestions?(0)
  7. How To Start Your First Game Project(0)
  8. Creating A Floating Javascript Docking Menu(1)
  9. Create Dynamic Html/php Pages Using Simple Vb.net Code(1)
  10. Creating A Php Login System Using Mysql(10)
  11. Getting Started With Photoshop!(0)
  12. Creating A Shortcut List Near The System Tray(4)
  13. The Proper Method To Submit Tickets At Xistosupport(4)


 



- Lo-Fi Version Time is now: 12th October 2008 - 04:23 PM