Adobe Air AS3 URLRequest Delay

Hi,
I want to make a request to read a url from my apk exported from .fla. The problem is in the first installation, then the request it takes 6 seconds. I do not know what's causing. I open the application 2nd time and request is executed in a second successful.
I attached files and screens here: https://app.box.com/s/unue6ebsgpmkk7jb7yuc
To reproduce the problem you need to uninstall the application and install->run again. Only on the first run is observed the problem.
I will be grateful if someone help me
MyConf:
Air sdk: 16
Flash CC:  14.1.0.96 ( windows 7 64 )
Thanks!
import flash.utils.Timer;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
var global_status:String = "none";
var global_magic_event:int = 0;
var text2screen: TextField = new TextField();
text2screen.x = 10;
text2screen.y = 450;
text2screen.width = 300;
text2screen.height = 100;
text2screen.wordWrap = true;
text2screen.border = true;
text2screen.textColor = 0xffffff;
text2screen.backgroundColor = 0x000000;
text2screen.background = true;
text2screen.text = global_status;
addChild(text2screen);
var xloader: URLLoader = new URLLoader();
var url: String = "http://pastebin.com/raw.php?i=TBwVdkFY&rnd="+randomRange(111,99999);
trace(url);
var request: URLRequest = new URLRequest(url);
try {
  xloader.load(request);
  xloader.addEventListener(Event.COMPLETE, processData);
  xloader.addEventListener(IOErrorEvent.IO_ERROR, errorData);
} catch (e: Error) {
  trace("error!!");
  global_status = "err #1";
function processData(e:Event):void{
  trace("Loading Completed");
  global_status = "success "+xloader.data.substr(0,250);
function errorData(e: Event = null) {
  trace("Loading fail!");
  global_status = "err #2";
// debug screen
var timer_start: Timer = new Timer(1000, 1000);
timer_start.addEventListener(TimerEvent.TIMER, showlog);
timer_start.start();
function showlog(e: TimerEvent): void {
  // catch the second where is success
  if( global_magic_event==0 && global_status!="none" ) { global_magic_event = e.currentTarget.currentCount; }
  text2screen.text = "#" + (e.currentTarget.currentCount*e.currentTarget.delay)/1000 + " second | status ["+global_magic_event+"]: "+global_status;
function randomRange(minNum:Number, maxNum:Number):Number  {
    return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum);

Hi,
Is a small txt file ( 2.55 KB ), and i make the request with a random parameter ( &rnd ) to be uniq for each request.
var url: String = "http://pastebin.com/raw.php?i=TBwVdkFY&rnd="+randomRange(111,99999);
I tried on multiple servers, different files, various sizes, with cache, without cache ... the problem is not remote . ( is not a cache problem )
I tried on multiple .fla ... the problem is not on current .fla .. is a global problem.
I added a v2_fla folder (  https://app.box.com/s/unue6ebsgpmkk7jb7yuc ) where i implemented a complete debug.
i added this events:
    xloader.addEventListener(Event.COMPLETE, completeHandler);
    xloader.addEventListener(Event.OPEN, openHandler);
    xloader.addEventListener(ErrorEvent.ERROR, onError)
    xloader.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
    xloader.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
    xloader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    xloader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    xloader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
    xloader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
and i tested in adobe_flash_player_14, air_desktop and air_16_for_android and i recorded the time when each event is executed
adobe_flash_player_14: 0 seconds
air_16_desktop: 0 seconds
air_16_for_android_first_run: 5 seconds
air_16_for_android_second_run: 0 seconds
I noticed that Event.OPEN is executed at second 5. why ?
this is a simple script and this delay is a big problem for me. maybe it is a bug air. can someone clarify me? I struggled with this problem for several days.
Thanks!

Similar Messages

  • Samsung GS2 tinted camera image issue (Adobe AIR AS3)

    Hi I am having problem with accessing my Samsung Galaxy 2 camera through using flash.media.Camera.
    To allow my QR add-on to function, I need to be able to access the camera through flash.media.Camera.
    However for some reason, I am getting weird tinted picture on my screen. It might have something to do with the "Amoled" display or dual-core processor.
    If anyone has come across this before please give me some guidance!
    Thank you very much in advance!
    Here is my code (My Settings: 800x480 | FPS:30 | Portrait)
    import flash.media.Camera;
    import flash.media.Video;
    var video = new Video(400, 400);
    var camera:Camera = Camera.getCamera();
    camera.setQuality(0, 100);
    camera.setMode(video.width, video.height, 30,false);
    video.attachCamera(camera);
    addChild(video);

    Hi there
    Please take a look at the page linked below.
    Click here to view
    Cheers... Rick

  • How to Play/Pause All for Adobe Air Application using AS3 in Flash CS4?

    I am new to Flash and I'm creating an educational application in AS3 in Flash CS4 for Adobe Air. I want to use buttons to play and pause all content (movieclips AND sound).
    I have created play and pause buttons that worked by switching the frame rate between 0 and 20, unfortunately I've realised that it's never really 0fps but rather 0.01fps and so it continues playing, albeit very very slowly. Also this doesn't affect the audio; I have set sound files to Stream which are synced to movieclips on their timelines, but even when the application is set to 0fps the audio continues.
    Since I have various levels with numerous movieclips each with synced audio, what i'd like is to be able to do is pause absolutely everything within each movieclip with one button and to be able to resume from the same place using another button. Is this possible? If not, is there a global function to pause/resume the entire application/program?
    Thanks in advance for your help!

    Its possible but you would need to tell each movieclip and audioclip to play/pause. You can create a for loop inside your mouse event function to find each movieclip and pause/play its timeline and a separate for loop for audio clips. Also instead of setting fame rate to 0 for pause just use a stop() command.

  • Adobe air sony vaio tablet pc delaying problem..

    hi,
    i am created an app for our agency with adobe air..
    app is working fine with pc, mac and etc. but, app isn't working with sony vaio i5 -win8 tablet pc.
    problem is , delaying. when use application with mouse , no problem. but, if you are using the app with finger, it's doing very delaying.. what can i do?
    error video :
    http://lp-digitalprojects.com/tabletpcSorun.mp4

    Hi
    Make sure we loged in as admin and then we need to first remove the temp files first then we need to unregister the installer and then we need to register the installer so the steps are....
    to delete the temp files we need to hold the windows key+R,
    We will get the run window then in the box we need to type the %temp% you will get the new window on that window we need to sellect all the files and then press delete
    after this we need to try to install the program.
    if this works good to go or we can try these steps
    Choose Start > All Programs > Accessories > Run.
    In the Open box, type "msiexec /unreg" and then press Enter. THAN
    Choose Start > All Programs > Accessories > Run.
    In the Open box, type "msiexec /regserver" and then press Enter.

  • How to fix sound delay in adobe air apps?

    I am working on this drummer game where the user has to repeat what he listens by tapping on the thouchscreen, but there´s a noticeable delay on Android and iOS. The same game I had it working fine on AS2 for PCs. I don´t know whats the problem in adobe air apps. I hoe someone can help me.

    Unfortunately, I do not own an iOS device and from my understanding, you have to have a developer account just to be able to test apps on your device, even if you have no intention of ever publishing something on the store. Correct me if Im wrong on that, but everything I have seen is that the only way to test apps without a developer account is to have a jailbroken device.
    I have been building an audiobook player on and off for a while now and tested it on a Galaxy Nexus, Nexus 4, and Nexus 5 in addition to my Moto X. None of those ever experienced any noticeable delays in playback. That is why I was wondering if it is a per device issue. Or it could be that I have just always used vanilla (or extremely close to it) Google Android devices. I understand that the devices I have tested with are most likely in a very low percentage of active devices used aside from the Moto X. I was basically just wanting to jump in to provide my notes on the issue, the device I tested with, and my experience.

  • Adobe AIR dynamic sound and recording delay issue

    I'm writing mobile application with Adobe AIR. The application use AIR Microphone API to record sound to file and later replay it.
    The problem manifest only on mobile devices, not simulator. Specifically only on iOS devices, android devices seem to work OK.
    Sometimes the recorded sound is missing samples. I know this because I use iFunBox to copy the recorded file to another application that replay it. The dropped frame manifest during playback as very fast audio because only part of the samples were recorded.
    Sometime the playback is to slow which manifest as very slow audio. I know this because when the recording is fine and the other application play the sound right or when I take a file I recorded in the simulator (which run on my MacBook) and it only play slow on the mobile device.
    How can I make sure the sound is good even when the application is a bit busy?

    A little bump.
    I still haven't found any solution to this.

  • I want to hide the blue title bar from my adobe air application

    Hello
    I'm doing an aplication with Flash CS4, using adobe air in as3. I have some frames, and in the frame 25 there's a stop, when user clicks a button, go ahead to frame 27 and stage resize the whole screen, just like a FULL_SCREEN, and then I load an pdf. I can't use FULL_SCREEN or FULL_SCREEN_INTERACTIVE property, because doesn't works the pdf loaded (even adobe help say it), so I would like to simulate it. The application it will be use in windows ( I am not sure if XP, vista, but windows). So when resize the stage, to load pdf, then and ONLY then, I want the title bar disappears, just to simulate full_screen.
    How can I do, to make in a desktop application that ?
    Thanks in advance

    Open the Air Application descriptor file(eg: airproject-app.xml) for your application and
    uncomment the <systemChrome></systemChrome> tag.
    Set it to none like:
    <systemChrome>none</systemChrome>
    It will work.

  • How to read serial number of adobe air runtime / flash plugin

    Hi
    Question:
    Is there a way of extracting a unique serial number (or assembly number) from the air runtime and the flash player.
    Background:
    I asked this question on Experts Exchange and the consensus was that it's not possible. However, I thought I would try here before I gave up.
    I am using flash remoting and I want to pair a user's subscription with a specific flash player or adobe air runtime. The flash application would interrogate the flash player and send it back to a database using remoting. If the serial number was correct then the user would get access. If not they would be rejected. The same would happen with an Air application but the serial number would be pushed instead of pulled.
    Mplord of EE introduced me to the Capabilities class (Flash) and the NativeApplication.nativeApplication class and method (Air). However, it's not really what I was looking for. In c# and vb.NET it's possible to extract the windows serial number from the OS and I'm looking for a similar function in as3.
    If this was possible it would be a fantastic way to protect your content and it would be really easy for Adobe to build this feature in.
    Thanks in advance for any help.
    Kind Regards

    Sorry, but you are at the wrong forum; this one is only for discussions on the forums themselves. The Air forums are here:
    http://forums.adobe.com/community/air

  • Adobe AIR 3.7 - iOS run error

    Hi,
    I have set up a simple project to test the latest release of Adobe Air 3.7 which allow loading external swf with bytecode inside.
    The project use the krpano_as3_interface, load the main krpano.swf, and after a simple xml file.
    Building and running in iOs SImulator using my Flex IDe works fine, the panorama load.
    Building and trying runnig on an iOs Device connected with USB doesn't works.
    I get this error :
    Trying to connect to Player
    Player connected; session starting.
    [trace] krpano_load
    [trace] krpano_load_complete
    [Fault] exception, information=Error: Error #3747: Multiple application domains are not supported on this operating system.
    Following this blog article, http://blogs.adobe.com/airodynamics/2012…ir-apps-on-ios/, i correctly load krpano swf file. But it seems that adding krpano content on stage is not possible.
    Any idea ?
    [code]
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   applicationDPI="160"
                   applicationComplete="krpano_load()"
                   width="100%" height="100%" usePreloader="false"
            >
        <fx:Script>
                        <![CDATA[
            import mx.core.UIComponent;
            import mx.events.FlexEvent;
            import mx.core.FlexGlobals;
            import mx.events.ResizeEvent;
            import flash.system.Security;
            import krpano_as3_interface;
            public var krpano:krpano_as3_interface = null;
            public var area:Object;
            public var _krpano:*;
            public function krpano_load():void
                trace("krpano_load");
                var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
                loaderContext.allowLoadBytesCodeExecution = true;
                loaderContext.allowCodeImport = true;
                var krpanoloader:Loader = new Loader();
                krpanoloader.contentLoaderInfo.addEventListener(Event.COMPLETE, krpano_load_complete);
                krpanoloader.load(new URLRequest("./krpano.swf"), loaderContext);
            public function krpano_load_complete(event:Event):void
                trace("krpano_load_complete");
                (event.target.content as Object).embeddedstartup(stage, krpano_ready);
                _krpano = (event.target.content as Object);
            public function krpano_ready(krpanointerface:krpano_as3_interface):void
                trace("krpano_ready");
                krpano = krpano_as3_interface.getInstance();
                krpano.call("showlog(true);");
                area = krpano.get("area");
                area.x      = 0;
                area.y      = 0;
                area.width  = stage.stageWidth;
                area.height = stage.stageHeight;
                krpano.call("loadpano(./krpano.xml,null,MERGE,BLEND(1));");
            ]]>
              </fx:Script>
    </s:Application>

    The error #3747: "Multiple application domains are not supported on this operating system." occurs when the Applicationdomain is not set to currentDomain. Can you please debug if the ApplicationDomain is getting set to currentDomain rather than the default one?
    Thanks,
    Nimisha

  • How do I get Adobe Air Desktop App to notify user that a URL text file has been updated?

    How do I get an Adobe Air Desktop App to notify user that a URLRequest ".txt" file has been updated? via blinking system tray icon or something.
    New to Air and need someone to point me in the right direction. I have been searching web for hours and probably not asking the question right.
    I have a very simple Desktop App that just loads a text file from a web location into a dynamic text field at a set timer. it just repeats this action on the timer. right now every 5 minutes
    What would the actionscript be to tell the Air App to look at the date or time stamp of the ".txt" file and notify user if its new?
    Thanks

    Try to follow below steps
    Click on Finder and then hold Command + Shift + G keys on your keypad
    It will open Go to folder window, type  exactly ~/Library and click on Go
    Then open Application Support > Adobe folders
    Trash AAMUpdater and OOBE folders.
    Now click on finder and hold Command + Shift + G keys on your keypad.
    This time type /Library and click on Go.
    Make sure to remove ~ symbol.
    Then open Application Support > Adobe folders.
    Trash AAMUpdater, Adobe Application manager, OOBE folders.
    Now Click on Finder and then hold Command + Shift + U keys on your keypad.
    It will open utilities folder.
    Trash Adobe Creative Cloud and Adobe Application Manager folders
    Download and Run CC cleaner tool from below link
    http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems/_jcr_conte nt/main-pars/accordion_container_1/accordion-par/accordion-item-1/accordion-item-par/proc e dure/proc_par/step_3/step_par/download/file.res/AdobeCreativeCloudCleanerTool.zip
    Accept the license agreement and click on Adobe Application Manager
    Then click on clean up selected
    Close the window
    Download and install Creative Cloud App from below link
    Free Creative Cloud | Download Adobe Creative Cloud free trial

  • Adobe Air Framework - Where's the Documentation

    I'm very confused about how to use the Adobe Air Framework to learn how to update my apps. There are tutorials on the Adobe website, but they're all from either 2008 or 2011 and are discussing Air 1.5 or 2 or 2.5 versions, but since I'm using Air 3.7 I would like to see examples of how to use the Framework.
    I'm new to Air, but not to AS3. It sounds like the Framework includes API's that allow you to update apps and more, but I cannot find where the documentation is specifically. I continually find:
    http://www.adobe.com/devnet/air/documentation.html
    http://www.adobe.com/devnet/air/articles/air_update_framework.html
    http://forums.adobe.com/thread/1156048
    http://code.google.com/p/nativeapplicationupdater/
    http://www.adobe.com/devnet/air/articles/updating-air-apps-native-installer.html
    http://help.adobe.com/en_US/air/build/index.html
    and a few others, but I'm hoping someone can help me find what I need. Maybe the Framework hasn't changed from version 2 to 3, but I know it has from another article I read.
    I'm using Flash Professional CS6 and working entirely within that program.
    Any suggestions?

    I'm just about to head out, but I think these two links are possibly what you're looking for it contains all the documentation you could ever need for the latest AIR SDK's:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/index.html?filter_air=3 .7
    http://www.adobe.com/devnet/articles/flashplayer-air-feature-list.html
    If it's not I'll post a little more when i get back if someone else hasn't already.
    Edit:
    Back now, I so you're looking to implement a form of updating your application from within itself using the Air Application updater. The second link you've provided explains everything on how to do this, just ignore all the MXML and use the snippets that are provided in the examples. There is no difference between the framework released in 2011 (with regards to updating) so any tutorial around this time will be sufficent for you. I quickly googled this one for you and it seems to be easy to understand:
    http://kirill-poletaev.blogspot.co.uk/2011/06/updating-air-applications-part-2.html
    Hope that helps.
    O.

  • How to save the date in Sqlite in Adobe Air application

    hi friends,
    i am doing a flex Adobe AIR Application with SQLITE Data base,in that i want to save Date in the following format DD/MM/YYYY, but in my TABLE i gave the data type is DATE,
    So it store the value like this Sun Dec 2 00:00:00 GMT+0530 2012.i want to store the value in DD/MM/YYYY.How to do that?
    looking for useful suggession.
    Cheers,
    B.venkatesan.

    Hi, maybe cannot help much on this since I have not much experiense on handling SQLITE in AIR.
    But I know there are a command/example for reading SQL:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/data/SQLConnectio n.html
    http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7d49.html
    And in mxml you should have an id for each individual TextInput component, also have a button:
    <Button click="updateSQLHandler(event)"/>
    When the button is click the handler function is launched.
    The updateSQLHandler(event:MouseEvent) is a script that read the each individual TextInput component by getting (id of textinput component).text.
    Then, you create a String varible that is an SQL commands with the texts in the form, and update the SQL database following the below using the execute() command (refer to http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7d49.html ).
    Hope this help.

  • Walking the iframe DOM in Adobe AIR

    Hi experts,
    I'm trying to prog a small app with Flash CS4/AS3/AIR 1.5 and the HTMLLoader
    Object. I can't figure out, if its possible with AIR walking the DOM in an IFRAME
    with content from a remote URL (without access to the remote URL).
    Maybe, so it is possible you can point me to the right direction.
    Kai

    Hi,
    If you instantiate an HTMLLoader object that loads a remote URL, you can access the DOM of that page from flash (AS3) APIs like this:
    myhtmlLoader.window.document;
    However, if your HTMLLoader loads a local page that has an <IFRAME> pointing to the remote URL, you will only be able to access the DOM of the local page. You CANNOT go from there into the <IFRAME> DOM (via contentWindow.document) because of the cross domain restrictions enforced by WebKit.
    Hope this helps,
    Dragos Georgita | Adobe AIR Engineering

  • Create an IM client in Adobe Air

    how to create an IM client in Adobe Air using Xiff AS3 library?

    Problem is if i define internal table under code initialization of interface it does not come in the Form ...
    Please tell me how to define internal table so that it can appear in Form as well.
    I simply wants to display records of KNA1...Suggest whatever way you know..
    Regards,
    Gurmukh

  • Adobe Air problem - Please assist?

    4 days ago on start-up I had a message that update was required for Adobe Air so I let it install.  Yesterday I noted my websites were missing graphics, videos on You tube not playing etc,  so I restarted computer and had message on start up re ADOBE AIR saying "The installation of this application is damaged - Try reinstalling or contacting publisher for help".
    As the latter is not an existing option as they say "no help with Air just look at forums for assistance"  this very non technical pensioner is asking for help as I have tried to do what I know by uninstalling and reinstalling THREE times now and still het the message and when I try to get into google it now tells me my profile cannot be used it belongs to a newer version - dont have a clue what I can do for this so any simple advice would be appreciated. 
    To be honest I dont even know if putting this is the right place but nothing anywhere seems to relate to problems with Air.  If I should be asking elsewhere perhaps somebody could point me in that direction as would hate a major problem as because of disability my computer my lifeline.
    Thank you.

    Thank you - apologies for delay with my health I have up and down days and the bad ones have my fingers refuse to behave on here.   I have to have Adobe Air installed for our BBC catch up TV programme BBC I Player The other day on switch on i had a message that adobe air needed to load a new version which is v  3.30.3650 and so i set it to run,  then 2 days later I start getting the message above that the application is damaged so i take it off and re-install.  while it was off I checked my bbc i player app and found the videos were pixelating then when I reinstalled the pixelating had stopped.  Im operating a fairly new desktop vaio on windows 7.  I have taken the system back up to 3 weeks now way before the air update when the problem started but its still happening, telling me its damaged, remove and re-install I feel like Im in Groundhog Day every morning!
    So anyone who can help would be like an angel.  Thanks

Maybe you are looking for

  • Ipod not showing up on iTunes

    When I plug my iPod touch into my computer (using USB) I get the message, "This iPod cannot be used because the Apple Mobile Device service is not started".  I just sync'd this same iPod on this same computer 2 days ago.  What do I need to do?

  • Bridge CC Output Module Issues

    Is anyone else having issues with Bridge CC Output module? In every other version of Bridge I have used, I have been able to make PDFs or HTML slideshows from selected images without any problems or need to download any components. However, in Bridge

  • Problem in compiling procedure from another schema

    Hi all I have got 2 schemas, say A and B. Schema A owns a procedure P which selects data from table T1 ( external table ) and updates table T2. i have granted Schema B 1) read, write privilege on the directory that table T1 refrences. 2) all on table

  • Working with Large data sets Waveforms

    When collection data at a high rate ( 30K ) and for a long period (120 seconds) I'm unable rearrange the data due to memory errors, is there a more efficient method? Attachments: Convert2Dto1D.vi ‏36 KB

  • Iphoto buddy with Iphoto4

    Ever since I installed iphoto buddy, which is a great addition to iphoto I have been unable to run photoshop's web photo gallery automation. Does anyone have any knowledge about this on this forum??