ClamAV as a Validation Filter in Zend Framework

Matthew Set­ter writes a very inter­est­ing arti­cle; Ok, so you’re pretty com­fort­able with using the Zend Frame­work, specif­i­cally the use of Forms. Along with that, you have a good work­ing knowl­edge of how to com­bine a host of stan­dard val­ida­tors such as Cred­it­CardEmailAd­dressDb_RecordExists, and Hex, and stan­dard fil­terssuch as Compress/DecompressBase­NameEncrypt, and Real­Path. But what do you do when a sit­u­a­tion arises that’s out­side the scope of the pre-packaged val­ida­tors and filters?

Let’s say you want to guard against users upload­ing files that con­tain viruses, for exam­ple. You would have to write a cus­tom val­ida­tor that checks the uploads aren’t infected. Today I’ll show you how to do just that – how to write a new file val­i­da­tion fil­ter for Zend Frame­work that uses Cla­mAVto ensure uploaded files are virus-free.

Adding Cla­mAV Sup­port to PHP

First you’ll need to install Cla­mAV sup­port. I’m bas­ing this instal­la­tion pro­ce­dure around Linux, specif­i­cally Ubuntu. If you’re using another dis­tri­b­u­tion, you may need to adjust the com­mands accord­ingly. Unfor­tu­nately, if you’re using Win­dows how­ever, you’ll need to use a Linux-based Vir­tual Appli­ance or setup a vir­tual machine run­ning Linux to fol­low along since the php-clamav exten­sion doesn’t sup­port Win­dows as yet.

Full Story with Source » php­mas­ter.

Hackix #JS #sopastrike #SOPAblackout #sopa

HackIX joins #sopas­trike#SOPAblack­out #sopa and blacks out site on the 18th.

For more info  http://sopastrike.com/

Posted in Uncategorized by Danny Froberg. No Comments

Zend Server 5.6 is out

Kevin Schroeder writes; Zend Server 5.6 is out.  I’m actu­ally pretty stoked about this release.  Here’s a few rea­sons why.

  1. Zend Server CE now con­tains the full Zend Server stack.  Why do I find this excit­ing?  Because the upgrade path from CE to the full ver­sion is stu­pid easy.  That means you can try out all of the fea­tures in Zend Server and if you don’t want them, just let the license expire.  I call it a gate­way drug.  Seri­ously.  Get Stu­dio or PDT and try the deploy­ment fea­ture.  If you’re not using it you’ll ask your­self “why am I not doing this?”
  2. All of you Mac users can finally stop bitch­ing and com­plain­ing about the lack of Mac sup­port.  We don’t (and prob­a­bly won’t) sup­port Mac for pro­duc­tion (does any­one besides Apple actu­ally use their server prod­ucts in pro­duc­tion?) but for dev work you now get the full stack on your Mac.  This is not GA yet but will be later on.  If you want a pre­view release you can go to http://forums.zend.com/viewtopic.php?f=8&t=26873 .
  3. Fault tol­er­ance in the Job Queue through MySQL clus­ter­ing.  In clus­tered envi­ron­ments job queue infor­ma­tion has moved from local stor­age to remote MySQL stor­age.  So you can have a sin­gle MySQL server sit­ting there, a clus­tered setup or RDS or some other cloud-based DB, it doesn’t mat­ter.  If it can be accessed using the MySQL dri­vers then it can be used by the new Job Queue.

via ESchrade — Pure PHP Good­ness.

How To Take Screenshot on the iPad2

If you are see­ing some­thing inter­est­ing on the iPad screen that you would want to cap­ture. Screen­shot is quite use­ful, espe­cially if you have an error on your device and you want to cap­ture an image so that later you could show it to a sup­port tech and they could assist you in fix­ing the issue.

Heres how:

1. While you are look­ing at the screen press Sleep/Wake + Home but­ton and quickly let go of the buttons.

You will see the screen quickly flashes indi­cat­ing that it has taken the screen­shoot. Your cap­ture should now be placed in the Cam­era Roll album. To view the image go into the album and open it up.

Once you have the image you could email it.

Tags: , , ,
Posted in Development iOS by Danny Froberg. No Comments

Connecting to PHPCloud.com through Zend Studio 9

PHPCloud.com is the land­ing page for our new cloud offer­ing.  Using the Zend Appli­ca­tion Fab­ric you can build your appli­ca­tions in the same envi­ron­ment as you will be deploy­ing your apps to.  The appli­ca­tion is built on my.phpcloud.com and you can then deploy it onto any plat­form where the Fab­ric is supported.

