I can not scan a local directory unless on of my installed files is chmod
755. i want to run a script on init() that will chmod 755 a file in the bin-debug directory.
Thanks in advance for your assistance.
I can not scan a local directory unless on of my installed files is chmod
755. i want to run a script on init() that will chmod 755 a file in the bin-debug directory.
Thanks in advance for your assistance.
My application relies heavily on native processes so that I am trying to implement fallback strategies if a native process doesn't work as expected.
While creating test scenarios I had a problem with handling errors caused directly by the start() method of the NativeProcess class. It throws errors if the target process can’t be accessed or is corrupted. For example if you take an exe file in Windows that works correctly and modify it in a hex editor to corrupt it the following error is thrown:
Error: Error #3219: The NativeProcess could not be started. '%1 is not a valid Win32 application.'
at flash.desktop::NativeProcess/internalStart()
at flash.desktop::NativeProcess/start()
If I try to put a try-catch block around the process.start() call something unexpected happens:
The error is cought correctly, but another error is thrown instantly:
Error: Error #1503: A script failed to exit after 30 seconds and was terminated.
at mx.managers.layoutClasses::PriorityQueue/removeSmallest()[E:\dev\4.x\frameworks\projects\ framework\src\mx\managers\layoutClasses\PriorityQueue.as:238]
at mx.managers::LayoutManager/validateProperties()[E:\dev\4.x\frameworks\projects\framework\ src\mx\managers\LayoutManager.as:567]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:730]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x\frameworks\projects \framework\src\mx\managers\LayoutManager.as:1072]
The problem with this error is that I got no idea how to catch or prevent it. Depending on what I do in the catch block there is another error. For example if I try to log the error I get (but sometimes not as instantly as above):
Error: Error #1503: A script failed to exit after 30 seconds and was terminated.
at mx.logging::Log$/getLogger()[E:\dev\4.x\frameworks\projects\framework\src\mx\logging\Log. as:360]
Strange is that the error is fired instantly sometimes not after 30 seconds.
How can I fix this?
Hi!
I make use of the loader class to load images from the file system:
loader.load(new URLRequest(encodeURI(f.url)));
f is of type File and taken from a File.browseForOpen dialog.
However, in case the filename of the selected file contains space characters, the statement above will not return any result - it just hangs...
Is this by design? What is the best way to get around this?
Best regards
Roland
I have a system that encodes videos by using a series of command-line tools. Formally, I had AIR modify a file. That change was detected by Directory Monitor, which would then start the first batch file, which would call a PERL script to mangle the data coming in, which would create another batch file, and then the root batch file starts that running. That batch finally calls the format-specific batch file that actually has the commands for encoding. That calls multiple other programs, taking screenshots, resizing the video, packaging it into an MP4, and so on. I wanted to cut out Directory Monitor (the less extra apps you need installed, the better), and do it all from AIR. Now, I can call the root batch file (the first one), but I can't see the terminal, and for some reason AIR won't let me really call another batch file. I need to call many programs and other batch files, so this isn't going to work. I currently re-rout the output to a <p> tag to show what's going on. I know it's not a display problem, because encoding requires 100% of all my processor, and they are all dead, so...
Anyway, here's my code (except the batch files. Just create two batch files, one that calls the other and use AIR to initiate the first one. It won't call the second).
[CODE]
/* Testing the new NativeProcess */
function makeItGo()
{
// Check if native process is even supported
if(air.NativeProcess.isSupported)
{
/* We first create a file object and attach it to our executable file. We pass that into a startupInfo object, which will be used to initialize the program. We will include in that our arguments to pass into the native application when it is started. "Native application" means that it's a Windows app, not AIR. We also, need to create a process handle, attach listeners (so we can pass in information and get the output into AIR to play with). Finally, we start the application. */
var file = new air.File();
//file = file.resolvePath("C:\\Documents and Settings\\me\\Desktop\\app\\folder\\\\TestScript.bat"); // Doesn't work. Cannot start a .bat process.
file = file.resolvePath("C:\\WINDOWS\\system32\\cmd.exe");
var nativeProcessStartupInfo = new air.NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
encodeProcess = new air.NativeProcess();
// Attach listeners to catch all outgoing data (through STDOUT), and to allow us to give additional input, if desired.
encodeProcess.addEventListener(air.ProgressEvent.STANDARD_OUTPUT_DATA, outputHandler); // Listener on STDOUT
encodeProcess.addEventListener(air.ProgressEvent.STANDARD_INPUT_PROGRESS, inputHandler); // Triggered by NativeProcess object when STDIN stream is flushed.
encodeProcess.addEventListener(air.NativeProcessExitEvent, processExited); // Triggered when the application exits. We need to remove all handles and listeners.
// Start the application.
encodeProcess.start(nativeProcessStartupInfo);
// Create string to pass through as a command to our first batch file, and pass it through.
var command = "\"" + applicationRoot + "\\program directory\\TestScript.bat\"\n";
encodeProcess.standardInput.writeUTFBytes(command);
}
else
{
alert("NativeProcess is not supported!");
}
} // End makeItGo()
/* When the application outputs something on STDOUT, we catch that event (the data) in the function below */
function outputHandler()
{
var consoleBox = document.getElementById("consoleOutput");
var data = encodeProcess.standardOutput.readUTFBytes(encodeProcess.standardOutput.bytesAvailable);
consoleBox.innerText += data;
}
/* Whenever input is sent to the console, this function makes sure the new output is shown in the console. Not sure it's needed, but it works with it in. */
function inputHandler(event)
{
outputHandler();
}
/* This takes commands that we type in, and passes it along. */
function sendToConsole()
{
var inputBox = document.getElementById("consoleInput");
encodeProcess.standardInput.writeUTFBytes(inputBox.value);
inputBox.value = "";
return false;
}
/* Removes all listeners, closes the process, and removes the AIR handle on the process, allowing it to close. */
function processExited()
{
encodeProcess.removeEventListener(air.ProgressEvent.STANDARD_OUTPUT_DATA);
encodeProcess.removeEventListener(air.ProgressEvent.STANDARD_INPUT_PROGRESS);
encodeProcess.removeEventListener(air.NativeProcessExitEvent);
encodeProcess.closeInput();
encodeProcess.exit(false); // False means don't force the exit.
}
[/CODE]
I'm writing an encoding program in AIR. Previously, another program was required (Directory Monitor) to watch a folder to be modified by AIR, and then Directory Monitor would start the encoding process. This process involves a batch file (.bat) calling a PERL script, which creates another .bat. The first batch file (the root bat) then calls that newly created .bat, which does some things using other progroms, and calls the .bat file necissary for the encoding of that particular codex (quicktime, directX, etc). After, that third batch file actually encodes the file by calling several different exe files (about 7 of them). Problem is, AIR won't allow the .bat that starts through AIR to call the PERL-created .bat. I have no idea why. I currently catch all output and display it in a <p> tag that I've made to look like a terminal window. I can't figure out how to call the next bat. Ideas? Here's my code (create two .bat files, and have the one you pass through in AIR call the second one. You'll see that AIR won't let that happen).
[CODE]
/* Testing the new NativeProcess */
function makeItGo()
{
// Check if native process is even supported
if(air.NativeProcess.isSupported)
{
/* We first create a file object and attach it to our executable file. We pass that into a startupInfo object, which will be used to initialize the program. We will include in that our arguments to pass into the native application when it is started. "Native application" means that it's a Windows app, not AIR. We also, need to create a process handle, attach listeners (so we can pass in information and get the output into AIR to play with). Finally, we start the application. */
var file = new air.File();
//file = file.resolvePath("C:\\Documents and Settings\\me\\Desktop\\my\\apps\\directories\\TestScript.bat"); // Doesn't work. Cannot start a .bat.
file = file.resolvePath("C:\\WINDOWS\\system32\\cmd.exe");
var nativeProcessStartupInfo = new air.NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
encodeProcess = new air.NativeProcess();
// Attach listeners to catch all outgoing data (through STDOUT), and to allow us to give additional input, if desired.
encodeProcess.addEventListener(air.ProgressEvent.STANDARD_OUTPUT_DATA, outputHandler); // Listener on STDOUT
encodeProcess.addEventListener(air.ProgressEvent.STANDARD_INPUT_PROGRESS, inputHandler); // Triggered by NativeProcess object when STDIN stream is flushed.
encodeProcess.addEventListener(air.NativeProcessExitEvent, processExited); // Triggered when the application exits. We need to remove all handles and listeners.
// Start the application.
encodeProcess.start(nativeProcessStartupInfo);
// Create string to pass through as a command to our first batch file, and pass it through.
var command = "\"" + applicationRoot + "\\moviesInNeedOfEncoding\\encodeWatchFolders.bat\"\n";
encodeProcess.standardInput.writeUTFBytes(command);
}
else
{
alert("NativeProcess is not supported!");
}
} // End makeItGo()
/* When the application outputs something on STDOUT, we catch that event (the data) in the function below */
function outputHandler()
{
var consoleBox = document.getElementById("consoleOutput");
var data = encodeProcess.standardOutput.readUTFBytes(encodeProcess.standardOutput.bytesAvailable);
consoleBox.innerText += data;
}
/* Whenever input is sent to the console, this function makes sure the new output is shown in the console. Not sure it's needed, but it works with it in. */
function inputHandler(event)
{
outputHandler();
}
/* This takes commands that we type in, and passes it along. */
function sendToConsole()
{
var inputBox = document.getElementById("consoleInput");
encodeProcess.standardInput.writeUTFBytes(inputBox.value);
inputBox.value = "";
return false;
}
/* Removes all listeners, closes the process, and removes the AIR handle on the process, allowing it to close. */
function processExited()
{
encodeProcess.removeEventListener(air.ProgressEvent.STANDARD_OUTPUT_DATA);
encodeProcess.removeEventListener(air.ProgressEvent.STANDARD_INPUT_PROGRESS);
encodeProcess.removeEventListener(air.NativeProcessExitEvent);
encodeProcess.closeInput();
encodeProcess.exit(false); // False means don't force the exit.
}
[/CODE]
I built a kiosk Air application.
I would like to know how to prevent screensaver to arise while my Kiosk is running.
Thanks
I'm currently debating if I should go ahead with game development on AIR. I know the game will be fast and snappy since it's a very simple game. My main concerns are;
1. Will I be able to display ADs inside the game?
2. Will these ADs be allowed by Apple?
3. What companies are available for ADs?
Thanks!
- Jona
I hope somebody can help me with this issue as I'm completely clueless of what could be the problem...
I've integrated the AIR ApplicationUpdater into my app and doing update tests but they fail if I download the update for my app and then press "Install" so that the app exits and tries to install the update. there I get the following message:
Sorry, an error has occured.
The application could not be installed because the installer file is damaged. Try obtaining a new installer file from the application author.
If I postpone the update install until the app is restarted, all works fine. This happens on Windows 7 as well as on Mac OSX. And I tried it too with uninstalling both AIR and my app and re-install it all freshly but this didn't help.
Here's part of the install log I'm getting:
[2011-05-31:02:51:30] Application Installer begin with version 2.6.0.19140 on Windows 7 x86
[2011-05-31:02:51:30] Commandline is: -update "c:\program files (x86)\test\test application\test application.exe" "C:\Users\user\AppData\Roaming\testappid\Local Store\#ApplicationUpdater\update.air" 1.0.1
[2011-05-31:02:51:30] Installed runtime (2.6.0.19140) located at c:\Program Files (x86)\Common Files\Adobe AIR
[2011-05-31:02:51:30] Installed app (testappid) located at c:\program files (x86)\test\test application\test application.exe
[2011-05-31:02:51:30] Unpackaging file:///C:/Users/user/AppData/Roaming/testappid/Local%20Store/%23ApplicationUpdater/updat e.air to C:\Users\user\AppData\Local\Temp\flaD894.tmp
[2011-05-31:02:51:30] Got an unexpected fatal error while unpackaging: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032" errorID=2032]
[2011-05-31:02:51:54] Launching subprocess with commandline c:\program files (x86)\test\test application\test application.exe
[2011-05-31:02:51:54] Application Installer end with exit code 7
... Anyone have any clue what could be the source of the trouble? It's very important for me that this all works flawless.
Hi, everybody
I trying to open file pdf from my macbook in Air Application, but it's didn't display anything to me.
Please help me. I wanna know Adobe Air can open PDF File from Mac or and Window os?
This sample code i used..
var request:URLRequest = new URLRequest("/Users/Morn/Desktop/RD_phase3.pdf");
var pdf = new HTMLLoader();
pdf.x = 0;
pdf.y = 0;
pdf.height = stage.stageHeight;
pdf.width = stage.stageWidth;
pdf.load(request);
container.addChild(pdf);
Thanks a lot,
Hello there,
When Air 2.0 was released, it was possibile to do something like this (c:\mydirectory\mysubdirectory has to be there obviously):
var file:File = new File("c:\\mydirectory\\mysubdirectory");
file.openWithDefaultApplication();
and the directory would be opened by using (for exampe) in windows the file explorer
In air 2.7 this code throws an error (that is a security error, in fact if I open a temp directory created with createTempDirectory it works)
"Illegal file path"
Now, please, tell me how can I harm the user by simply opening a directory on his hard disk!
How can I open a directory on his hard disk without getting this error?
Thanks in advance
I just converted two AIR apps from native exe installers (requiring AIR installed) to Captive Runtime relases (just a folder structure).
One difference i see is that my applications now load a little slower (because of the packaged instead of installed runtime?).
When using flex 4 sdk the white and centered flex4-loadbar now appears for a few seconds before the splash screen of the app. appears. The same happens when using flex 3 sdk (in compatibility mode) but instead the "initializing" text appears.
Is this slowdown a known effect of the captive runtime packaging?
Hi there - currently developing an iOS app for iPad deployment and was asked if I could allow the user to post to their Facebook wall. Anyone gotten this to work on iOS? Haven't tried yet, wanted to check here first. I am using the AIR 3.1 overlay in Flash CS5.5... I just did another app - for desktop use where the user can post photos to an album and that worked just fine - though I did have to update the Facebook API for desktop to use the new JSON object in AIR 3.1
Anyway, any info much appreciated.
Is it possible to enable/use the tab function of the softkeyboard?
Just setting the tabindex on inputfields won't do the job unfortunately.
I am trying to install a previous version of the SDK 3.1
I am doing this to accommodate BlackBerry BB10.
Using the Manage SDK utility in Flash CS6, I currently have installed 3.2 and 3.4.
When I try to install 3.1 I first get the error that the version of the sdk I am trying to install is not valid.
Ok, I got around this by placing an airsdk.xml file in the SDK directory. Because the Archived 3.1 SDK from Adobe did not have one.. but 3.2 and 3.4 do.
Ok, not I get the error that Only SDK higher than version 3.4.2540 may be added.
So what.. now I cannot add earlier versions?
Please.. how do I add AIR SDK 3.1 as option for usage in Flash Pro CS6 ?
Hi Team,
I have created an iPad App.
adt.bat -package -target ipa-app-store : makes an .ipa which installs on my iPad, but fails to run it brings up splash screen and halts
adt.bat -package -target ipa-test : makes an .ipa which installs on my iPad, but fails to run it brings up splash screen and halts
adt.bat -package -target ipa-test-interpreter : makes an .ipa which installs on my iPad and successfully runs
After issue, i create a simple app using just one label , still the same issue
I am using correct distribution provision and certificates .
help appreciated..!!
I'm developing a desktop application in Adobe Air. I'm trying to figure out how to record video to the hard drive as a FLV file using the Camera and Video classes. I have looked everywhere in the Adobe Flash documentation for information about how to record a video, but I can't find out how to do this. Can anyone tell me how this would be done?
There is no server in this situation; in fact, the computer the software will be running on isn't even connected to the internet. If it isn't possible to record video to the hard drive using Camera or Video classes, is there some kind of work-around I could use, keeping in mind that for this project I have full access to the client computer and can install any software I need to on it? I'm developing for a project that will be shipped to customers as a kiosk computer with all software pre-installed.
Hello, im not a developer but just an end user and today i encountered an issue first it started with Tweetdeck as it stop loading tweets and said an error had occured... so i downloaded another tweeter app (via email not the from adobe market place) called seesmic which it let me download but when I tried to tweet i got this error "#-1: Error #2032" and it wouldnt send the tweet.. so then i unistalled both adobe air and Tweetdeck and seesmic and then reinstalled AIR which went fine however when i tried to download Tweetdeck again i also got Error #2032 and it then pretty much every app since then has said that, that i tried to install, im unsure how to fix this... any help would be awesome as i miss my tweetdeck and i also dont know much about Adobe Air
Hi, i was starting to explore the development of AIR application for the use on Samsung Internet@TV, i searched the site and found some useful info, but couldn't find some info that i was needing and basically.
1) Is the devolopment of Air apps for Samsung already going or does it have to still be released?
2) Using Flash CS5 or Flash Builder, do you develop a generic App for AIR 2 or is there a specific method to create them?
2) How do you port an Air app on a Samsung tv for testing ( if this is already possibile)?