Wednesday, June 27, 2007

Cairngorm video tutorial

http://www.brightcove.com/title.jsp?title=823354922&channel=5957394

here is document

Flex 3:Feature Introductions: Flex 3 RSLs

Flex 3:Feature Introductions: Flex 3 RSLs

Cairngorm 2.1 Store live example ( Flex, amfphp, Cairngorm )

files needed before running.
amfphp 1.2
RemoteObjectAMF0 - (Flex 2 / Flash Player 9)
Cairngorm 2.2.1 Beta Binary (SWC) more ref, see here

how to
1) make RemoteObjectAMF0 component
unzip renaun_com_RemoteObjectAMF0.zip , u will find src directory, use flex builder
to create new library project RemoteObjectAMF0_comp inside the src folder, then
right click project->properties -> Flex Library Build Path ->Assets , check the
manifest.xml, then select Flex Library Compiler on left side panel , add
additional compiler arguments:

-namespace http://renaun.com/flex/rpc "manifest.xml"
-include-namespaces http://renaun.com/flex/rpc

2) create renaun_com_RemoteObjectAMF0 flex project
right click project->properties -> Flex Build Path -> Add SWC
select the Cairngorm swc and RemoteObjectAMF0_comp swc

3) set CairngormStoreWebMain.mxml as Default application

compile and run it.
here is the live example

Tuesday, June 26, 2007

Flex,PHP, MYSQL example

http://blogs.adobe.com/mikepotter/2006/06/download_a_flex_1.html

Download a Flex / PHP Framework, with Source Code
Digg This!
When we were at the New York PHP Conference last week, one of the things that struck me was how hard it was to get started with Flex and PHP. You have to go to one site to download Flex Builder, then to another site to download AMFPHP, then build out your application, deploy it etc...

I thought I could help out, so I built a small framework that includes AMFPHP along with some sample files. The Flex application simply displays information from a MySQL database in a Flex application. Very simple. Here's how you, as a PHP developer, get started:

1. Download the Flex / PHP Framework .zip file.

2. Extract the .zip file in your website. The files must be put in a directory called flex_project in your web server's root directory (ie. /flex_project) (the .zip file should create the flex_project automatically, so you should just extract to the root dir.).

3. Create a database called sample, and populate it with the data from sample.mysql in the flex_project directory.

4. Modify the line $mysql = mysql_connect(...); in the file flex_project/amfphp/services/sample.php to be able to connect to your database.

5. Visit http://localhost/flex_project/amfphp/services/sample.php. (Change localhost if you haven't installed on a local machine). You should see some output.

6. Visit http://localhost/flex_project/bin/flex_project.html to see the Flex application in action. You will need Flash Player 9 for this to work properly.

To modify the backend PHP code, you'll want to change the file in flex_project/amfphp/services/sample.php

To modify the front end Flex code, you'll want to download Flex Builder, create a new Flex project with the source of it as the flex_project directory. Then, modify the flex_project/flex_project.mxml file. When you save that file, it will update the .swf file in the bin/ directory, so reloading http://localhost/flex_project/bin/flex_project.html should show you an updated application.

One thing to note that I've changed in this compared to other uses of Flex and AMFPHP. In AMFPHP, I commented out the following lines in amfphp/app/Filters.php:
$outHeader = new AMFHeader("AppendToGatewayUrl", false, "?" . ini_get('session.name') . "=" . $session_id);
$amf->addOutgoingHeader($outHeader);

I'm not too sure what that was doing, but it was calling an ActionScript function AppendToGatewayURL that was blank in my previous tutorials. Doing this removed the need to create a RemotingConnection.as file in your Flex Project. You'll notice this because the connection to gateway.php now looks like this:

gateway = new NetConnection();
gateway.objectEncoding = flash.net.ObjectEncoding.AMF0;
gateway.connect( "/flex_project/amfphp/gateway.php");
gateway.call( "sample.queryDatabase", new Responder( onResultQueryDatabase, onFault ) );

Hopefully this .zip file is helpful for PHP developers. It shouuld be relatively easy to extend this sample to include the ability to create, update and delete elements from the database. If you do that, please send me an updated .zip file to post on this site.

Explicit support for Module base application

http://bkflex.wordpress.com/2007/06/25/explicit-support-for-module-base-application/

magine if your application has 1000 or more pages with high end graphics and animation. You must think about performance. The simple answer is module base application.

Module, It was really great feature of “flex 2.0.1 hot suffix 2.0 SDK” but in flex builder 2.0 was not having explicit support for Module based application. Therefore we have to make separate modules, compiling report.xml, then recompile all the modules ….. ohhhh that was really frustrating process.

But now flex 3.0 has explicit support of module based application. That means flex builder itself will handle all this process. Here I have tried to explain how flex builder 3.0 supports modules.



Create Module more easily

To create new module just right click on your project and select new module. It will ask you name of the module. There is one other combo box with label of optimize size for application. Now this is some thing really good in flex builder 3.0. This feature will generate report.xml file and optimize your application for selected application.

This action will add tryThisOut.mxml module to your project.


Tip

If you are creating 100% liquid module which should fit in to your module loader container, then you have to use percentageWidth and percentageHeight properties of module class. Check below image

Now when you press ctrl +b or press “Build all buttons”, it will generate tryThisOut.swf file in your output folder. Then after you can load this module wherever you require.

Manage modules

Flex 3.0 adds modules to project when you create new one. But if you want to copy and paste module from other project to your current project you have to add manually. To do that just right click on current project on navigator window then after click on property button at the bottom of the pop up menu. You will find module link on open dialog box. There is one button “add” on right side. You can simply add module. You can also edit existing module from the same window.

Debug modules

You have to just allow modules for debugging by clicking on enable debugging modules. That will allow you to debug your modules

Hope this will help you.

Find more about modules @ http://bkflex.files.wordpress.com/2007/06/modular.pdf

Rock on module :-)