But how do you get started?  Phpcloud.com has been built in a way where you can con­nect with any IDE.  With Zend Stu­dio 9 that con­nec­tiv­ity has been built directly in to the IDE.

Get­ting started is actu­ally quite easy.

via Read here for the full details.

Tags: , ,
Posted in Cloud Development PHP Zend Studio by Danny Froberg. No Comments

How to create custom MouseEvent.CLICK event in AS3 (pass parameters to function)?

Matt W answers;
Take advan­tage of the dynamic func­tion con­struc­tion in AS3.


private function myCallbackFunction(e:Event, parameter:String):void
{
     //voila, here's your parameter
}

private function addArguments(method:Function, additionalArguments:Array):Function
{
     return function(event:Event):void {method.apply(null, [event].concat(additionalArguments));}
}

    var parameter:String = "A sentence I want to pass along";
    movieClip.addEventListener(Event.COMPLETE, addArguments(myCallbackFunction, [parameter] ) );
Tags: , ,
Posted in AIR Development Flash Flex by Danny Froberg. No Comments

Creating a Windows AIR Native Extension with Eclipse

Nick Kwiatkowski cre­ated a few very inter­est­ing posts with video tuto­ri­als, he writes; The sec­ond I heard about Adobe giv­ing us the abil­ity to cre­ate our own exten­sions to the Flash Plat­form in AIR 3.0, I was smit­ten. It was finally a way that we could add our own fea­tures and do the things that were high pri­or­i­ties on our lists, but not on Adobe’s. I knew I was look­ing for fea­tures that were one-offs (how many peo­ple today really need access to the COM ports), but they were forc­ing me to do all sorts of weird workarounds like launch­ing proxy appli­ca­tions to do seem­ingly sim­ple tasks.

AIR 3.0 got released a few weeks ago and I’ve jumped in head first into cre­at­ing some ANEs (AIR Native Exten­sions). For those of you who don’t know, ANEs are pack­aged exten­sions that con­tain operating-system spe­cific code (DLLs for Win­dows, Libraries for MacOS, Java classes for Android and Objective-C for iOS), that allow you to do things that the Flash Player wasn’t able to do.

Unfor­tu­nately, Adobe assumed that if you were devel­op­ing DLLs for Win­dows, you were going to be using Visual Stu­dio and noth­ing more. This didn’t make a whole lot of sense in my mind as they’ve been lever­ag­ing Eclipse for all of their tool­ing, and Eclipse does offer some great C/C++ addins. Now, that being said, Visual Stu­dio is by far the more feature-full and hands-down the best edi­tor for enabling these kinds of work­flows on Win­dows. It is, how­ever, very costly and even though Microsoft offers a free ver­sions, it takes over your com­puter by installing debug ver­sions of most of Microsoft’s shared libraries mak­ing your com­puter slower and more crash prone.

I wanted to use Eclipse’s CDT addin with the stan­dard GCC tool­ing that is avail­able on pretty much every oper­at­ing sys­tem. By using GCC, I was able to make very portable code that with min­i­mal effort was able to com­pile on all three of the major OSs (Win­dows, Mac, Linux). Adobe’s doc­u­men­ta­tion was lit­tle help in get­ting this going (even if you were cod­ing in Visual Stu­dio, there is very lit­tle guid­ance on how to get things setup). I do have to note that with my setup there is one dis­tinct dis­ad­van­tage — the lack of abil­ity to debug the DLL when it is launched from AIR. You will have to write your own C/C++ har­ness to do test­ing on your code in order to test it. If you use the Visual Stu­dio tool­ing, you CAN debug any DLL while it is run­ning (this is why Microsoft replaces the shared libraries on your sys­tem to allow that debugging).

I’ve cre­ated a four part video series doc­u­ment­ing how to get going cre­at­ing ANEs. Part 1 cov­ers set­ting up your envi­ron­ment, includ­ing installing CDT, the com­piler, and get­ting Eclipse setup to do your pro­gram­ming. Part 2 cov­ers actu­ally cod­ing the C/C++ code for your Win­dows DLL. Part 3 cov­ers cre­at­ing your ANE, and pack­ing up all the stuff needed to make it work. And Part 4 cov­ers how to use your new ANE in an AIR project.

Watch the Video » Part 1 « QueT­wos Blog.

Tags: , , ,
Posted in AIR Development Flash Flex Videos by Danny Froberg. No Comments

