Getting Started With Amfphp And Rias - first steps in creating RIAs

free web hosting
Open Discussion > CONTRIBUTE > Tutorials

Getting Started With Amfphp And Rias - first steps in creating RIAs

sanbeand
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...

 

 

 


Reply

iGuest
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

Reply

freeflash
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

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. cpanel amfphp - 201.07 hr back. (1)
  2. amfphp "return type" number - 350.75 hr back. (1)
  3. amfphp mp3 - 610.29 hr back. (1)
  4. unlink in amfphp - 622.70 hr back. (1)
Similar Topics

Keywords : started amfphp rias steps creating rias

  1. Create Dynamic Html/php Pages Using Simple Vb.net Code - Taking your application data, and creating a webpage for others to vie (1)
  2. How To Start Your First Game Project - The first steps to creating your own game! (0)
    Ok, I see alot of questions around the game development forums of people wanting to make their first
    game, but they don't know where to start. So, I decided to write this tutorial, having been in
    the same situation before. NOTE: This Tutorial: -Is meant to help you get past that initial bout of
    developer's block -Does not teach you how to make a game, just help you start -Cannot help you
    if you cannot answer the questions asked So, let's get to it, shall we? How to start
    your first game project: --So, the first thing you need to make sure yo...
  3. How To Get Started Fishing: What You Will Need (uk) - This applies mainly to the UK but other countries too. What you will n (2)
    Hi folks, with the beginning of spring its time to crack out the coarse fishing rods and land a few
    fish, i was supposed to be fishing today but the weather took a turn for the worse so instead let me
    try to convince a few of you to go fishing and take your kids too! I dont need to explain what
    fishing is, everyone knows that but let me clear up a few misconceptions: 1) Do you eat the fish?
    Or do you kill the fish? Or otherwise remove them from the lake? A) No! There is a nasty habit
    of some eastern Europeans to remove and eat the fish from lakes and that might...
  4. How To Get Started Fishing: At The Lake - mainly applies to UK, see the "what you will need" too! (0)
    So you now know what you need to start fishing from my other tutorial, once you have it all it's
    time to head to the lake! As i said pick up the bait on the way, maggots from the tackle shop,
    corn and spam from tescos and bread too if you want (you can eat it too of course!). At the
    lake you can ask those already fishing for their tips but some anglers are liable to lie to keep the
    best spots to themselves. So when you get look for the "swims" These are areas along the bank where
    the bushes have been cleared and sometimes paving slabs have been laid to let ...
  5. Getting Started With Mysql - creating tables and insert data into them. (2)
    Hi in this tutorial you will learn how to create tables and insert items into them. First steps are
    to create the database - go into your cpanel and mysql databases, from there make an account and a
    database and then attach them together with all priviliges, call the database test and the account
    admin, with the pw as pass - or any other password. We need to connect to the database so first in
    your php file (probably named index.php) - this is how to do it. CODE
    mysql_connect("localhost", "admin", "pass") or
    die(mysql_error(&...
  6. Delete Files And Directories Using Php - following up from creating and writing (7)
    How To Delete Files and Directories follow up from creating them Hello all and
    welcome to my second tutorial involving file management. In my previous tutorial , I explained how
    to create, write and read files. In this tutorial I'll explain how to remove the files and
    directories you took so long to create. I did not explain last time how to create directories as I
    did not know, now I do, you can use the mkdir() function. Now with this tutorial.... Removing
    Files Removing files can easily be done with the unlink() function: CODE <? un...
  7. Creating A Timer Program - Using Visual Basic 2005 (8)
    This tutorial will explain how to create a basic timer using Visual Basic Express 2005. If you
    don't have it, it's free and you can dowload it from Microsoft's website. All you need
    is a few minutes to sit down and read this and a version of Visual Basic. OK, so what will this
    timer actually do? Well, you are able to enter a number of minutes and a message, and then click a
    button. Once the timer is up, your message pops up and you are reminded! So, basically it's
    a little reminder system. I use it to remind me when TV programmes start, when I have to...
  8. Creating Navigation For Html Websites - Have a common navigation menu for the whole website! (12)
    Pre-requisite: HTML, inline frame tags 1 Attachment(.zip) included. Updates : 29-12-07: Doctype
    added in example files (Advised by jlhaslip) Designing a whole website takes a lot of planning
    and organization. Designing a proper navigation system is a basic step in building your website. If
    you are developing webpages in html you would have observed that as you go on creating pages it
    becomes difficult to maintain the links to the pages. This article will guide you in developing a
    common navigation menu for your website. It describes three ways, so if you don'...
  9. Creating A Resume - 10 Tips For Making A Resume (1)
    I've been working on my Resume for months now. Here is a summary of what I've learned: 1.
    Avoid referring to yourself via 1st person or 3rd person terms. Rather than saying "I started this
    job in" just say "Began job in"... Employers expect Resumes to be professional and avoid reference
    to oneself; and instead speaking in an impersonal tone that presents
    achievements/skills/experience/education without personalization. Avoid words like "I", "my", "he",
    "she", etc. Leave out personal pronouns and only use the action words/verbs. This also includes
    your Ob...
  10. Creating A Simple Image Viewer - Using Visual Basic 2005 Express Edition (4)
    I downloaded Microsoft's Visual Studio Express suite a few months ago, but only recently got
    around to installing it. I have been practising with Visual Basic and making some rather basic
    programs and utilities, but they contain most of the basic concepts. This tutorial will explain how
    to create a basic image viewer, and I will try to explain each step from beginning to end as clear
    as I can. To start you will need: Microsoft Visual Studio About 10-20 minutes free time OK,
    first open up the Visual Basic part of the Studio. I am using the 2005 Express version, so...
  11. Programming In Glut (lesson 4) - Creating 3D objects (0)
    Lesson 4 of 6. I hope you are enjoying them /laugh.gif" style="vertical-align:middle"
    emoid=":lol:" border="0" alt="laugh.gif" /> . QUOTE Hello, in this tutorial we will be creating
    a 3D pyramid. We are building this tutorial from Lesson 3, but I took out the 2D objects and placed
    a 3D pyramid in there instead. The 3rd axis for drawing can be a litle confusing, but after you get
    the hand of it you'll do fine. Now when you are setting a 3D vertex just remember that the
    camera is on the positive end of the z axis. So things that have a more positive z axis va...
  12. Programming In Glut (lesson 1) - Creating a windwo (0)
    This is the first of six lessons I am transferring from Astahost for programming in GLUT, and after
    the six I hope to make more, I hope you enjoy. QUOTE Hello, I'm starting a series on how to
    program in OpenGL using the OpenGL Utility Toolkit, a.k.a. GLUT. I chose GLUT because it is quick
    and easy to write, and very easy to learn. In this tutorial I am going to teach you how to create a
    basic window which we will build off of in later tutorials. Throughout the tutorial I will leave
    notes to let you know what each command does, and how you can modify it to fit...
  13. Creating Your Own Icon - (23)
    It is easy to create your own icon, just pick a bitmap (.bmp) file and change its extension to .ico.
    To do so, open the Windows Explorer, click on the View menu (or Tools in WinMe), click Folder
    Options, click View tab, remove the check on the "Hide file extensions for known files types"
    option, and then click OK. Select a bitmap file, press F2 key, and then change its extension to
    .ico. Have fun learning:)...
  14. A Guide To Css And Creating A Stylesheet - (15)
    Table of Contents: I. Introduction II. Starting your stylesheet --A. Starting syntax with
    font-family --B. Defining classes --C. Using classes III. The STYLE tag IV. Comments in CSS V. The
    "a" tag VI. A quick list of common attributes VII. Notes --A. Universal classes --B. Grouping --C.
    Multiple instances VIII. Finding other attributes IX. Closing I. Introduction Firstly, to begin
    using a stylesheet, you must have one. Open up your text editor and save as (something).css. I know
    NotePad doesn't need quotes for a stylesheet, but I'm not sure about other progr...
  15. Tutorial: Creating Custom Icons For Devices - Give that device a great icon every time you plug it in! (0)
    Ok for this tutorial I will use the PSP as an example of the device, this should work for every
    device. (THIS WILL NOT HARM ANYTHING AT ALL!) First off, open notepad and type in:
    ICON=ICONE.ICO Save that as AUTORUN.inf Now, find a picture you like.. make sure its dimensions
    are 16X16 pixels. Put it in the main folder of the device, for example, my psp is located at
    F:\, i would type in F:\ to the adress bar and put the picture in that folder, as it is
    the folder your computer automatically reads, anyways, put your picture in there and name it: ICO...
  16. Creating Rollovers With Buttons - Short & simple javascript tutorial that shows you how. (2)
    Javascript in action can render some very neat visual effects, which can make your website more
    appealing, and sometimes even easier to navigate. Among the most common effects are the
    'button' effect, and the mouseover effect. The buttons are very common, of course; if
    nowhere else, most of us have seen them at the end of forms (Click the 'submit' button to
    proceed...). The basic idea is to have a 'depressible' object, which can give you the
    illusion that you're 'pressing' it when you click it. The rollover effect causes
    something to h...
  17. Getting Started In Vb 6 - Printing out Hello World! in a text box. (0)
    Sorry for a duplicate post in Programming::VB Programming, I accidentally submitted this topic when
    I wasn't done. This example prints out Hello World! First launch VB 6. Second on the
    dialog that pops up create a New Standard Project and click Open. You should see this so far:
    Now click the A button in the toolbox to the left: Click the drag the object. Now click AB| next
    to the A in the toolbox. Drag it under Label1. Then click the button under the AB| and drag it under
    Text1. It should now look like this: Now that we have done adding objects ...
  18. Creating Personal Alarm - To remind you something (2)
    Creating Personal Alarm This personal alarm is very useful to remind you something or anything you
    would like it to do. Use Task Scheduler application to create your personal alarm. First, click on
    Start -> Settings -> Control Panel -> Scheduled Tasks. Now click on the Add Scheduled Task wizard
    in the Task Scheduler folder. Click Next, click the Browse button, and then select your favorite
    sound files (WAV/MP3/MIDI). Set the file to open as the task daily. Set it at the top of the hour
    every day, open up its advanced properties. On the Schedule tab press the Advance...
  19. Creating Your Own Php News System - (23)
    Hello, heres a simple tutorial from a script that I made to power my news system. It is written
    withthe PHP coding system and consists of 8 files using a flatfile based system, without MySQL
    databases. This should be usefull for those who want a simple little news manager and like to have
    simplcity without the fancy date strings and sutff. You can see a demo of it at my site @
    http://www.xeek.trap17.com . Let's Start! First let's start with the easy stuff,
    making the directory first, first create a main directory to hold everything, call this folder "ne...



Looking for started, amfphp, rias, steps, creating, rias

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for started, amfphp, rias, steps, creating, rias

*MORE FROM TRAP17.COM*
advertisement



Getting Started With Amfphp And Rias - first steps in creating RIAs



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE