Backup of directories out of AIR application

Hi,
I´ve got an application that deals with pictures. I want
to have a simple backup-function just to put all folders with
images into a zip archive.
Is this posible with AIR and does anybody have an example or
link?
I´m developing in JS/HTML.
Thanks so far.

Yes it is possible, but not necessarily easy. AIR provides an
API that will handle the compression part of the job, but you have
to put together the ZIP file headers and such yourself. Possible
someone has already written an ActionScript library you could use
for this.
Here's a link to a Flex article that discusses the
compression API.
(added link)
http://www.adobe.com/devnet/air/flex/quickstart/compressing_files.html

Similar Messages

  • Opening a finder/windows explorer window from an AIR application?

    I'm evaluating AIR right now and going through as much
    documentation as I can find. Is there a way to open up an OS file
    browsing window? For instance, after writing a file to an arbitrary
    directory, could you open that director (preferably with the file
    selected) in OS X's Finder or Windows Explorer? Obviously this is
    possible in a native application (Lightroom does it, among others),
    but I can't figure out if it's possible with an AIR
    application.

    Take a look at:
    http://livedocs.adobe.com/air/1/devappsflash/help.html?content=splash.html
    http://livedocs.adobe.com/air/1/devappsflash/Filesystem_01.html
    AND
    http://livedocs.adobe.com/labs/air/1/aslr/flash/filesystem/File.html

  • How to Call a AIR application from Flex Application

    Hi,
        I have Used AIR (Desktop application) in Flex Builder to Upload a File from a local path and save it it a server path.
    I need to Call this AIR(Desktop application) from my Flex Application.... i.e
    I am using a link button to send a event using Script and Forward that Desktop application  from Flex Screen
    But it doesnot load that (Desktop application)  in Screen. Only Balnk screen is loaded from path
    Here is the code
    AIR(Desktop application)
    <?xml version="1.0" encoding="utf-8"?><mx:WindowedApplication 
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="openBrowseWindow();">
    <mx:HTTPService id="urlpath" showBusyCursor="true" useProxy="false" method="
    POST" url="http://localhost:8080/nat/FlexAction.do?method=UrlPath"result="pathresult(event)"
    fault="faultHandler(event)"
    >  
    </mx:HTTPService> 
    <mx:Script>
    <![CDATA[
    import mx.events.FileEvent; 
    import mx.rpc.events.ResultEvent; 
    import mx.rpc.events.FaultEvent; 
    import mx.utils.ObjectUtil;  
    import mx.controls.Alert;
    private  
    var openFile:File = new File() 
    private  
    function openBrowseWindow():void{openFile.addEventListener(Event.SELECT, onOpenFileComplete);
    openFile.addEventListener(Event.OPEN, load);
    openFile.browse();
    private  
    function load():void{Alert.show(
    "load"); 
    var imageTypes:FileFilter = new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg; *.jpeg; *.gif; *.png"); 
    //var textTypes:FileFilter = new FileFilter("Text Files (*.txt, *.rtf)", "*.txt; *.rtf"); 
    var allTypes:Array = new Array(imageTypes);openFile.browse(allTypes);
    private  
    function faultHandler(event:FaultEvent):void { 
    //Alert.show("Fault")Alert.show(ObjectUtil.toString(event.fault));
     private  
    function pathresult(event:ResultEvent):void{Alert.show(
    "res") 
    //Alert.show(ObjectUtil.toString(event.result));}private  
    function onOpenFileComplete(event:Event):void{ 
    //mx.controls.Alert.show("event: "+event.target.nativePath +"UR!!!"); 
    var pPath = event.target.nativePath; 
    var parameters:Object = {FlexActionType:"PATH",path:pPath};  
    // Alert.show("Image Selected from Path : "+pPath); urlpath.send(parameters);
    //Alert.show("Passed.."+parameters);}
    ]]>
    </mx:Script>
    <mx:Button click="openBrowseWindow();onOpenFileComplete(event)" name="Upload" label="Upload" x="120.5" y="10"/> 
    Here is Mxml Code for Flex Application
    <?xml version="1.0" encoding="utf-8"?><mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns="http://ns.adobe.com/air/application/1.0.M4" >
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert; 
    private function Upload():void{ 
    // CursorManager.setBusyCursor();  
    //var url:String = "HomeAction.do?method=onLoad"; 
    //var url:String = "assets/Air.swf"; 
    var url1:URLRequest = new URLRequest("assets/Air.swf");navigateToURL(url1,
    "_self"); 
    // CursorManager.removeBusyCursor(); }
    ]]>
    </mx:Script>
    <mx:LinkButton id="up" click="Upload()" x="295" y="215" label="UpLoad"/>
    In this code i forward using s url to Open tat  Desktop application but a blank screen appears with out the proper output...
    Please Help me in this to forward AIR from Flex Screen..
    Thanks in Advance
    With Regards
    Gopinath.A
    Software Developer
    First Internet Systems Pvt. Ltd.,
    Chennai

    try this
    http://www.leonardofranca.com/index.php/2009/09/17/launching-an-installed-air-application- from-the-browser/
    regards
    Leonardo França
    Adobe Certified Expert Flex 3 with AIR
    Adobe Certified Expert Rich Internet Application Specialist v1.0
    Adobe Certified Expert Flash CS3 Professional
    Certified Professional Adobe Flex 2 Developer
    Adobe Certified Professional Flash MX 2004 Developer
    http://www.leonardofranca.com
    http://twitter/leofederal
    Manager AUGDF - Adobe User Group do Distrito Federal
    http://www.augdf.com.br
    http://twitter/augdf

  • Blue screen of death while installing any Adobe Air application

    Whenever I try to install an Air application I get a  Blue Screen and then my system restarts.
    I cannot even take a screenshot  of it.
    This happens with every air application I try to install.
    I also searched for the same on Adobe forums and found the same problem being faced by someone else.
    His problem was resolved by uninstalling a software named "Folder Lock".
    I searched my hard disk for this software and found one, so I deleted  that software (shift+delete) and removed all it's traces from registry  too but that still doesn't solved the problem.
    I also tried disabling the antivirus software and then install the air application but this also didn't helped.
    I was able to install air applications earlier, but now I can't.
    Anybody having same sort of problem. One colleague of mine is also having the same problem.
    Please help me out.
    My system's config is as follows:
    Windows XP Home sp3
    Flash Builder 4, with SDK 4.1, 3.5 installed in it.
    Adobe Air v 2.5
    1.5 GB RAM
    1.66 MHz processor
    Thanks

    Hello chris,
    Thank you for taking out your time to solve my problem.
    I did all the steps mentioned in that link i.e. installed folder lock and uninstalled it from it's options only.
    But it didn't solve my problem.
    Here is the screenshot of the Blue Screen Of Death that I was presented while the application was being installed.
    The BSOD appeared while the application install progress is shown to the end user.
    I hope this will help you get more insight of the issue.
    Thanks

  • AIR application with Flex 4.5 will not render content. What gives?

    OK,
    So I've upgraded to Flash Builder 4.5 Premium and I am unable to develop desktop AIR applications with the 4.5 Flex SDK. I start by simply creating a brand new AIR application using the default SDK (Flex 4.5). I set the title property on WindowedApplication and include a simple Label component. The project compiles fine but when I run the application all I see is the adl window in the dock but that's it. If I modify the Main-app.xml file to set the visible attribute to true, I will get a small window but there is no content although the output window shows the application swf being loaded. Checking the release version of the Main-app.xml file shows the correct path location to the swf.
    Here is what I've tried so far:
    Install/reinstall Flash Builder, 4+ times
    Downloaded the trial installation twice
    Downloaded the SDK's for 3.6, 4.1 and 4.5.0. I then copied each SDK folder and merged the AIR 2.6 SDK with each copy. So now I have 6 SDK versions; one pristine and the other with the AIR 2.6 SDK merged. I then added each SDK individually and created an AIR desktop application for each. Each and every one works fine with the exception of the two 4.5 SDK's. They will not render content.
    I created a simple creation complete handler for the application that declares a simple variable and assigns a value to it. I then put a break point on the assignment and it never gets caught. More evidence that the swf isn't getting loaded.
    The computer I'm running on is a Mac Book Pro with Snow Leopard 10.6.7. If I create a web project in each of the 6 SDK's, those will work just fine. What the heck is it with Flex 4.5 and the AIR 2.6 SDK on this machine? I have the AIR 2.6 runtime installed as well as a number of AIR applications that work just fine. I also tried my 4.5 test on my windows machine and that worked like a champ.
    I am completely out of ideas. Finding information has been difficult because everyone is all about mobile so searching for desktop issues is a losing battle. I realize this is a long email but I'm desperate for help. There must be someone out there that knows more about the low level interaction between Flex 4.5/AIR 2.6 and the OS.

    Well, I finally found the issue, a corrupted mm.cfg file in /Library/Application Support/Macromedia. I deleted the file and then adl ran just fine.

  • Adobe Air Application Installer.exe Documentation

    Hello All,
    i am having severe problems retrieving the documentation for "Adobe Air Application Installer.exe"
    We have applied as Publisher for Air Apps here:
    http://www.adobe.com/products/air/runtime_distribution1.html
    and filled out the form
    http://www.adobe.com/cfusion/mmform/index.cfm?name=air_distribution2
    After that we were hoping to receive documentation about seamless install of air applications, but we are waiting right now ...
    So, time is running out, and i need the documentation of the "Adobe Air App Installer.exe"
    So far i have managed to silently install an air app:
    '$1 -silent -programMenu -location "$INSTDIR" "$TEMP\AirApp.air"' $0
    Where $1 is the "Adobe Air Installer.exe" retrieved from the registry
    $INSTDIR is the installation target path
    $TEMP is a temporary folder, containing the to install Air Application
    the above command works fine for clean and empty systems with no prior versions of the application installed.
    what i now miss are the return code meanings, ranging from 0..9 where i only know that 0 means success !
    And i would like to have a documentation about the
    -update
    and the
    -uninstall
    parameters for seamless installation/deinstallation of a whole air app with data

    hi there,
    i got the documentation also, dunno why they make it so hard
    to get it
    thank you very much !
    greets from joymoney
    ck
    I was also facing this problem.
    Today I got this
    http://help.adobe.com/en_US/AIR/1.5/air_runtime_redist/air_runtime_redist.pdf
    http://help.adobe.com/en_US/AIR/1.5/air_runtime_redist/air_runtime_redist.pdf

  • How to embed and play mp4 video in HTML AIR application?

    Adobe Air HTML / JS application compiled from SDK command line.  I am not using flash pro or flash builder to create the application.
    I was using dreamweaver but the dw air plugin seems to have stopped being developed so I switched to using the command line tools.
    I am creating desktop air application that has embedded mp3 audio and also I want to embed mp4 video.
    Using jQuery and the AIR js plugin I am able to play audio via buttons hooked up via jQuery and the AIR js plugin from the SDK.
    What I am doing is creating proofs for clients in AIR and sending link to the client to download the application.  I embed the media because I do not want to place them on a website where it could possibly be seen by non-clients and get picked up in the SE's.
    I am finding it hard to understand the AIR process for playing video.  I read that it is the same procedure as audio but it does not work.
    If it was hosted on youtube or somewhere embedding the web player would be simple, just copy paste some code and it works.  When actually embedding the video say mp4, f4v, mov, wmv or similar file formats I can't get AIR to play the video.  Audio, not a problem it works great.
    I would like to do the following with video.
    Embed the actual file in the AIR app.  I can do this, it gets embedded.
    Play, pause and stop the video - Can't get this to work
    Get the current stop point and be able to start the video by sending a start point - This is all working with audio I just want to do it with video.
    I have searched the forums, the search engines, youtube and read through the documentation on Air but the video does not work at all.
    I need code samples and direction on how to make an embedded video play inside of a desktop air application using the HTML / JS air model. I am using the command line tools to create the air package and test the air app.
    Please help if you have figured this out.
    Thank you.
    Not sure if this matters but I am using Windows 7 Pro 64bit as my development machine.

    In addition I also can not get html5 video to play in the adobe air app.  Would this issue be tied to the above?

  • How to play and stop flv files through NetStream in AIR Application

    Hi,
    In a folder I have 'n' number of flv file, which are DRM protected. when the user try to play those files for the first time through my AIR application, it will prompt for username and password and gets the license/voucher from the server and store it in AIR Runtime. so that from the next time onwords it won't prompt for username and password as because it already has license/voucher.
         My problem is assume there are 500 files, such that for each file the user has to enter his credentials[username and password]. which is a stupid thing. I want to avoid this process by implementing this process internally/programetically. By playing/accessing each file through netstream from the folder and setDRMAuthenticationCredentials for that file and stop the stream. Here I am able to play each file but I am failed to stop it. I mean to say I will get the license for all the flv files internally[while loading my AIR application], such that user should not be interrupted for his credentials for each file.He should play as if he is accessing/playing a non-DRM protected file. I will be very thank full if any one help me out in this.
    public function init():void {
          connectStream();
          getLicenseForAllFiles();
          videoStream.addEventListener(DRMAuthenticateEvent.DRM_AUTHENTICATE, drmAuthenticateEventHandler);
          ppt_videoStream.addEventListener(DRMAuthenticateEvent.DRM_AUTHENTICATE, ppt_drmAuthenticateEventHandler);
            private function getFilesRecursive(rootFolderPath:String):void {
                //the current folder object
                var currentFolder:File = new File(rootFolderPath);
                //the current folder's file listing
                var files:Array = currentFolder.getDirectoryListing();
                //iterate and put files in the result and process the sub folders recursively
                for (var f = 0; f < files.length; f++) {
                    if (files[f].isDirectory) {
                        if (files[f].name !="." && files[f].name !="..") {
                            //it's a directory
                            getFilesRecursive(files[f].nativePath);
                    } else {
                        //it's a file
                        fileList.push(files[f].nativePath);
                        //Alert.show(""+files[0].nativePath);
                        var fileName:String = files[f].name;
                        if(fileName.indexOf("PPT_")!=-1){
                            ppt_videoStream.play(files[f].nativePath);
                            ppt_videoStream.pause();
                        videoStream.play(files[f].nativePath);
                        videoStream.pause();
                private function connectStream():void {
                    videoConnection = new NetConnection();
                    videoConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    videoConnection.connect(null);
                    ppt_videoConnection = new NetConnection();
                    ppt_videoConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    ppt_videoConnection.connect(null);
                    videoStream = new NetStream(videoConnection);
                    videoStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    video.attachNetStream(videoStream);
                    ppt_videoStream = new NetStream(ppt_videoConnection);
                    ppt_videoStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    ppt_video.attachNetStream(ppt_videoStream);
             private function netStatusHandler(event:NetStatusEvent):void {
                switch (event.info.code) {
                    case "NetConnection.Connect.Success":
                        //connectStream();
                        break;
                    case "NetStream.Play.StreamNotFound":
                        trace("Unable to locate video: " + videoURL);
                        break;
                private function drmAuthenticateEventHandler(event:DRMAuthenticateEvent):void {
                    videoStream.setDRMAuthenticationCredentials("adobe", "adobe", "drm");
                private function ppt_drmAuthenticateEventHandler(event:DRMAuthenticateEvent):void {
                    ppt_videoStream.setDRMAuthenticationCredentials("adobe", "adobe", "drm");
    Thanks
    Sudheer Puppala

    Hi,
    Please go through following links..this will help you:
    http://lucamezzalira.com/2009/02/28/create-pdf-in-runtime-with-actionscript-3-alivepdf-zin c-or-air-flex-or-flash/
    http://forums.adobe.com/thread/753959
    http://blog.unthinkmedia.com/2008/09/05/exporting-pdfs-in-flex-using-alivepdf/
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • AIR Intrinsic Classes-Tried and Proven Approach to building AIR applications   in the Flash CS3 IDE

    Hi everyone,
    For all of you out there who would like to develop AIR
    applications
    from the Flash CS3 IDE but aren't sure how to get those pesky
    intrinsic
    classes working, I have a technique that you can work with to
    create
    your classes and make fully functional AIR applications.
    First of all, those solutions out there that list
    "intrinsic" functions
    in their class definitions won't work. That keyword has been
    taken out
    and simply won't work. The "native" keyword also doesn't work
    because
    Flash will reject it. The solution is to do dynamic name
    resolution at
    runtime to get all the classes you need.
    Here's a sample class that returns references to the "File",
    "FileStream", and "FileMode" classes:
    package com.adobe{
    import flash.utils.*;
    import flash.display.*;
    public class AIR extends MovieClip {
    public static function get File():Class {
    try {
    var classRef:*=getDefinitionByName('flash.filesystem.File');
    } catch (err:ReferenceError) {
    return (null);
    }//catch
    return (classRef);
    }//get File
    public static function get FileMode():Class {
    try {
    var
    classRef:*=getDefinitionByName('flash.filesystem.FileMode');
    } catch (err:ReferenceError) {
    return (null);
    }//catch
    return (classRef);
    }//get FileMode
    public static function get FileStream():Class {
    try {
    var
    classRef:*=getDefinitionByName('flash.filesystem.FileStream');
    } catch (err:ReferenceError) {
    return (null);
    }//catch
    return (classRef);
    }//get FileStream
    }//AIR class
    }//com.adobe package
    I've defined the package as com.adobe but you can call it
    whatever you
    like. You do, however, need to import "flash.utils.*" because
    this
    package contains the "getDefinitionByName" method. Here I'm
    also
    extending the MovieClip class so that I can use the extending
    class
    (shown next) as the main Document class in the Flash IDE.
    Again, this is
    entirely up to you. If you have another type of class that
    will extend
    this one, you can have this one extend Sprite, Math, or
    whatever else
    you need (or nothing if it's all the same to you).
    Now, in the extending class, the Document class of the FLA,
    here's the
    class that extends and uses it:
    package {
    import com.adobe.AIR;
    public class airtest extends AIR{
    public function airtest() {
    var field:TextField=new TextField();
    field.autoSize='left';
    this.addChild(field);
    field.text="Fileobject="+File;
    }//constructor
    }//airtest class
    }//package
    Here I'm just showing that the class actually exists but not
    doing much
    with it.
    If you run this in the Flash IDE, the text field will show
    "File
    object=null". This is because in the IDE, there really is no
    File
    object, it only exists when the SWF is running within the
    Integrated
    Runtime. However, when you run the SWF as an AIR application
    (using the
    adl.exe utility that comes with the SDK, for example), the
    text field
    will now show: "File object=[object File]". Using this
    reference, you
    can use all of the File methods directly (have a look here
    for all of
    them:
    http://livedocs.adobe.com/labs/flex/3/langref/flash/filesystem/File.html).
    For example, you can call:
    var appResource:File=File.applicationResourceDirectory;
    This particular method is static so you don't need an
    instance. If you
    do (such as when Flash tells you the property isn't static),
    simply
    create an instance like this:
    var fileInstace:File=new File();
    fileInstance.someMethod('abc'); //just an example...read the
    reference
    for actual function calls
    Because the getter function in the AIR class returns a Class
    reference,
    it allows you to perform all of these actions directly as
    though the
    File class is part of the built in class structure (which in
    the
    runtime, it is!).
    Using this technique, you can create references to literally
    *ALL* of
    the AIR classes and use them to build your AIR application.
    The beauty
    of this technique is its brevity. When you define the class
    reference,
    all of the methods and properties are automatically
    associated with it
    so you don't need reams of code to define each and every
    item.
    There's a bit more that can be done with this AIR class to
    make it
    friendlier and I'll be extending mine until all the AIR
    classes are
    available. If anyone's interested, feel free to drop me a
    line or drop
    by my site at
    http://www.baynewmedia.com
    where I'll be posting the
    completed class. I may also make it into a component if
    there's enough
    interest. To all of you who knew all this already, I hope I
    didn't waste
    your time.
    Happy coding,
    Patrick

    Wow, you're right. The content simply doesn't show up at all.
    No
    JavaScript or HTML parsing errors, apparently. But no IE7
    content.
    I'll definitely have to look into that. In the meantime, try
    FireFox :)
    I'm trying to develop a panel to output AIR applications from
    within the
    Flash IDE. GSkinner has one but I haven't been able to get it
    to work
    successfully. Mine has exported an AIR app already so that's
    a step in
    the right direction but JSFL is a tricky beast, especially
    when trying
    to integrate it using MMExecute strings.
    But, if you can, create AIR applications by hand. I haven't
    yet seen an
    application that allows you to change every single option
    like you can
    when you update the application.xml file yourself. Also, it's
    a great
    fallback skill to have.
    Let me know if you need some assistance with AIR exports.
    Once you've
    done it a couple of times, it becomes pretty straightforward.
    Patrick
    GWD wrote:
    > P.S. I've clicked on your link a few times over the last
    couple of days to
    > check it out but all I get is a black page with a BNM
    flash header and no way
    > to navigate to any content. Using IE7 if that's any
    help.
    >
    >
    >
    http://www.baynewmedia.com
    Faster, easier, better...ActionScript development taken to
    new heights.
    Download the BNMAPI today. You'll wonder how you ever did
    without it!
    Available for ActionScript 2.0/3.0.

  • Displaying server stored images in an air application

    Usually when I go about displaying server stored images in a regular flex application I go about it the following way:-
    - Create a mysql database table on a server which contains image names
    - Create a php file which generates all of the image namesfrom the table as xml and upload this file to the server
    - Create a new flex application/project
    - In the application make a http service which points to my php/xml file and turns this data into an array collection
    - Set the array collection to the dataprovider of a tilelist component so that all of the images will eventually be displayed within it when they are created
    - I set the itemrenderer of the tilelist to an image component which has it's source set to something like source="{'assets/images'+ data.imagename}" with imagename being the field containing the name of the image which is stored in the mysql database table.
    - Make a folder in the app/project called assets/images which will contain all of the images
    - Upload the app to the server and once it runs all the images will be displayed in the application
    - Then any images that are uploaded to the server can also be displayed as long as their names are added to the mysql database
    My question is though how do you get server stored images to display within an Air Application? My air app will be used on multiple machines but I want the images in it to be dynamic i.e. stored on a server and can be changed. How can this be done?

    I'm struggling to figure out how to access the image files when the assets/images folder will be on a server and the app itself will be on the user's desktop whereas usually in the case of a regular flex app this wouldn't mater as both the app and the image files would be on the server together. Is what I'm trying to do possible i.e. displaying images on a desktop air app straight from a server?

  • Is there a pratical size limit for an Air application window?

    I'm brand new to creating Air applications. I started to design a utility in Flash CS4 for my own use. I had originally intended for it to be a simple SWF, but decided to make an Air app as an experiment, and to perhaps share it with others in the future.
    Basically, the application allows the use to drag-resize a box to measure the pixel dimensions of an area onscreen (photo, Windows window, etc.) I wanted to allow it to be resized to any dimensions up to the size of the screen. The chrome is custom and mostly transparent with some alpha for the box to overlay on whatever you're measuring. However, I've run into a few problems, the primary one being that I cannot set the app to run maximized to the screen size and allow any graphics to extend beyond the dimensions of the stage in the source FLA (it all gets clipped at the edges of the stage). I decided to forget about this and just set a maximum size of the stage. So, what was originally a box that you could stretch out to any dimensions, can now only be resized to the upper limit I set (preferrably 1600px X 900px).
    Annoyingly, I've found that any stage size in the source FLA beyond 1500px X 850px causes the Air app to respond very slowly. At sizes below that, the app responds very quickly, as if it were a windowed SWF. My question is, is there a practical upper limit to the size of an Air app window? I mean, if I have an Air app with a window size of 1500px X 850px that can be resized without any perceived lag, why does the window resizing slow down so dramatically by just increasing those dimensions by 1px?

    These factors that determine the minimum and maximum width and height of a window:
    The minimum and maximum operating system limits, which are the values of the systemMinSize and systemMaxSize properties of the        NativeWindow object
    The maximum width and height of a window in Adobe AIR, which are each 2880 pixels
    The minimum width and height required by any displayed system chrome
    The minSize and maxSize properties of the NativeWindow object
    I cannot address the performance problems you are experiencing. I hope someone else can comment.

  • Calling a created Java file from an AIR application

    I've got a guy helping me out who is creating a Java file that outputs an F1 keypress to the operating system/desktop (which Flex alone can't do.
    My problem is I need to know how I can call/activate this file from within an AIR application. I want my app to be ready for when he has created it for me but I've never used Flex to call an application so I would not know what classes need to be called or if any script would be required.
    In the following simple code lets say if the Java file itself was called keypress.java (or whatever file extension a java file has) what code would need to be added in, including imported classes, to make the click of the button activate this java file?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Button id="KeypressButton" label="Button" horizontalCenter="0" verticalCenter="0" click=""/>
    </mx:WindowedApplication>

    I think one solution is to use a Java proxy to call the Web services.
    In the Java proxy you can have a method that accepts the user/pass and sets them correctly for the Web service.
    Then you expose that Java proxy as a data control (right click, create data control) - and then create a page that invokes that method.
    (For the basics of working with a POJO data control see: http://blogs.oracle.com/shay/2009/07/java_class_data_control_and_ad.html )

  • Android Video play via AIR application is jerky

    Hi All,
      We are developing an AIR mobile application targetted for Android 2.2 or above. One of the requirement is to play H.264 videos on the mobile from the Assets folder (local file system). We have run in to a show stopper while trying to implement this feature, here are the details -
    1. We are using OSMF that comes bundled with Flex Builder 4.6
    2. Using Adobe AIR 3.1 and Flex SDK 4.6
    When video of quality H.264 MPEG4 1280*720 30FPS with input bit rate 2000 is being played on the mobile device (android), the video frame rate is choppy however on the desktop it plays out fine... StageVideo is something I would like to try however, at this moment I have no access to Android 3.0 which is required for StageVideo...
    What are we missing? Is AIR 3 not capable to play H.264 videos on android, though the Android native video player plays it out just fine?
    Regards
    Baliga

    Hi,
    Video encoding is very important.
    For example, use baseline profile level 3.1 for H264 for mobile
    (and not High profile level 4.1 recommended for desktop).
    For more information, see the MAX session of Fabio Sonnati:
    "Encoding for Performance on Multiple Devices"
    And if you have an Android phone/tablet, there is my AIR application
    to watch Adobe MAX 2011 videos :
    https://market.android.com/details?id=air.fr.inway.maxVideos2011
    Search "Sonnati" for this session's video.
    (For info, i use a video player based on OSMF 1.6)
    The pdf presentation is available on Sonmati's blog:
    http://sonnati.wordpress.com/
    Philippe

  • Workers in AIR Application

    What is the workflow for creating and using workers in an AIR application? I can't import "flash.system.MessageChannel" nor "flash.system.Worker". The Worker class, used to create the messageChannels (e.g. Worker.current.createMessageChannel(worker))) is also not usable.
    Is this even possible at the moment? I created a new Flex project and selected SDK 4.6.
    Alternatively, I can create an Actionscript Project where I can import all the files mentioned above. I was attempting to load the swfs generated dynamically but shortly found out that the start2() method of the PrintJob class cannot be imported in an ActionScript project - which is what I want to use the worker for.
    Any ideas/help is greatly appreciated.
    Thanks,
    Victor

    Since you know the SWFs are safe, you can load them with the URLLoader class as a ByteArray object and then use Loader.loadBytes() to inject them into the AIR app. To do this, you must pass a LoaderContext with allowLoadBytesCodeExecution=true.Note that older versions of Flex had difficulty with this technique, but I believe they have been resolved. I've asked the engineers for clarification on the Flex support issue, but in the meantime, here are some links that might help:
    http://blog.esofthead.com/loading-modules-in-air-application-2/
    http://flair-flash-flex-air.blogspot.com/2009/09/framework-for-modular-air-applications.ht ml
    http://opensource.adobe.com/wiki/display/flexsdk/Marshall+Plan

  • Trying to load MP3 from desktop to AIR application

    I'm trying to load an MP3 file into an Air application.
    Here's some code. The first 2 lines are in my constructor
    fileToOpen.browseForOpen("Open", [new FileFilter("MP3",
    "*.mp3")]);
    fileToOpen.addEventListener(Event.SELECT, fileSelected);
    private function fileSelected(event:Event):void
    var stream:FileStream = new FileStream();
    trace(fileToOpen.nativePath);
    // sound = new Sound(new URLRequest(fileToOpen.nativePath));
    // trace(sound);
    stream.open(event.target, FileMode.READ);
    trace(stream.bytesAvailable);
    sound = new Sound(stream.readBytes(stream.bytesAvailable));
    channel = sound.play(00000);
    addEventListener(Event.ENTER_FRAME, onEnterFrame);
    Using URLRequest gives me the error Error #2044: Unhandled
    IOErrorEvent:. text=Error #2032: Stream Error. I can't seem to load
    a file when I give it the full path. Then with the file stream, I
    don't even know what I'm doing. I don't know which method I'm
    supposed to use to load the file into a sound object. Please
    help...

    I figured it out. I tried url instead of nativePath for the
    file object and it worked.

Maybe you are looking for