Drag-and-Drop in Flex 4

UPDATE: I have another Drag-and-Drop Revis­ited post that cov­ers even more drag-and-drop func­tion­al­ity avail­able in Flex 4.

The Flex 4 gods were kind to us devel­op­ers when they made the great deci­sion to leave the cus­tom drag-and-drop sup­port unchanged. We just do what we’ve always done: detect the user is try­ing to drag some­thing via mouseDown or mouseMove and then add both dragEnter and dragDrop event han­dlers to the drop tar­get. So there is noth­ing in this post that’s not basi­cally iden­ti­cal to Flex 3, except the cool­ness of FXG (which you can eas­ily mimic with Degrafa in Flex 3).

Sim­ple Drag-and-Drop

via Drag-and-Drop in Flex 4 « Sat­urn­boy.

Tags: , , ,
Posted in AIR Development Flash Flex by Danny Froberg. No Comments

Splash screen with FXG in Mobile applications with Flash Builder for PHP

ahillman3 on Stack Over­flow wrote this (and won my hero of the day award); OK, the pri­mary focus for your solu­tion is the pre­loader attribute on a mobile appli­ca­tion. See the preloader=“CustomSplashScreen” below:

< ?xml version="1.0" encoding="utf-8"?>
xmlns:s="library://ns.adobe.com/flex/spark"
firstView="views.FXGSplashHomeView"
preloader="CustomSplashScreen"
splashScreenMinimumDisplayTime="3000"
applicationDPI="160">


The Cus­tom­Splash­Screen extends and over­rides the spark.preloaders.SplashScreen class, and the getIm­age­Class func­tion.

package
{

import mx.core.DPIClassification;
import mx.core.mx_internal;

import spark.preloaders.SplashScreen;

use name­space mx_internal;
pub­lic class Cus­tom­Splash­Screen extends SplashScreen

{
pub­lic func­tion Cus­tom­Splash­Screen()
{
super();
}

over­ride mx_internal func­tion getImageClass(dpi:Number, aspectRatio:String):Class
{
return Class(splash);
}
}
}

The splash in the return Class(splash), is a sim­ple fxg file, like so:

< ?xml version="1.0" encoding="UTF-8"?>
xmlns:d="http://ns.adobe.com/fxg/2008/dt"
xmlns:fc="http://ns.adobe.com/flashcatalyst/2009"
version="2.0">





That’s all there is to it. Have fun!

– Allen

via .

Flex wrappers for MadComponents

Daniel Free­man writes; I’ve had feed­back from a few devel­op­ers want­ing a way to com­bine Mad­Com­po­nents with Flash Builder 4.5 for mobile.  I intended Mad­Com­po­nents as a ligh­weight alter­na­tive to using the Flex frame­work.  So while I don’t really like the idea of mix­ing them – it’s cer­tainly pos­si­ble to incor­po­rate Mad­Com­po­nents within an MXML lay­out.  All it takes is a few cus­tom com­po­nent wrappers.

Note: I’ve now put the code for these wrap­pers into the SVN code repos­i­tory.

Note: I’ve now put the code for these wrap­pers into the SVN code repository.

via MobileAp­pDev.

MadComponents AMF Service Test Drive for Mobile

Daniel Free­man writes; In this final Mad­Com­po­nents tuto­r­ial we’re going to look at the third and final Flash Builder 4.5 tuto­r­ial (from here), and do it the Mad­Com­po­nents way.  Adobe’s Flex Test Drive for Mobile: Build a mobile appli­ca­tion in an hour, takes you through build­ing an AMF web ser­vice, and then build­ing a mobile client appli­ca­tion that con­nects to that ser­vice.  We’re going to build the same appli­ca­tion using MadComponents.

AMF is a binary for­mat used to seri­alise Action­Script objects.  A binary AMF packet is usu­ally sig­nif­i­cantly smaller than REST XML or SOAP packet.  Hence AMF ser­vices are typ­i­cally much faster.

This tuto­r­ial assumes that you have some exper­tise in build­ing web ser­vices, using PHP, Cold­fu­sion, or Java.  But if you’d rather do a tuto­r­ial where the web ser­vice already exists, then have a go at build­ing a twit­ter client.

We rec­om­mend that you first take a look at the first six parts of this tuto­r­ial series, which will bring you up-to-speed with using MadComponents.

Read the entire tuto­r­ial at  Mad­Com­po­nents AMF Ser­vice Test Drive for Mobile « MobileAp­pDev.

Zend AMF Authentication & Authorization

