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.


1
2
3
4
5
6
7
8
9
10
11
12
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

1
mouseDown

or

1
mouseMove

and then add both

1
dragEnter

and

1
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:

1
2
3
4
5
6
7
8
< ?xml version="1.0" encoding="utf-8"?>
<s:viewnavigatorapplication xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    firstView="views.FXGSplashHomeView"
    preloader="CustomSplashScreen"
    splashScreenMinimumDisplayTime="3000"
    applicationDPI="160">
</s:viewnavigatorapplication>

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package
{

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

    import spark.preloaders.SplashScreen;

    use namespace mx_internal;
    public class CustomSplashScreen extends SplashScreen

    {
        public function CustomSplashScreen()
        {
            super();
        }

        override mx_internal function getImageClass(dpi:Number, aspectRatio:String):Class
        {
            return Class(splash);
        }
    }
}

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

1
2
3
4
5
6
7
8
9
10
11
< ?xml version="1.0" encoding="UTF-8"?>
<graphic xmlns="http://ns.adobe.com/fxg/2008"
        xmlns:d="http://ns.adobe.com/fxg/2008/dt"
        xmlns:fc="http://ns.adobe.com/flashcatalyst/2009"
        version="2.0">
    <path y="1" data="M 0 10 L 40 10 L 35 0 L 9 15 L 35 30 L 40 20 L 0 20 z">
        <fill>
            <solidcolor color="#0000FF" alpha="0.6"/>
        </fill>
    </path>
</graphic>

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):

1
2
3
4
5
6
// 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 composition:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?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 {
   
    function __construct() {
   
    }
   
    public function 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 connection errors
        $result = Zend_Auth::getInstance()->authenticate($adapter);
       
        return $result;
    }
}

Here’s the adapter class:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?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 {
   
    protected static $_instance = null;
   
    /**
     * private!
     * @param My_Db_Adapter $adapter
     */
    public function __construct(Zend_Db_Adapter_Abstract $adapter = null) {
       
        if (!$adapter)
            $adapter = new Zend_Db_Adapter_Mysqli(
                array(
                    'dbname' => 'test',
                    'username' => 'root',
                    'password' => '')
            );    
   
        parent::__construct($adapter);
       
        $this
            ->setTableName('users')
            ->setIdentityColumn('username')
            ->setCredentialColumn('password')
        ;
       
        // just for testing
//        $this
//            ->setIdentity('username')
//            ->setCredential('password')
//        ;
    }
   
    /**
     * @return  My_Db_Adapter
     */
    public static function getInstance()
    {
        if (null === self::$_instance) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }
   
    public function authenticate() {

        $_authResult = parent::authenticate();
           
        // NOTE: The point is that $result->_identity is an OBJECT (of type stdClass), NOT string
        // with Zend_Auth_Adapter_DbTable it is internally accomplished by calling its getResultRowObject() method
        // It constructs the stdClass with properties named after table attributes
   
//        $user = new stdClass();
//        $user->role = "administrator";
//        $user->username = $_authResult->getIdentity();
       
        $identity = $this->getResultRowObject();
       
        $result = new Zend_Auth_Result($_authResult->getCode(), $identity);
       
        return $result;
    }
}

MyService.php class. Here it is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?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 parameters (role, resource - class name, privileges - it's function name in this class)
       
        // administrator
        $acl->allow('administrator', 'MyService', 'helloWorld');
        $acl->allow('administrator', 'MyService', 'getData');
       
        // user
        $acl->allow('user', 'MyService', 'helloWorld');
        $acl->deny('user', 'MyService', 'getData');
       
        //returning true to signal that we want to check privileges before accessing methods of this class
        //in my tests if we don't return anything it will treat it like we will return false so better return true or false
        //your intentions will be clear
        return true;
    }
       
    /**
     * Hello world method
     */
    public function helloWorld(){
        return "Hello world from MyService service";
    }  
   
    /**
     *
     * Returns data
     * @return [int]
     */
    function getData()
    {
        $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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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();

 

            // Initialization customization goes here
            _serviceControl.endpoint = "http://localhost/myapp/gateway.php";
        }
       
        public function setCredentials(username:String, password:String, charset:String=null):void
        {
            _serviceControl.setCredentials(username, password, charset);
        }
       
        public function setRemoteCredentials(username:String, password:String, charset:String=null):void
        {
            _serviceControl.setRemoteCredentials(username, password, 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:

1
2
3
4
5
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 authentication:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--
-- 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 ;

--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `password`, `role`, `firstname`, `lastname`, `email`) VALUES
(1, 'user1', 'pass1', 'administrator', '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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class Auth extends Zend_Amf_Auth_Abstract
{
    const LOGGEDIN_ROLE = 'loggedin';
 
    public function authenticate()
    {
        $identity = new stdClass();
        $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, $identity);
    }
}

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.

1
2
3
4
5
6
7
8
9
10
11
12
$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.

File uploads with Adobe Flex and Zend AMF

Leonardo França writes; Zend AMF is an imple­men­ta­tion done in PHP to work with the com­mu­ni­ca­tion pro­to­col binary AMF (Action Mes­sage For­mat) and is part of Zend­Frame­work. I had to imple­ment a sys­tem to upload files that were a lit­tle dif­fer­ent than what is typ­i­cally used in Flash, with this fea­ture had to be inte­grated into the Zend AMF.
Research­ing a lit­tle on the net, found a solu­tion that was sim­pler than I thought based on that arti­cle with a few adjust­ments.
Begin with our gate­way to be used as end­point in Adobe Flex.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
    require_once 'Zend/Amf/Server.php';
    require_once 'Zend/Amf/Exception.php';
    require_once 'br/com/leonardofranca/vo/FileVO.php';
    require_once 'br/com/leonardofranca/UploadZendAMF.php';
           
    $server = new Zend_Amf_Server();
    $server->setProduction(false);
           
    $server->setClass('UploadZendAMF');
              $server->setClassMap('FileVO',"br.com.leonardofranca.vo.FileVO");
       
    echo($server->handle());
?>

Read more at; File uploads with Adobe Flex and Zend AMF — Work­flow: Flash.

Shine MP3 Encoder on Alchemy

Shine (formely 8hz-MP3) is a sim­ple light­weight C-based MP3 encoder made by LAME devel­oper Gabriel Bouvigne.

Descrip­tion of Shine on his website:

The goal of this encoder was not qual­ity, but sim­plic­ity. I tryed to sim­plify the encod­ing process as much as pos­si­ble. So Shine is then a good start­ing point when a pro­gram­mer needs a very sim­ple MP3 encoder

This Alchemy port features:

  • MP3 encod­ing of mono and stereo WAVs (no time limit)
  • non-blocking encod­ing for progress sta­tus in flash
  • errors auto­mat­i­cally sent to flash for easy log/debug

via flash-kikko.

Tags: , , , ,
Posted in AIR Android Development Flash Flex by Danny Froberg. No Comments
Get Adobe Flash player