Pass variables to AIR app?
Hi,
I want to pass a variable (SWF path) to my AIR app. I will then pass this variable as the source to my SWFLoader component present in the app.
Is there any way of achieving this? I read here http://forums.adobe.com/thread/96965 that passing FlashVars to an AIR app is not possible.
But that was two years ago. Is this still the case?
Any help would be greatly appreciated.
Thanks,
Pradeep.
You can receive command line arguments in your AIR application by handling the InvokeEvent:
http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118676a5d46-8000. html#WS5b3ccc516d4fbf351e63e3d118666ade46-7e1a
Hope this helps.
Chris Thilgen
AIR Engineering
Similar Messages
-
Passing Variable to air app when launch using Badger
Hi all,
I am going to desperately to develop my application. Hope someone can help me........
I am using badger for air which I get it here http://www.adobe.com/devnet/air/articles/badger_for_air_apps.html and it launch my app correctly, but I can't pass any variable into my app when launch.
I have read the instruction and adding some code like this :
on index.html(show my badge installer):
var so = new SWFObject("AIRInstallBadge.swf", "", "215", "180", "9.0.115", "#000000");
so.addVariable("airversion", "1.5");
so.addVariable("appname", "Secure%205");
so.addVariable("appurl", "http://localhost/testing/source/secure5.air");
so.addVariable("appid", "examples.html.HelloWorld");
so.addVariable("pubid", "B71ED76ECC937067D72BB9A0CDB516D1A8F43A9E.1");
so.addVariable("arguments", "launch from browser");// this is my code
so.addVariable("appversion", "0.1");
so.write("flashcontent");
on index.html(my initial content) :
var urlMonitor;
var urlReq;
var invokeEvent;
var applicationID = "myappid";
var publisherID = "mypubid";
var applauncarg;
//var admin="admin";
function doWindow()
var options = new air.NativeWindowInitOptions();
options.transparent = false;
options.systemChrome = air.NativeWindowSystemChrome.STANDARD;
options.minimizable = false;
options.maximizable = false;
options.resizable=false;
var windowBounds = new air.Rectangle(0,0,air.Capabilities.screenResolutionX,air.Capabilities.screenResolutionY);
var urlreq="http://www.example.com";
var newHTMLLoader = air.HTMLLoader.createRootWindow(true, options, true, windowBounds);
newHTMLLoader.load(new air.URLRequest(applauncharg));
newHTMLLoader.stage.nativeWindow.alwaysInFront = true;
newHTMLLoader.stage.nativeWindow.addEventListener(air.NativeWindowBoundsEvent.MOVE,handlem ove);
newHTMLLoader.stage.nativeWindow.addEventListener(air.Event.CLOSE,onCloseCommand);
urlMonitor = new air.URLMonitor(new air.URLRequest("http://www.example.com"));
urlMonitor.addEventListener(air.StatusEvent.STATUS, onStatusChange);
urlMonitor.start();
air.NativeApplication.nativeApplication.addEventListener(air.InvokeEvent.INVOKE, onInvoke);
//urlReq=new air.URLRequestDefaults.manageCookies = true;
function handlemove()
newHTMLLoader.stage.nativeWindow.x=0;
newHTMLLoader.stage.nativeWindow.y=0;
function onCloseCommand(exitingEvent) {
var winClosingEvent;
for (var i = 0; i < air.NativeApplication.nativeApplication.openedWindows.length; i++) {
var win = air.NativeApplication.nativeApplication.openedWindows[i];
winClosingEvent = new air.Event(air.Event.CLOSING,false,true);
win.dispatchEvent(winClosingEvent);
if (!winClosingEvent.isDefaultPrevented()) {
win.close();
} else {
exitingEvent.preventDefault();
if (!exitingEvent.isDefaultPrevented()) {
//perform cleanup
function onInvoke(e)
//apparg=event.applauncharg.toString();
//alert ('oK'+apparg);
applauncarg = event.arguments;
air.trace("onInvoke : " + event.applauncharg);
//air.Introspector.Console.log( applauncarg );
alert (applauncarg);sory, there is mistake here......
the question isn't finish yet.
function onInvoke(e)
//my code
applauncarg = event.arguments;
air.trace("onInvoke : " + event.applauncharg);
alert (applauncarg);//just to make sure the variable had been sent correctly
My application running smoothly but there is no alert that show applauncharg variable.
then I am trying to know if invoke event run correctly or not by adding code
alert ("OK");
and it works, so there is no problem with the event listener.
does any one know if I missing something or any thing wrong with my code?
sory, there is mistake here......
the question isn't finish yet.
function onInvoke(e)
//my code
applauncarg = event.arguments;
air.trace("onInvoke : " + event.applauncharg);
alert (applauncarg);//just to make sure the variable had been sent correctly
I have get the answer. If someone need the source code, just Pm me and I'll give you my Source to help you.
The first is to make sure that your action scipt code can handle the argument that passed by javascript.
Make attention between invoke event and browser invoke event! it is almost same but they are different.
If you type browser invoke event, it seems browser invokeevent doesn't recognized, but it works.
The second is my mistake on source code. onInvokeevent shold be like this :
function onInvoke(e)
//my code
applauncarg = .arguments;
alert (applauncarg);
-closed- -
Flex Builder truncate/drop variables for AIR App
I have built and compiled a Air Application with Local
versions of Coldfusion 8.0.1, Flexbuilder 3.0.2... When I Access
the SWF via browser as in
http://127.0.0.1:8300/Census.swf
everything is great and data is filled in my Datagrid.
HOWEVER, when I compile/run the AIR App (from flex builder)
on the desktop: I get this error…
[RPC Fault faultString="Send failed"
faultCode="Client.Error.MessageSend"
faultDetail="Channel.Connect.Failed error
NetConnection.Call.Failed: HTTP: Failed:
url: '
http://ensus.swf/flex2gateway/cfamfpolling'"
What is interesting is the real file is truncated (ensus.swf
not Census.swf) and the IP/Port number are omitted
Using a cf-polling-amf channel where the Server name and
variables are correctly designated as:
<channel-definition id="cf-polling-amf"
class="mx.messaging.channels.AMFChannel">
<endpoint uri="
http://{server.name}:{server.port}{context.root}/flex2gateway/cfamfpolling"
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>true</polling-enabled>
<polling-interval-seconds>8</polling-interval-seconds>
<serialization>
<instantiate-types>false</instantiate-types>
</serialization>
</properties>
</channel-definition>
and the crossdomain.xml exists as well
Also - If there were issues with the service-config.xml for
the channel definitions - wouldn't the SWF have failed to access
data as well?
Any thoughts???You can look at here:
http://sherifabdou.com/2008/06/hardcoding-the-endpoint-for-air-and-coldfusion-remoting/
I am not familiar with this. You can google AIR coldfusion
endpoint to look at related discussion.
-ted -
How to execute adobe air app & pass argument from Flex ?
Helo everyone,
May i ask a question, How to execute adobe air app & pass argument from Flex ?
Thanks in advanced.
Jacky Ho.Hello Jacky,
You can find an example here
http://spreadingfunkyness.com/passing-parameters-to-adobe-air-at-startup/ -
Pass flashvars to an AIR app?
I'm converting a Flex app to an AIR app.
The current flex app uses the SWFObject inthe html template
to pass in flashvars...
var so = new SWFObject("myappp.swf", "myappp", "${width}",
"${height}", "9.0.115");
so.addVariable("XMLData",
getXML(document.getElementById("MyXMLData")));
so.write();
...where MyXmlData is defined in the html template as
follows....
<div style="display:none;" id="MyXMLData">
<video>
<clip url="rtmp://cpxxx.edgefcs.net/500k/myflv"
hideSkin="false">
</clip>
</video>
</div>
In my ActionScript I get the flashvars as follows...
if (!loaderInfo.parameters.hasOwnProperty("MyXMLData"))
throw("Error: Missing XML Data");
How would I do this with AIR? Is there a way to pass the XML
to the loader when the AIR app is starting up? To put it another
way... How would I pass flashvars to an AIR app?
Thanks!
ChrisIt depends on how your application is being launched. If it's
being launched from a web page via the browser API, you can pass
arguments to the launch call. That's not really appropriate for an
entire XML file, but you could pass e.g. a URL to one.
However, if your application is being launched directly by a
user on the desktop, then there's no way to pass arguments to it.
Stepping back a bit, it might be more useful to think about
your use case and how to make it work, rather than focusing
immediately on Flashvars, which is just a feature.
Oliver Goldman | Adobe AIR Engineering -
How to create a more general install package for an AIR app?
Hi,
I have been using the ADT to compile an exe of my AIR app along with some other files I want to distribute. Problem is, I would like to do more general install actions (e.g. copy a bunch of files to the users Documents directory, copy a file to the local store, install fonts etc). Right now I achieve some of these by copying stuff from the application directory on the first run, but that is rather kludgy. Currently I am looking at using InstallShield or InstallAnywhere to do what I want out of the can, but I thought I'd see if anyone has some more AIR-friendly suggestions...
Thanks!In my case I managed to work around the issues we were having by doing a configuration pass on the first run of the app. That means I had to basically put all the data I needed in my assets directory using the ADT compiler, then determine if it is a first run as follows:
var locationPrefsObj:SharedObject = SharedObject.getLocal("PrefsObj");
if ( !locationPrefsObj.data.hasOwnProperty("appCreatedDate")
|| ( locationPrefsObj.data.appCreatedDate != File.applicationDirectory.creationDate.toString() ) )
firstRun();
else {
initConfig();
// initialize an existing config
The firstRun function will obviously be very bespoke, but you need to set the SharedObject at the end of it to make sure it doesn't get called every time.
// this function is only run straight after an install
private function firstRun():void {
var success:Boolean = false;
// do your first run stuff here and mark success=true if you are happy
if ( success ) {
// set the appCreatedDate - then a future install can identify dirt left by the previous install
var locationPrefsObj:SharedObject = SharedObject.getLocal("PrefsObj");
locationPrefsObj.data.appCreatedDate = File.applicationDirectory.creationDate.toString();
locationPrefsObj.flush();
Other gotchas I hit:
(1) You can copy things from the assets folder no problem, but to move or delete anything (so as not to leave lots of extra stuff hanging around), you need to (a) run with administrator privileges on Vista and w7 (the elevation happens automatically if you leave the "Run after install" box checked on an ADT install), and (b) work around the Flash security model that says you can't delete anything from a subdirectory of Program Files under any circumstances. I got around this by something like:
// delete a file
new File(File.applicationDirectory.resolvePath("assets/fileToBeDeleted").nativePath).deleteFi le();
It's a bit nasty as it violates the security model, but until ADT lets you put stuff in two install locations I can't see another way to clean up the install properly.
(2) I tried to install fonts (using VB and other stuff), but it is a real mess - the models in all different flavours of Windows seem to be different. I gave up as our software could get around it another way ...
Hope that helps! -
Example working Flex AIR app for Android?
I'm having trouble getting even the most basic AIR app working on Android. Here is the code:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:local="*"
width="600" height="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:Label text="Hello World"/>
</s:WindowedApplication>
It works fine running on Windows in Flash Builder, obviously it's pretty simple. Here are the commands I use to put it on a Samsung Galaxy Tab with Android 2.2.
C:\Users\Ryan\Adobe Flash Builder 4\Test2\bin-release>adt -package -storetype pkcs12 -keystore C:\Users\Ryan\STG-Android.pfx Test2.air Test2-app.xml Test2.swf
password:
C:\Users\Ryan\Adobe Flash Builder 4\Test2\bin-release>adt -package -target apk -storetype pkcs12 -keystore C:\Users\Ryan\STG-Android.pfx Test2.apk Test2-app.xml Test2.swf
password:
test
C:\Users\Ryan\Adobe Flash Builder 4\Test2\bin-release>adb install -r Test2.apk
2286 KB/s (419172 bytes in 0.179s)
pkg: /data/local/tmp/Test2.apk
Success
A Test2 app icon shows up on my Galaxy Tab under Applications but when I run the app I just see a plain white screen, I don't see the words "Hello World". Any ideas? Does anyone have an example Flex AIR app that works on Android and can post the code so I can try it on my Galaxy Tab? I know AIR is installed correctly on my Galaxy because I installed an AIR app called South Park Avatar Creator that I got from the market and it works fine.
Thanks,
Ryan
P.S. Here is the Test2-app.xml from my non-working project above in case it helps. This is the default generated with a new Flex app in Flash Builder 4 using the Flex 4.1.0 AIR 2.5 SDK but I uncommented the andoid tags and set the visible tag to true.
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/2.5">
<!-- Adobe AIR Application Descriptor File Template.
Specifies parameters for identifying, installing, and launching AIR applications.
xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/2.5
The last segment of the namespace specifies the version
of the AIR runtime required for this application to run.
minimumPatchLevel - The minimum patch level of the AIR runtime required to run
the application. Optional.
-->
<!-- A universally unique application identifier. Must be unique across all AIR applications.
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
<id>Test2</id>
<!-- Used as the filename for the application. Required. -->
<filename>Test2</filename>
<!-- The name that is displayed in the AIR application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>Test2</name>
<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . -->
<versionNumber>1.0.0</versionNumber>
<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
<!-- <versionLabel></versionLabel> -->
<!-- Description, displayed in the AIR application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<!-- <description></description> -->
<!-- Copyright information. Optional -->
<!-- <copyright></copyright> -->
<!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
<!-- <publisherID></publisherID> -->
<!-- Settings for the application's initial window. Required. -->
<initialWindow>
<!-- The main SWF or HTML file of the application. Required. -->
<!-- Note: In Flash Builder, the SWF reference is set automatically. -->
<content>[This value will be overwritten by Flash Builder in the output app.xml]</content>
<!-- The title of the main window. Optional. -->
<!-- <title></title> -->
<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
<!-- <systemChrome></systemChrome> -->
<!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
<!-- <transparent></transparent> -->
<!-- Whether the window is initially visible. Optional. Default false. -->
<visible>true</visible>
<!-- Whether the user can minimize the window. Optional. Default true. -->
<!-- <minimizable></minimizable> -->
<!-- Whether the user can maximize the window. Optional. Default true. -->
<!-- <maximizable></maximizable> -->
<!-- Whether the user can resize the window. Optional. Default true. -->
<!-- <resizable></resizable> -->
<!-- The window's initial width in pixels. Optional. -->
<!-- <width></width> -->
<!-- The window's initial height in pixels. Optional. -->
<!-- <height></height> -->
<!-- The window's initial x position. Optional. -->
<!-- <x></x> -->
<!-- The window's initial y position. Optional. -->
<!-- <y></y> -->
<!-- The window's minimum size, specified as a width/height pair in pixels, such as "400 200". Optional. -->
<!-- <minSize></minSize> -->
<!-- The window's initial maximum size, specified as a width/height pair in pixels, such as "1600 1200". Optional. -->
<!-- <maxSize></maxSize> -->
</initialWindow>
<!-- We recommend omitting the supportedProfiles element, -->
<!-- which in turn permits your application to be deployed to all -->
<!-- devices supported by AIR. If you wish to restrict deployment -->
<!-- (i.e., to only mobile devices) then add this element and list -->
<!-- only the profiles which your application does support. -->
<!-- <supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice</supportedProfiles> -->
<!-- The subpath of the standard default installation location to use. Optional. -->
<!-- <installFolder></installFolder> -->
<!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. -->
<!-- <programMenuFolder></programMenuFolder> -->
<!-- The icon the system uses for the application. For at least one resolution,
specify the path to a PNG file included in the AIR package. Optional. -->
<!-- <icon>
<image16x16></image16x16>
<image32x32></image32x32>
<image36x36></image36x36>
<image48x48></image48x48>
<image72x72></image72x72>
<image128x128></image128x128>
</icon> -->
<!-- Whether the application handles the update when a user double-clicks an update version
of the AIR file (true), or the default AIR application installer handles the update (false).
Optional. Default false. -->
<!-- <customUpdateUI></customUpdateUI> -->
<!-- Whether the application can be launched when the user clicks a link in a web browser.
Optional. Default false. -->
<!-- <allowBrowserInvocation></allowBrowserInvocation> -->
<!-- Listing of file types for which the application can register. Optional. -->
<!-- <fileTypes> -->
<!-- Defines one file type. Optional. -->
<!-- <fileType> -->
<!-- The name that the system displays for the registered file type. Required. -->
<!-- <name></name> -->
<!-- The extension to register. Required. -->
<!-- <extension></extension> -->
<!-- The description of the file type. Optional. -->
<!-- <description></description> -->
<!-- The MIME content type. -->
<!-- <contentType></contentType> -->
<!-- The icon to display for the file type. Optional. -->
<!-- <icon>
<image16x16></image16x16>
<image32x32></image32x32>
<image48x48></image48x48>
<image128x128></image128x128>
</icon> -->
<!-- </fileType> -->
<!-- </fileTypes> -->
<!-- Specify Android specific tags that get passed to AndroidManifest.xml file. -->
<android>
<manifestAdditions>
<![CDATA[
<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-configuration android:reqFiveWayNav="true"/>
<supports-screens android:normalScreens="true"/>
<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
<application android:enabled="true">
<activity android:excludeFromRecents="false">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
]]>
</manifestAdditions>
</android>
<!-- End of the schema for adding the android specific tags in AndroidManifest.xml file -->
</application><?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"
xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:local="*"
width="600" height="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:Label text="Hello World"/>
</s:Application> -
Using browser javascript to copy selected text from a pdf file opened in Air app.
I have posted this question on reader forum as well, but I think it is more suited here...
I am trying to create a note-taking application in air. I want to extract selected text from pdf file as a string object or to the clipboard.
Obviously, all pdfs in my local storage will not be scripted to recieve postMessages and act accordingly, and that is not practical either. So, my problem is, how can I copy the selected text in the pdf file (opened as an object in htmlloader within my Air app) to clipboard or directly in another control by say clicking a button in air application? I suppose, this is possible using javascript, however, I don't know which reader methods are exposed to the wrapper htmlloader control. In short, I want to execute app.execMenuItem("Copy") command through htmlloader javascript. Any alternate solutions are also welcome.
This is similar to passing inbuilt commands/methods/functions (of adobe reader) to pdf-reader plugin embedded in a webpage via javascript. This is possible in IE where the pdf is rendered as activex object, and hence JSObject interface of pdf document/reader is accessible to the browser javascript. I have also read that this same JSObject is accessible to VB as interface for IAC, so as the Air is Adobe's own product, I was wondering if equivalent of JSObject is accessible to htmlloader control as well.
Thanks in advance...
MitsThank you Thom for your reply...
from
http://www.adobe.com/devnet/acrobat/javascript.html
...Through JavaScript extensions, the viewer application and its plug-ins expose much of their functionality to document authors, form designers, and plug-in developers...
As it is explicitly mentioned, that the functionality of adobe reader are exposed for plugin development, I thought someone here might have used external javascript to execute some safe methods in adobe reader. The functionality (i.e. external javascript interface-JSObject) is already available for VB programmers to develop IAC. Further, the Acrobat SDK example called "AcroPDFinHML" shows how one can embed a pdf-reader in a html page and execute some safe methods (like gotonextpage(), zooming etc.) in IE as ActiveX plugin. I have checked it myself for adobe reader 9, and it works perfectly, so there is no security issue as such to implement the same for another browser (like in my case, the htmlloader control in flex/air app).
I intend to create a note taking application in air, where it is very much required that I should be able to copy selected text from various pdf documents, that are open in my app, and subsequently paste/collect/save the collected notes and process them afterwords (offcourse, from the pdfs that allow me copying text). However, it is not happening for me here. As the pdfs are opened through adobe reader plugin, it does not register the copy command executed by my air app. It registers the system level copy command (by keyboard shortcut Ctrl+C), but my air app has no way to execute the system level copy command programmatically. So I am kind of stuck here...
Thanks again for your reply. Having known what am I intend to accomplish, any other (may be alternative) solutions will be appreciated nonetheless...
Mits -
AIR apps developed using HTML+Javascript
Hi…
I am working on Adobe AIR.
And now I have 3 options to develop AIR applications 1)Flex
2) Flash 3) HTML+javascript.
But can you please explain me when do I exactly use Flex Or
HTML+JS Or Flash.
One of the reason I know is Flex used for Rich UI
applications
Is there any list of requirements for which one of the 3
option is most suitable to use.
And I have some more questions.
1) Can AIR applications(developed using HTML+Js) invoke a web
service running on a different server
2) Can AIR application(developed using HTML+Js) detect the
connectivity of USB drive (I have developed 1 application that can
detect the Network connectivity and periodically reports the status
I want the same in case of USB(plug & play) connectivity)
3) I have one AIR application that has one HTML form on click
of button I am posting the form Data to Java Servlet using
“air.sendToURL()” as shown
<script src="AIRAliases.js" />
<script>
function sendURL()
var url = "
http://localhost:8080/InvokingServlet/Registration";
var variables = new air.URLVariables();
variables.username = document.f1.username.value;
variables.password = document.f1.password.value;
var request = new air.URLRequest(url);
request.data = variables;
air.sendToURL(request);
alert("Data has been added to Remote DB...");
</script>
The data goes to Servlet and then Servlet thru Jdbc
Connectivity adds the data to database “MySQL” database
named “user”
If I read the data from database and print in Servlet it
displays that to “tomcat server window(log)” But I want
the data from Servlet to send back to HTML page where I can display
it on the same HTML page where user entered his details. So even if
I put the result into some Scope like session or request, but Can I
read that it in HTML+Javascript page .
[email protected]quote:
Originally posted by:
pravinpatil23
But can you please explain me when do I exactly use Flex Or
HTML+JS Or Flash.
This question gets asked about once a week. You
can find my latest answer
here
and a little searching will dig up more opinions.
quote:
Can AIR applications(developed using HTML+Js) invoke a web
service running on a different server
An AIR application isn't hosted on a server, so all web
servers are "foreign" to your AIR application. An AIR app does get
downloaded from a server, most of the time, but it doesn't maintain
some kind of special connection to that server.
Because of this, there are no cross-domain restrictions in
AIR like you have in a regular web browser.
quote:
Can AIR application(developed using HTML+Js) detect the
connectivity of USB drive
AIR does not allow low-level system access, and has very
little in the way of platform-specific capabilities. So, you'd have
to use a high-level, platform-agnostic way of checking for the
drive, such as by looking around to see what files are available.
Things like USB insert notifications are way outside the scope of
AIR.
quote:
I want the data from Servlet to send back to HTML page where
I can display it on the same HTML page where user entered his
details.
That question isn't on-topic here. Ask on a forum dealing
with JSP servlets. -
How to pass variables to Skin applied with skinClass?
Hi all,
I'm experimenting with new skin for a SkinnableContainer, and I would like to pass variables to that skin to dynamically change some elements.
This is how I would like it to work, but it doesn't. Is there a way to make it work? (Or something similar... like defining new stylesheet-elements in the skin.)
<s:SkinnableContainer skinClass="skins.SkinnableContainerBackground" gradient1="0xFFF000" gradient2="0x000FFF>
<s:RichText id="rt1" width="400" height="200" />
</s:SkinnableContainer>
Skin:
<s:Skin xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:d="http://ns.adobe.com/fxg/2008/dt"
xmlns:ai="http://ns.adobe.com/ai/2008"
height="100%"
width="590">
<s:layout>
<s:BasicLayout/>
</s:layout>
<s:states>
<s:State name="normal"/>
<s:State name="disabled"/>
</s:states>
<fx:Metadata>[HostComponent("spark.components.SkinnableContainer")]</fx:Metadata>
<fx:Script>
<![CDATA[
[Bindable] public var gradient1:uint;
[Bindable] public var gradient2:uint;
]]>
</fx:Script>
<s:Group top="0"
bottom="0"
left="-11"
right="0">
<s:Group x="15"
top="0"
bottom="0"
id="kaft">
<!-- <s:filters>
<s:DropShadowFilter alpha="0.4"
blurX="6"
blurY="6"
distance="4.24264"
quality="3" />
</s:filters>
-->
<s:Rect width="586"
ai:knockout="0"
d:userLabel="kaft"
top="0"
bottom="0">
<s:fill>
<s:LinearGradient y="82.3125"
scaleX="585.975"
rotation="-0">
<s:GradientEntry color="{gradient1}"
ratio="0.466667"/>
<s:GradientEntry color="{gradient2}"
ratio="1"/>
</s:LinearGradient>
</s:fill>
</s:Rect>
</s:Group>
</s:Group>
<s:Group id="contentGroup"
left="20"
right="20"
top="10"
bottom="20">
<s:layout>
<s:BasicLayout/>
</s:layout>
</s:Group>
</s:Skin>ou can also define custom CSS styles:
MySkinnableContainer.as
[Style(name="gradientA", type="uint", format="Color", inherit="no")]
[Style(name="gradientB", type="uint", format="Color", inherit="no")]
public class MySkinnableContainer extends SkinnableContainer
public function MySkinnableContainer()
super();
MySkinnableContainerSkin.mxml
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/halo"
xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Metadata>
<![CDATA[
[HostComponent("MySkinnableContainer")]
]]>
</fx:Metadata>
<s:states>
<s:State name="normal" />
<s:State name="disabled" />
</s:states>
<s:Group bottom="0" left="-11" right="0" top="0">
<s:Group id="kaft" x="15" bottom="0" top="0">
<s:Rect width="586" bottom="0" top="0">
<s:fill>
<s:LinearGradient y="82.3125" scaleX="585.975" rotation="-0">
<s:GradientEntry color="{getStyle('gradientA')}" ratio="0.466667" />
<s:GradientEntry color="{getStyle('gradientB')}" ratio="1" />
</s:LinearGradient>
</s:fill>
</s:Rect>
</s:Group>
</s:Group>
<s:Group id="contentGroup" bottom="20" left="20" right="20" top="10" />
</s:SparkSkin>
styles.css
@namespace local "*";
local|MySkinnableContainer {
gradientA: #FF0000;
gradientB: #000FFF;
skinClass: ClassReference("MySkinnableContainerSkin");
main app:
<fx:Style source="styles.css" />
<local:MySkinnableContainer width="590" height="100%">
<s:RichText id="rt1" width="400" height="200" color="#000000" text="test" />
</local:MySkinnableContainer> -
How to pass variable to SQLPLUS in a ksh script?
Hi,
I am writing a ksh script which will use sqlplus to run a sql and pass 2 variables as the SQL request. In the ksh script, I have 2 variables which are $min_snap and $max_snap holding 2 different numbers.
Inside the same script, I am using SQLPLUS to run an Oracle SQL script, which request to enter 2 set of numbers, one at a time. Normally running situation, I can enter the number from the keyboard, but since I am writing a script, I want to pass those numbers by passing variables in the script? How can I do it?
Please help!
here is my ksh script,
#!/bin/ksh
if [ "$1" = "" ]
then
echo "Usage : delete_snapshot.sh <db_name>"
exit
fi
export ORACLE_BASE=/oracle1/app/oracle
export ORACLE_PATH=.:/oracle1/app/oracle/product/8.1.7/tune
export ORACLE_HOME=/oracle1/app/oracle/product/8.1.7
export ORACLE_RDBMS=$ORACLE_HOME/rdbms/admin
export ORACLE_SID=$1
curr_time=`date +"%m/%d/%y %H:%M:%S"`
log_file=/home/mdbtuner/stats/sppurge/log/{$ORACLE_SID}_`date +"%Y%m%d"`.log
#echo $log_file
echo "****** Delete Snapshot for $ORACLE_SID at $curr_time ******" >> $log_file
#echo "****** Delete Snapshot for $ORACLE_SID at $curr_time ******"
#echo $ORACLE_HOME/bin/sqlplus -S perfstat/perf$ORACLE_SID@$ORACLE_SID
cd /home/mdbtuner/stats/sppurge
$ORACLE_HOME/bin/sqlplus -S perfstat/perf$ORACLE_SID@$ORACLE_SID << EOF > $min_snap
@min_snapid.sql
exit;
EOF
$ORACLE_HOME/bin/sqlplus -S perfstat/perf$ORACLE_SID@$ORACLE_SID << EOF > $max_snap
@max_snapid.sql
exit;
EOF
echo $min_snap $max_snap
cd $ORACLE_RDBMS
#$ORACLE_HOME/bin/sqlplus -S perfstat/perf$ORACLE_SID@$ORACLE_SID << EOF >> $log_file
$ORACLE_HOME/bin/sqlplus -S perfstat/perf$ORACLE_SID@$ORACLE_SID << !
@sppurge
$min_snap
$max_snap
exit;
#EOF
Thanks in advance!
Robert
Message was edited by:
user168Thank you for response, Paul.
Have you ever used statspack? or sppurge.sql?
When you run $ORACLE_HOME/rdbms/admin/sppurge.sql, it waits for user to enter losnapid and hisnapid manually from the keyboard.
My trouble is to have a script to delete old snapshot which are 3 weeks old. So I create min_snapid.sql and max_snapid.sql to hold two variables.
Based on your solution, I tried it but it doesn't work.
It returns the error messages as following....
Warning
~~~~~~~
sppurge.sql deletes all snapshots ranging between the lower and
upper bound Snapshot Id's specified, for the database instance
you are connected to.
You may wish to export this data before continuing.
Specify the Lo Snap Id and Hi Snap Id range to purge
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for losnapid: Using exit; for lower bound.
Enter value for hisnapid:
User requested Interrupt or EOF detected.
Enter value for hisnapid:
User requested Interrupt or EOF detected.
WARNING: LoSnapId or HiSnapId specified does not exist in STATS$SNAPSHOT
Enter value for hisnapid:
User requested Interrupt or EOF detected.
Purge of specified Snapshot range complete. If you wish to ROLLBACK
the purge, it is still possible to do so. Exitting from SQL*Plus will
automatically commit the purge.
------------------------------------------- -
How to get errors and/or air.trace() from installed air app?
I'm trying to debug an installed air app that behaves
differently once installed than when run with adl. However, i can't
figure out any way to get errors or air.trace() information. I am
on OS X (10.5.6). Any tips?
I imagine this should be easy since debugging an installed
app is pretty much a necessity for development.You can enable logging to a text file using settings in the
mm.cfg file. See
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19323
Note that ALL trace output will go to the log.
Other things you can do are:
1. Run the installed app with adl -- just pass the installed
app descriptor to adl on the command line
2. Supply a publisher id to adl. This removes one difference
between installed/ not installed apps and may be enough if the
behavior issue has to do with local connections or other matters
involving the publisher id.
3. Use the adl -nodebug flag. This removes another difference
between installed/uninstalled apps. You won't see uncaught
exceptions, but trace statements are still reported. -
I have an embedded bitmap resource, one of many in my program, which is an AIR app. There's nothing unusual about it; in fact, I can replace the file to be embedded with a blank white file of the same size, or another (working) bitmap from the same program, and get the following results.
Whether my app works or not depends on what I name the variable corresponding to the embedded resource (the :Class variable after the embed directive). If I name it "sprBatteries", the app hangs at startup in the iPhone; the loading screen transitions into the stage background color, and shows none of the stage contents. If I name it "sprDryCells", or even "sprBatteriesX", it works fine and displays the expected contents.
This works fine testing on my desktop, regardless of the variable name. I suspect that it is encountering an exception on load, but it seems to be happening before FDB can connect, so I don't know what the problem could be. EDIT: Oh, and I believe that it works fine if I compile the app as a simple AS3/Flex app rather than as an AIR app. I haven't done systematic testing to confirm this, though.
Does anyone have any idea what could be going on and how I could fix it?leotemp, that's a very smart(***) answer - but don't name
them
what? I read your earlier post of today: you might benefit
by looking at Aral Balkan's Quick Start about skinning the
components.
I have not seen anything in all the documentation about names
to avoid in naming files. If there are restrictions on this, it
would be nice to see a list of those names and the situations in
which the restrictions apply. I would think renaming the file is
not the first thing a programmer does when an unusual message shows
up in the Problems window in FB.
If anyone has something to say about this, please do so.
Cheers,
Carlos -
AIR app will not run on Win XP
I craeted an AIR app for my company's sales team. I've passed it around and it works fine on most machines (mostly Dell laptops running Windows XP). I have one salesman who was able to run earlier versions of the app, but now opening the app does nothing. I can see it running in the background when I look at the Processes tab in Windows Task Manager. No one else has had this problem. I've tried uninstalling and reinstalling both the app and the AIR player (version 1.5.3.9130). Are there any Windows security settings he might have set that would prevent an AIR app from opening?
I ran the install log and I'm including the contents to see if you can make any sense of it
. The only thing that sticks out is a line "Application not located", which I highlighted below. Otherwise it looks like it installed
just fine. I appreciate your taking a look at this.
Starting app install of file:///C:/Documents%20and%20Settings/Andrew.esposito/Desktop/ROI_CalculatorAir-060310.ai r
UI SWF load is complete
UI initialized
Unpackaging to C:\Documents and Settings\Andrew.esposito\Local Settings\Temp\flaA2.tmp
unpackaging is complete
application is bound to side-by-side version 1.0
application is bound to this version of the runtime
app id ROI-CalculatorAir3
pub id 579DB9134D64DA8D12906F2BE8761198D0983B68.1
Application not located
Waiting for user confirmation
User confirmed action: install
creating native installer in: C:\Documents and Settings\Andrew.esposito\Local Settings\Temp\flaA3.tmp
native installer creation complete
Starting install
Destination for installed application is C:\Program Files
Beginning install
Installing C:\Documents and Settings\Andrew.esposito\Local Settings\Temp\flaA3.tmp\setup.msi
Execution complete; beginning commit phase
Commit complete
Re-launching application from C:\Program Files\ROI_CalculatorAir3\ROI_CalculatorAir3.exe
starting cleanup of temporary files
application installer exiting -
Adobe Air App No Fonts [SOLVED]
I installed lib32 adobe air and when I run my app I don't get any fonts. I just get square boxes. I read a few suggestion that are a little old, but am wondering if I am not setting a variable right or am missing something. I think from the error message that I am getting it is trying to read pango64 instead of pango32.
(adl:7308): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
How do I set it so adobe air apps look for the correct lib32 pango?
Thanks
Last edited by cu3edweb (2009-04-04 19:42:14)Nevermind I found this thread that did it.
http://bbs.archlinux.org/viewtopic.php?id=35820
Maybe you are looking for
-
How do I retrieve my photos?
Hello, Yesterday I had to have my iPhone 4s replaced, the Lock button was stuck. The Mac Genius did a back up for me on iCloud and said everything except some of the songs in itunes will transfer over (the ones that I tranfered from CD's and such). T
-
What are these up and down arrows on a region?
I'm having a problem with some regions in my project. First, I imported some wav files that were sent to me. These are audio tracks that were individually exported from Final Cut Pro 7. After importing them into Logic X, about 3 of them displayed the
-
Security Settings on Authorware Player Install
In the awswax.inf file, located in the awswax.cab, file there are various settings available. Does anyone know if we can define security settings in this file so when the user installs the Authorware player, the settings get put into the AWSHKWV.INI
-
Browser Virus Malware Adware etc. HELP!
I have been trying for 3 days to kick this absurd problem off of my Macbook Pro. It feels like I have a virus/malware/adware situation that is making me feel like I'm back on a PC (UGHHHHH). BEFORE THE PROBLEM: I kept getting "scratchdisk" or "start
-
Hi list! I have serious issues with my sata drive on my K8N Neo-FSR. The SATA drive is connected on the SATA3 controller, and an IDE DVD is connected as master on IDE channel 1. The DVD is detected by the BIOS and can be booted... BUT, the SATA hard