dkozar evolved a work­ing method to Authen­ti­cate and Autho­rize a Flex based app datas ser­vice call using Zend AMF, he writes;

I’ve been strug­gling with it, and fig­ured it all out — so, per­haps it could help others.

The authen­ti­ca­tion is called on the server only if cre­den­tials sup­plied from the client (via the remote pro­ce­dure call head­ers). This snip­pet illus­trates the setup of cus­tom auth (these are the last 6 lines of gateway.php script):

// Handle request
$auth = new My_Amf_Auth(); // authentication
$server->setAuth($auth);
$acl = new Zend_Acl(); // authorization
$server->setAcl($acl);
echo $server->handle();

Now, your cus­tom auth should extend Zend_Amf_Auth_Abstract. Since I want to authen­ti­cate users from a data­base, I bring the Zend_Auth_Adapter_DbTable to play. But since I can­not extend both Zend_Amf_Auth_Abstract and Zend_Auth_Adapter_DbTable, I use a com­po­si­tion:

< ?php
require_once ('Zend/Amf/Auth/Abstract.php');

/**
* AMF auth class by Danko Kozar, dankokozar.com
* @author dkozar
*
*/
class My_Amf_Auth extends Zend_Amf_Auth_Abstract {

func­tion __construct() {

}

pub­lic func­tion authenticate() {

$adapter = My_Db_Adapter::getInstance();
$adapter->setIdentity($this->_username);
$adapter->setCredential($this->_password);

// the adapter call
// you can wrap it into try.. catch and process DB con­nec­tion errors
$result = Zend_Auth::getInstance()->authenticate($adapter);

return $result;
}
}

Here’s the adapter class:

< ?php
/**
* DB table adapter auth class for AMF by Danko Kozar, dankokozar.com
* @author dkozar
* Singleton
*/
class My_Db_Adapter extends Zend_Auth_Adapter_DbTable {

pro­tected sta­tic $_instance = null;

/**
* pri­vate!
* @param My_Db_Adapter $adapter
*/
pub­lic func­tion __construct(Zend_Db_Adapter_Abstract $adapter = null) {

if (!$adapter)
$adapter = new Zend_Db_Adapter_Mysqli(
array(
‘dbname’ => ‘test’,
‘user­name’ => ‘root’,
‘pass­word’ => ”)
);

parent::__construct($adapter);

$this
->setTableName(‘users’)
->setIdentityColumn(‘username’)
->setCredentialColumn(‘password’)
;

// just for test­ing
// $this
// ->setIdentity(‘username’)
// ->setCredential(‘password’)
// ;
}

/**
* @return My_Db_Adapter
*/
pub­lic sta­tic func­tion getInstance()
{
if (null === self::$_instance) {
self::$_instance = new self();
}
return self::$_instance;
}

pub­lic func­tion authenticate() {

$_authResult = parent::authenticate();

// NOTE: The point is that $result->_identity is an OBJECT (of type std­Class), NOT string
// with Zend_Auth_Adapter_DbTable it is inter­nally accom­plished by call­ing its getRe­sul­tRowOb­ject() method
// It con­structs the std­Class with prop­er­ties named after table attributes

// $user = new std­Class();
// $user->role = “admin­is­tra­tor”;
// $user->username = $_authResult->getIdentity();

$iden­tity = $this->getResultRowObject();

$result = new Zend_Auth_Result($_authResult->getCode(), $identity);

return $result;
}
}

MyService.php class. Here it is:


< ?php
/**
* PHP service class with authorization
* by Danko Kozar, dankokozar.com
* @author dkozar
*
*/
class MyService
{
/**
* from zend docs:
* If the ACL object is set, and the class being called defines initAcl() method,
* this method will be called with the ACL object as an argument.
* This method can create additional ACL rules and return TRUE,
* or return FALSE if no access control is required for this class.
*
* @param Zend_Acl $acl
* @return boolean
*/
public function initAcl($acl)
{
$acl->addRole(new Zend_Acl_Role("administrator"));
$acl->addRole(new Zend_Acl_Role("user"));

//acl “allow” method takes 3 para­me­ters (role, resource — class name, priv­i­leges — it’s func­tion name in this class)

// admin­is­tra­tor
$acl->allow(‘administrator’, ‘MySer­vice’, ‘hel­loWorld’);
$acl->allow(‘administrator’, ‘MySer­vice’, ‘getData’);

// user
$acl->allow(‘user’, ‘MySer­vice’, ‘hel­loWorld’);
$acl->deny(‘user’, ‘MySer­vice’, ‘getData’);

//returning true to sig­nal that we want to check priv­i­leges before access­ing meth­ods of this class
//in my tests if we don’t return any­thing it will treat it like we will return false so bet­ter return true or false
//your inten­tions will be clear
return true;
}

/**
* Hello world method
*/
pub­lic func­tion hel­loWorld(){
return “Hello world from MySer­vice ser­vice”;
}

/**
*
* Returns data
* @return [int]
*/
func­tion get­Data()
{
$arr = array(1, 2, 3);
return $arr;
}
}
?>

