Sunday, September 13, 2009

services-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<services>
<service id="amfphp-flashremoting-service"
class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage">
<destination id="amfphp">
<channels>
<channel ref="my-amfphp"/>
</channels>
<properties>
<source>*</source>
</properties>
</destination>
</service>
</services>

<channels>
<channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
<endpoint uri="http://localhost/drupal-6.13/services/amfphp" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
</channels>
</services-config>

Drupal with flex example

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()" backgroundGradientAlphas="[1.0, 0.71]" backgroundGradientColors="[#060606, #585555]">
<mx:Script>
import mx.controls.*;
import mx.rpc.events.*;
import mx.utils.ArrayUtil;

[Bindable]
public var recipes:Array;

public function init():void
{
getRecipes();
}

public function onFault(event:FaultEvent):void
{
Alert.show(event.fault.faultString, "Error");
}

public function onViewsResult(event:ResultEvent):void
{
recipes = ArrayUtil.toArray(event.result);
}

public function getRecipes():void
{
views.get("recipe_all", ['nid','title','body','changed','filepath']);
img.source='filepath';
}

public function saveRecipe():void
{
var edit:Object;
if (recipes_select.selectedItem) {
edit = recipes_select.selectedItem;
}
else {
edit = new Object;
}

edit.type = "page";

edit.title = dish.text;
edit.body = recipe.text;

if (edit.title == "" || edit.body == "") {
Alert.show("Enter some content", "Error");
}

node.save(edit);
getRecipes();
}

public function onSaved(event:ResultEvent):void
{
Alert.show("Recipe was saved", "Saved");
}

public function newRecipe():void
{
recipes_select.selectedItem = undefined;

dish.text = "";
recipe.text = "";
}
</mx:Script>

<mx:RemoteObject showBusyCursor="true" destination="amfphp" source="views" id="views">
<mx:method name="get" result="onViewsResult(event)" fault="onFault(event)" />
</mx:RemoteObject>

<mx:RemoteObject showBusyCursor="true" destination="amfphp" source="node" id="node">
<mx:method name="save" result="onSaved(event)" fault="onFault(event)" />
</mx:RemoteObject>

<mx:Panel width="500" height="400" layout="absolute" title="Recipes"
horizontalCenter="0" verticalCenter="0" borderStyle="solid" cornerRadius="10"
backgroundColor="#817C7C" backgroundAlpha="0.52" shadowDistance="10" shadowDirection="right" color="#080808" fontWeight="bold" fontSize="10">
<mx:DataGrid x="10" y="3" width="460" id="recipes_select" dataProvider="{recipes}" borderThickness="2" alternatingItemColors="[#FFFFFF, #FFFFFF]" color="#0D85A8" borderStyle="solid" fontWeight="bold">
<mx:columns>
<mx:DataGridColumn headerText="NID" dataField="nid" width="40"/>
<mx:DataGridColumn headerText="Dish" dataField="node_title"/>
</mx:columns>
</mx:DataGrid>

<mx:Label x="10" y="162" text="Dish" color="#010101" fontWeight="bold"/>

<mx:TextInput x="10" y="186" width="460" id="dish" text="{recipes_select.selectedItem.node_title}" themeColor="#009DFF" backgroundColor="#3E3A3A" color="#FFFFFF" fontWeight="bold" fontFamily="Georgia" borderStyle="solid" borderThickness="2"/>

<mx:Label x="10" y="218" text="Recipe" color="#010101" fontWeight="bold"/>

<mx:TextArea x="10" y="242" width="460" height="75" id="recipe" text="{recipes_select.selectedItem.node_revisions_body}" backgroundColor="#3E3A3A" color="#FFFFFF" fontWeight="bold" fontFamily="Georgia" borderStyle="solid" borderThickness="2"/>

<mx:Button x="416" y="328" label="Save" click="saveRecipe()" fillAlphas="[1.0, 1.0]" fillColors="[#272525, #908D8D, #11B1D3, #76DFF5]" color="#FEFDFD"/>

<mx:Button x="358" y="328" label="New" click="newRecipe()" fillAlphas="[1.0, 1.0]" fillColors="[#272525, #908D8D, #11B1D3, #76DFF5]" color="#FEFDFD"/>

</mx:Panel>
<mx:Image id="img" source="" x="10" y="175"/>
</mx:Application>

Wednesday, July 1, 2009

Creating a database connection profile

To generate a database application, you must have a database connection profile that provides information about the database that you want to use.

Create a connection profile

1. If the Create Application from Database dialog box is not already open, select Data > Create Application from Database.
2. Click the New button to the right of the Connection text box.
3. In the Create Connection Profile dialog box, enter a connection name in the Name text box. You can also complete the optional Description text box.
4. (Optional) When the wizard is finished or when the Data Source Explorer is opened, select the Autoconnect option to connect to the database.
5. Click New.
6. Complete the database connection text boxes. The fields vary depending on the type of database connection you choose. For PHP projects, you use MySQL. For ASP.NET projects, you use Microsoft SQL Server. For J2EE projects, you can select from a list of choices, but MySQL and Microsoft SQL Server are supported.
7. Click Test Connection to make sure that the connection is valid.
8. Click Next.
9. Click Finish.

Generating an ASP .NET database application

You can generate an application that uses ASP .NET and a Microsoft SQL Server database. To generate this type of application, you must have a local .NET installation and access to a target Microsoft SQL Server database table. You can generate an application that uses an ASP .NET page to access a database and return data to the Flex application.

Generate ASP .NET application code

1. If you have not already done so, create a new Flex project that specifies ASP .NET as the application server type. You can deploy the application to the Visual Studio Development Server or the Internet Information Server (IIS) web server that comes with Windows. If you use IIS, the deployment directory specified in the New Flex Project wizard must be defined in the IIS administration console as an ASP Application.
2. Select Data > Create Application from Database.
3. From the Project list, select the ASP .NET project to use.
4. From the Connection list, select a database connection profile. To create and use a new connection profile, click the New button and complete the text boxes.
5. From the Table list, select the database table to use.
6. From the Primary Key list, select the primary key of the database table.
7. Click Next.
8. Specify a .NET class name, or accept the default value.
9. Choose either C# with Web Services or VB with Web Services as the server language.
10. Click Next.
11. (Optional) Deselect any of the listed table fields to exclude them from the generated Flex DataGrid control.
12. Click Finish.
13. Select Run > External Tools > Run As > Run on Server.
14. Select Run > Run to run the application on the server.

Directory structure and deployment considerations for ASP .NET

When you run Project > Export Release Build, files are saved in the project bin_release directory and the optimized application runs from that location.

Generating a J2EE database application

You can generate an application that uses Java and a SQL database. To generate this type of application, you must have a local Java application server and access to a target SQL database table. You can generate an application that uses a Java servlet to access a database and return data to the Flex application; or if you have LiveCycle Data Services ES, you can choose to generate an application that uses the data management service to access a database and dynamically distribute data to and from clients.
Generate J2EE application code
1. If you have not already done so, create a new Flex project that specifies Java 2 Enterprise Edition (J2EE) as the application server type.
2. Select Data > Create Application from Database.
3. From the Project list, select the J2EE project to use.
4. From the Connection list, select a database connection profile. To create and use a new connection profile, click the New button and complete the text boxes.
5. From the Table list, select the database table to use.
6. From the Primary Key list, select the primary key of the database table.
7. Click Next.
8. To use a specific Java package for the Java classes that will be generated, enter the package name in the Java Package text box.
9. By default, the names of the generated Java classes are prefixed with the name of the selected database table. To use a different prefix, enter it in the Class Name Prefix text box.
10. If your project uses LiveCycle Data Services ES, select whether to use LiveCycle Data Services ES or XML over HTTP for communication between the client and the server. If you select LiveCycle Data Services ES, the Data Management Service is used. If you select XML over HTTP, a servlet passes XML between the client and the server.
11. Click Next.
12. (Optional) Deselect any of the listed table fields to exclude them from the generated Flex DataGrid control.
13. Click Finish.
14. Select Run > External Tools > Run As > Run on Server.
15. Select Run > Run to run the application on the server.
Directory structure and deployment considerations for J2EE
The Flex Builder project's WebContent directory contains directories to be deployed into the root directory of the web application. Depending on the type of Java application server, the web application is deployed as a WAR file or, as is the case with Tomcat, as a linked web application directory. The Flex Builder project's src directory contains Java source files for classes that are deployed to the WEB-INF/classes directory of the web application. For projects that are compiled with Flex Builder, the contents of the Flex Builder project's bin and flex_src directories are included in the list of files that are deployed to the web application; however, the compiled SWF files are deployed rather than the corresponding MXML files that are in the flex_src directory. All of the files in those folders are deployed to the root of the web application.

Generating a PHP database application in flex

You can generate an application that uses PHP and a MySQL database. To generate this type of application, you must have a local PHP server and access to a target MySQL database table.

Generate PHP application code

1. If you have not already done so, create a Flex project that specifies PHP as its application server type.
2. Select Data > Create Application from Database.
3. From the Project list, select the PHP project to use.
4. From the Connection list, select a database connection profile. To create and use a new connection profile, click the New button and complete the text boxes. For more information, see Directory structure and deployment considerations for PHP.
5. From the Table list, select the database table to use.
6. From the Primary Key list, select the primary key of the database table if it is not already selected.
7. Click Next.
8. Specify a Main Source Folder and a Main Application File, or accept the default values. You can generate the PHP files in the bin-debug folder, which is the default location, or in the src folder. If you want to export the project after using the data wizard, you must generate the PHP files in the src folder; otherwise, the project is exported without the PHP files and does not function.
9. Click Next.
10. Deselect any database columns that you do not want to appear in the DataGrid that the wizard generates.
11. Choose a database filter column, or accept the default value.
12. Click Finish.
13. Select Run > External Tools > Run As > Run on Server.
14. Select Run > Run to run the application on the server.

Directory structure and deployment considerations for PHP

When you use the data wizard to generate a PHP application, the default location of the generated files is the [web_server_root]\[project_name]_debug directory. The directory includes a PEAR subdirectory that contains the PEAR XML parsing utility, and a history subdirectory that contains files for Flex history management.

The main deployment directory contains tablename.php, databasenameconn.php, functionsinc.php, and XmlSerializer.class.php PHP files. It also contains a SWF file named tablename.swf and an HTML wrapper named tablename.html.

The project src directory contains the following files: tablename.mxml, tablenameconfig.as, and tablenamescript.as.

Deploy an application to a remote server

1. Set up the host:
1. Create a new database. Typically, the host has a naming convention like sitename_dbname.
2. Create a web user with a password (for example, name: bigryans_webuser, pw: webuser). Give the web user the following privileges: insert, update, delete, and select.
3. Create the database table or tables (you can export the SQL and run it in your MySQL administrator application, or you can create it manually); for example:

CREATE TABLE users (
userid int(10) unsigned NOT NULL auto_increment,
username varchar(255) collate latin1_general_ci NOT NULL,
emailaddress varchar(255) collate latin1_general_ci NOT NULL,
PRIMARY KEY (userid)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;


2. Edit the Flexphpconn.php file. This file creates the connection to the database for your Flex application users:

$hostname_conn = "localhost"; // If your database and Flex app are on the same server $database_conn = "bigryans_flexphp"; // name you gave it in step 1 $username_conn = "bigryans_webuser"; // name you created in step 1 $password_conn = "webuser"; // password you gave it in step 1


3. Upload the files. You need the following subset of the files that the wizard outputs:
* /history directory (if you want to support history management/deep linking)
* /PEAR directory
* AC_OETags.js
* Flexphpconn.php
* functions.inc.php
* playerProdInstall.swf (if you want to support express installation)
* Flex application files:
o users.html (HTML wrapper)
o users.swf (Flex application)
o users.php (PHP functions for the Flex application)
o XMLSerializer.class.php

You do not need to upload the xxx-profile.swf files, the projectname.swf file, or the projectname.html file.

Wednesday, June 17, 2009

simple calculator

This is a simple calculator designed in flex. This has only four operations.Those are written a action script. Add,subract,multiply and division operations.you can use this component for simple calculations.Try this


simple calculator.rar

My videos-Glow Effect

Tuesday, March 3, 2009

Notable sites using Flex

Flex Application Development Process

Everything below is directly sourced from the help file in version 2.0:

  • Define an application interface using a set of pre-defined components (forms, buttons, and so on)
  • Arrange components into a user interface design   
  • Use styles and themes to define the visual design
  • Add dynamic behavior (one part of the application interacting with another, for example)
  • Define and connect to data services as needed 
  • Build the source code into an SWF file that runs in the Flash Player

LiveCycle Data Services

LiveCycle Data Services (previously called Flex Data Services) is a server-side complement to the main Flex SDK and Flex Builder IDE and is part of a family of server-based products available from Adobe. Deployed as a Java EE application, LiveCycle Data Services adds the following capabilities to Flex applications:
            Remoting, which allows Flex client applications to invoke methods on Java server objects directly. Similar to Java remote method invocation (RMI), remoting handles data marshalling automatically and uses a binary data transfer format.
            Messaging, which provides the "publish" end of the "publish/subscribe" design pattern. The Flash client can publish events to a topic defined on the server, subscribe to events broadcast from the message service. One of the common use cases for this is real-time streaming of data, such as financial data or system status information.
            Data management services, which provides a programming model for automatically managing data sets that have been downloaded to the Flex client. Once data is loaded from the server, changes are automatically tracked and can be synchronized with the server at the request of the application. Clients are also notified if changes to the data set are made on the server.
            PDF document generation, providing APIs for generating PDF documents by merging client data or graphics with templates stored on the server.

Flex-Flexible

                      I think we need a small introduction about Flex.The name itself says.Yes Flex is Flexible...

So what is Flex? 

                 Flex applications are Rich Internet Applications that are built using tools from Adobe. These Flex applications run inside the Flash player, leveraging the existing installed base of the Flash player.

                Flex is made up largely of two parts. The first is an IDE built on the open source Eclipse platform. That tool is called Flex Builder 2.0.As well, an SDK will be made available to developers who want to build Flex applications. The SDK will include the Flex compiler, giving developers who code by hand (without the IDE) the ability to create Flex applications. The other part of Adobe Flex is Adobe Flex Enterprise Services.

               

Rich Internet Applications

Hi  Hi  Hi...
                    I'm always a learner and I want to learn more and more from anybody who has the stuff. Be Ready to experience a Rich Ride with this Rich Internet Applications.
                    AJAX is popular for the creation of rich Internet applications, but there are good alternatives. This article will introduce you to Flex applications, rich Internet applications that run inside the Adobe Flash player.

                   The development of Rich Internet Applications is now underway. Some people are calling this "Web 2.0," but it is really the transition from a page based browsing experience to one that more closely resembles desktop applications. A variety of technologies can be used to deliver this experience; AJAX is currently one of the more popular sets of technologies, mainly because it can be easily adapted into existing web based applications.

                   However, for those who are looking for something more robust, there appears to be two early front runners: Flex based applications that run in the Flash player from Adobe, and XML based applications from Microsoft. In this article, I'll introduce you to Adobe's Flex product line, including Adobe Flex Builder and Adobe Flex Enterprise Services.

A Turning Point...

Hello Everyone,                       

                        Today (2-3-2009) I joined the chipkidz team to work as an Individual.I got this oppurtunity by the chipkidz team.Do U know the meaning of Individual?Individual refers to a person or to any specific object in a collection. In the 15th century and earlier, and also today within the fields of statistics and metaphysics, individual means "indivisible", typically describing any numerically singular thing, but sometimes meaning "a person". From the seventeenth century on, individual indicates separateness, as in individualism.[1] Individuality is the state or quality of being an individual; a person separate from other persons and possessing his or her own needs, goals, and desires.

                        The first thing I learned from them is "Brand yourself ".Yes I am here to Brand myself. I'm in Tenth Planet. U all know that there are only nine planets in the solar family. Do u know why this name has come. They want to do only new things which are not currently present. Yes U are correct. We are gonna create Future Technologies.

                        Oh! sorry. I think I'm boring You.Let us start sharing my diary.We have lot of teams to innovate more.My team name is "Earth". Yes I got a place in earth.Our work is to create user friendly help desk which should satisfy all end-users who are using that.I like to help people... haha... Believe me...

                                  Meet you in my next Blog..........