Note that the autho­riza­tion is being built dynam­i­cally inside the ini­tAcl method.

On the Flex side I have an auto-generated class (MySer­vice) which extends another auto-generated class (_Super_MyService).

The point is that the outer one is auto-generated only once (ini­tially), and you can mod­ify it, with­out wor­ry­ing to be over­writ­ten on ser­vice regeneration.

There’s a pro­tected prop­erty _serviceControl (which is of type Remo­teOb­ject) which could be tweaked if needed.

I’m tweak­ing it by of set­ting the end­point (with string read from a client side con­fig in preIni­tial­ize­Ser­vice() method). Plus, I’m adding 2 more meth­ods, which expose set­Cre­den­tials and setRemote­Cre­den­tials meth­ods of _serviceControl, so I can acces it from my code.


package services.myservice
{
public class MyService extends _Super_MyService
{
/**
* Override super.init() to provide any initialization customization if needed.
*/
protected override function preInitializeService():void
{
super.preInitializeService();

// Ini­tial­iza­tion cus­tomiza­tion goes here
_serviceControl.endpoint = “http://localhost/myapp/gateway.php”;
}

pub­lic func­tion setCredentials(username:String, password:String, charset:String=null):void
{
_serviceControl.setCredentials(username, pass­word, charset);
}

pub­lic func­tion setRemoteCredentials(username:String, password:String, charset:String=null):void
{
_serviceControl.setRemoteCredentials(username, pass­word, charset);
}
}
}


So, before call­ing MySer­vice meth­ods, I’m set­ting the cre­den­tials with set­Cre­den­tials() method and this runs the authen­ti­ca­tion on the PHP side:


private var service:MyService;
....
service = new MyService(); // ServiceLocator.getInstance().getHTTPService("presetLoader");
service.setCredentials("user1", "pass1");
var token:AsyncToken = service.getData();

The authen­ti­ca­tion via Zend_Amf_Server is, by the way, OPTIONAL! Mean­ing, with no cre­den­tials sup­plied, Zend_Amf_Server will NOT RUN IT. Thus you should rely on Zend_Acl (e.g. roles) to so your per­mis­sions and security!

Finally, here’s the MySQL DB table I’ve been using for authen­ti­ca­tion:

--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL,
`password` varchar(32) DEFAULT NULL,
`role` varchar(45) DEFAULT NULL,
`firstname` varchar(50) DEFAULT NULL,
`lastname` varchar(50) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;


– Dump­ing data for table ‘users‘

INSERT INTO ‘users‘ (‘id‘, ‘user­name‘, ‘pass­word‘, ‘role‘, ‘first­name‘, ‘last­name‘, ‘email‘) VALUES
(1, ‘user1’, ‘pass1’, ‘admin­is­tra­tor’, ‘Danko’, ‘Kozar’, NULL);

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cheers!
Danko

Adobe Forums

Authentication using Zend_Amf

Kevin Schroeder writes; I for­get why, but a few days ago I started doing some dig­ging around with authen­ti­ca­tion in Zend_Amf_Server. I had fig­ured that I would add an adapter to the Zend_Amf_Server::setAuth() method and that would be it.

But I was wrong.

AMF allows for mul­ti­ple request bod­ies to be sent at the same time. Of those there are sev­eral “spe­cial” types of com­mands. One of those com­mands is log­ging in. What this means is that you don’t need a method that logs some­one in for you. Zend_Amf_Server han­dles authen­ti­ca­tion sep­a­rately from your ser­vice classes.

Authen­ti­ca­tion for Zend_Amf_Server will gen­er­ally use a com­bi­na­tion of Zend_Auth and Zend_Acl com­po­nents. Zend_Auth is used to pro­vide the cre­den­tial ver­i­fi­ca­tion while Zend_Acl is used to val­i­date that the cur­rent user user can access the requested ser­vice method. It is actu­ally a rel­a­tively triv­ial task to restrict access to non-logged in users using the method that I will describe here.

The first step in the process is to cre­ate an authen­ti­ca­tion adapter. It really doesn’t mat­ter what you’re using. What mat­ters is that the adapter returns an iden­tity object with a prop­erty called “role”. The built in ACL han­dle expects this to be part of the iden­tity object.


class Auth extends Zend_Amf_Auth_Abstract
{
const LOGGEDIN_ROLE = 'loggedin';

pub­lic func­tion authen­ti­cate()
{
$iden­tity = new std­Class();
$result = Zend_Auth_Result::FAILURE;

// Do a proper login, y’all
if ($this->_username == ‘test’ && $this->_password == ‘test’) {
$identity->role = self::LOGGEDIN_ROLE;
$result = Zend_Auth_Result::SUCCESS;
} else {
$identity->role = Zend_Amf_Constants::GUEST_ROLE;
}

return new Zend_Auth_Result($result, $iden­tity);
}
}

The Auth class extends Zend_Amf_Auth_Abstract because Flex seems to require user­name and pass­words as being the only mech­a­nism for pass­ing cre­den­tials. The abstract class defines a method that hooks in with the spe­cial com­mands and passes the spe­cial cre­den­tials to the spe­cial adapter. Clearly your authen­ti­ca­tion mech­a­nism should be bet­ter than the one that I put in here, but you’ll get the idea. The most impor­tant part is adding the role prop­erty to the iden­tity object and pass­ing it to the Zend_Auth_Result object.

Then in your gate­way you need to add this adapter as well as cre­ate an sim­ple ACL.


$server = new Zend_Amf_Server();
$server->addDirectory(realpath(__DIR__.'/../services'));

$acl = new Zend_Acl();
$acl->addRole(Auth::LOGGEDIN_ROLE);
$acl->allow(Auth::LOGGEDIN_ROLE);
$server->setAcl($acl);

$auth = new Auth();
$server->setAuth($auth);

echo $server->handle();

This adds the new Auth role to the ACL and says that it has access to every­thing. Since there is no place where I allow guest access (denoted by Zend_Amf_Constants::GUEST_ROLE in the adapter) guest requests will be denied.

With just this lit­tle bit of code you now have a mech­a­nism that will pro­vide restricted access to all of your ser­vice objects.

via Kevin Schroeder’s blog — Zend Tech­nolo­gies.

SkinnableTextBase focusManager runtime error popup

writes somthing that will save you quite a bit of time if you get caught with this run­time error; When you show a popup in Flex in a mobile envi­ron­ment, defined as the style “inter­ac­tion­Mode” being set to InteractionMode.TOUCH in this con­text, that is based on a com­po­nent that does not imple­ment the mx.managers.IFocusManagerContainer inter­face, you will receive a run­time error when the user taps the con­trol that is to receive focus.

via Flex 4 Exam­ples.

Tags: , , ,
Posted in AIR Development Flash Flex by Danny Froberg. No Comments

Flex mobile in the browser

Flex mobile in the browserSince Flex 4.5, you have had the abil­ity to develop and export your projects as Android, iOS and Play­Book mobile appli­ca­tions that behave as native ones.

You can also export your Flex mobile project as AIR desk­top apps. Just open Flash builder, open your project and choose Project >  Export release build. You can then export a “Signed AIR pack­age for instal­la­tion on desk­top”, which means a clas­sic .air file. Yes­ter­day, a cus­tomer wanted to know how to run a Flex mobile appli­ca­tion in a desk­top web browser. Of course, I answered “Why would you do this ?”, and he gave me some good reasons.

His mobile appli­ca­tion is con­nected to a CMS on the back­end. Admin­is­tra­tors of the appli­ca­tion will be able to edit the con­tent of the mobiles apps in a web appli­ca­tion. Wouldn’t it be nice to get a live pre­view in the browser ? When you think of it, a Flex mobile project exports a SWF, so we should be able to run it as a web app. Of course, all the AIR APIs such as the accelerom­e­ter, or the SQLite access would be dis­abled, but we could have a live preview.

And it’s always a chal­lenge for a mobile devel­oper to demon­strate their work. Usu­ally, they just record and pub­lish a video of their app.

We’ll see in this tuto­r­ial how to cre­ate a Flex mobile project with Flash Builder 4.5.1, and how to pub­lish it as a clas­sic web appli­ca­tion. Just fol­low these steps:

via Flex mobile in the browser | RIAgora.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes