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-

Similar Messages

  • 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

  • Using air app when not active

    Does anyone know how to maximize an air app without clicking on it?
    I will try to explain this but it is hard so bear with me?
    I want an air app that will be minized to the system tray to open when the user highlights text in a desktop application and the presses a certain keyboard command. The keyboard commant would be something like ctrl + t.
    Once the event is trigger I want that text to be sent to a text box in the air app from there it will be translated.
    The reason I want to do this is that I want an app that uses google translate api to translate any selectable text that may be on the screen.
    I have the translator already finished. I just want to add the feature explained above but I am not sure where to start.

    Thanks kglad.com. I will try this and see if it works. Can you check my code a bit to see if it's right?
    var continueFile:File = new File(File.applicationStorageDirectory.resolvePath("savedgames/continueGames.txt").nativePath.toString());
    Does this look right to work across all desktop OS?

  • 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 can I pass variables from one project to another using Javascript?

    Hi all, I am trying to do this: let learners take one course and finish a quiz. Then based on their quiz scores, they will be sent to other differenct courses.
    However, I wish keep track on their previous quiz scores as well as many other variables.
    I found this nice widge of upload/download variables by CPguru (http://www.cpguru.com/2011/05/18/save-and-load-data-widget-for-adobe-captivate-4-and-adobe -captivate-5/). However, this widget works by storing variables from one project in local computer and then upload it to another project.
    My targeted learners may not always use the same computer though, so using this widget seems not work.
    All these courses resided in a local-made LMS which I don't have access to their code. Therefore, passing variables to PHP html files seems not work.
    Based on my limited programing knowledge, I assume that using Javascript to pass variables may be the only possible way.
    Can someone instruct me how to do this?
    Thank you very much.

    If you create two MIDlet in a midlet suite, it will display as you mentioned means you can't change the display style.

  • Newby Question: Can AIR app have BOTH use HTML and Flex?

    I need to make a desktop app using HTML and JavaScript but I want 99% of the logic to be written in Flex.  Is that possible?
    Also, do I need to buy Flash in order to compile Flex?  Or does AIR SDK include a compiler?
    Pete

    Yes, it is possible.  For Air apps, Flex has an html control that is basically a self-contained webkit browser you can drop into your application.  You can insert html either by loading an html string, or pointing the browser to a particular location on your filesystem or on the internet.  As far as javascript, it can either be part of the site you load into the browser, or you can "cross-script" javascript in action script.  Cross-scripting may be better in certain instances, because then you can use controls written in flex to access or manipulate the html content.  To cross-script, you do something like this: var dom:Object = html.window.document, where "html" is the id of your html control.  Then, you can access javascript methods and properties through the dom object, like this: var p1:Object = dom.getElementById("p1").  See the webkit docs for available javascript methods and properties.
    No, you don't need to buy Flash.  The Flex SDK has a compiler.  You still might want to get Flex Builder (or the upcoming Flash Builder, which is the same as Flex Builder, but very different than Flash--not confusing at all...).  Or I think there are some third party IDEs for Flex, one or more of  which might be free, but I'm not sure.  I imagine it would be pretty hard for someone just learning flex and air to start building apps without Flex Builder.  Also, I think the beta of Flash Builder is still available for free, if you want to try it out.

  • NSCFString crash app when secondary used

    Hello! NSCFString from plist crash my program when i using it in the second time. I have cocos2d project (attach) with one scene and one object. And one .plist file
    HelloWorldLayer.h & .m (instantiate from CCLayer)
    NodeObject.h & .m (instantiate from CCNode)
    Test.plist
    In NodeObject i have one local string and two method
    @interface NodeObject : CCNode
        NSString *stringForPrint;
    -(void)createObjWithString:[NSString *)string;
    -(void)printString;
    In this both method we print string obtained in parameter string
    -(void)createObjWithString:[NSString *)string
        stringForPrint = string;
        NSLog(@"NodeObject.createObjWithString stringForPrint >> %@", stringForPrint);
    -(void)printString
        NSLog(@"NodeObject.printString stringForPrint >> %@", stringForPrint);
    Plis content is one array with one dictionary whit item type string.
    Root
    -TestArray <Array>
    --item 0 <Dictionary>
    ---type <String> == "This is string from plist"
    For test, into the scene i'm create NodeObject and get dada from plist. And print this string. It's work correctly.
    if ([testDictionary objectForKey:@"TestArray"]) {
                for (NSDictionary *tempItemData in [testDictionary objectForKey:@"TestArray"]) {                //It's cool work. True string from plist.
                    NSLog(@"type form plist in for loop > %@", [tempItemData objectForKey:@"type"]);            }
    I create my NodeObject into the loop. And it's work again.
    if ([testDictionary objectForKey:@"TestArray"]) {
                for (NSDictionary *tempItemData in [testDictionary objectForKey:@"TestArray"]) {
                    NodeObject *testObj = [NodeObject node];
                    //and send it string from plist
                    [testObj createObjWithString:[tempItemData objectForKey:@"type"]];
    BUT! if i have tried use this string in the printString method form NodeObject, app will crash without log. [testObj printString]; //crash app
    I have check object from plist using:
        NSLog(@"Description %@ and class %@",[[tempItemData objectForKey:@"type"]description],    [[tempItemData objectForKey:@"type"]class]);
    I repeat. Object creation with manual string work. If using string from plist it's crash. I broke my head. And only in the second method. In the createObjWithStrig it work.
        //Work
        NodeObject *testObj = [NodeObject node];
        [testObj createObjWithString:@"manual string object"];
        [testObj printString]; // Print correct string
        //Crash
        NodeObject *testObj = [NodeObject node];
        [testObj createObjWithString:[tempItemData objectForKey:@"type"]];
        [testObj printString]; //Crash here
    I'm attach project file. Can test this

    Thank you wery match!
    Only this forum help me. Stackowerflow not halped, cocos2d-iphone not helped. Thaks @etresoft
    stringForPrint = [string retain];
    solved problem.

  • My iPad 1 closes my apps when I use them.

    So basically, when I use my apps on my iPad 1 64gig, they just randomly shut down. This happens to every app. Safari, Skype, Angry birds, Garageband... Every app.
    Help Apple, please fix this! This started happening after iOS5 update.

    These are user-to-user forums, they are not monitored by Apple (there are too many forums/threads/messages for that to happen).
    Have you tried closing the app completely ? From the home screen (i.e. not with iTunes 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the iTunes app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    If that doesn't work then you could try a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • I have an 11" Macbook Air. When I use Garageband it opens in a window so large that the bottom corner is not accessible so I can't decrease the window so that I can see the top and bottom of the window at the same time. Any suggestions?

    When I use Garageband the window is so large that I can't reach the bottom corner to decrease the window to fit inside the display so that I can see the top and bottom of the window at the same time.
    Any suggestions?

    You can reduce the window by grabbing any edge or corner.   You don't have to use the bottom right anymore.
    You could also temporarily move the dock to the left/right so you can reach the bottom.

  • FlashBuilder fails to quit AIR app before launching new one

    Frequently FlashBuilder fails at quitting a currently running debug application.  Is there any way this could be improved so it could consistently quit the application when launching another debug session?
    Launch Failed
    If the program is already running, close it before attempting to run.

    These are user to user forums, so if you want Apple to see your report, best to repost it at
    http://www.apple.com/feedback/macosx.html

  • IPad 2 ipod app, when launching a song, it makes your art work full screen

    Hi there!
    I was wondering if it was possible to make it so the artwork wouldn't pop up full screen when launching a song.
    Thanks
    Jeff

    Hi Jeff,
    Sadly this is not possible, but a simple pinch on the artwork will shrink it back down, just like the back arrow does.
    You may like to give feedback to apple on this one, at the site I have linked to below.
    iPad feedback
    Hope this helps,
    Regards,
    Nathan

  • Hi,i use html,css,js write air app,when adt command support apk?

    my app can run in windows xp,and i want it run in android too;
    now is:error 304,initial window content is invalid

    its the same
    SW01#show sdm prefer
    The current template is "desktop default" template.
    The selected template optimizes the resources in
    the switch to support this level of features for
    8 routed interfaces and 1024 VLANs.
      number of unicast mac addresses:                  6K
      number of IPv4 IGMP groups + multicast routes:    1K
      number of IPv4 unicast routes:                    8K
        number of directly-connected IPv4 hosts:        6K
        number of indirect IPv4 routes:                 2K
      number of IPv4 policy based routing aces:         0
      number of IPv4/MAC qos aces:                      0.5K
      number of IPv4/MAC security aces:                 1K
    thxs

  • Count Number of Times an App ls Launched/Used

    Anyone know if there's an app and/or API or something that would let you know how many times another application-- or actually all other applications-- were either (a) launched (first time) and (b) brought to the foreground (used more than once)? I did a forum search here and couldn't find any reference, and maybe it's more of a developer question, just thought someone might have heard of an existing app that already does something like it or know if there's an existing API call that would allow it. Thx KV

    James should show 2 classes and nub should show 1 class. sorry

  • Snip tool for OneNote app when not using OneNote via desktop

    When using the OneNote app (not the OneNote program via the desktop) from my Asus Transformer Book t100, I can't use the snip tool. Or even find it. I can use it if I open OneNote from my desktop, rather than as an app from the Start display. Which kind
    of defeats the purpose of using the OneNote app. 
    Help please! I want to screenshot a pdf document (which opens via the adobe pdf app) but I can only take snips of stuff open in the desktop app.
    Thanks.

    Hi,
    The snip tool is not included in OneNote app for Windows in the Windows store. But we can capture your screen with the
    Share Charm. With Windows 8.1, anytime you see something on your screen, you can capture it and send it to OneNote by using the Windows Share Charm.
    To do this, in a Windows Store app, use the Share Charm and choose Screenshot from the dropdown menu. When you’re using the desktop, it will always create a screenshot for you. OneNote will show you a preview of the screenshot before you
    send it to OneNote.
    For more information, please refer:
    http://blogs.office.com/2013/11/25/a-big-onenote-update-for-windows-note-taking-devices/
    Regards,
    Steve Fan
    TechNet Community Support

  • Issues with Apps when not using Wi-Fi

    I just recently got the Droid RAZR and I've been having trouble using some of the apps (GPS Navigation, Pandora, Play Store, Browser, etc.) when I am not using Wi-Fi. Yesterday I tried to go for a run in while the phone stated I had a full 5 bars of 4G service, my connection to the server continued to timeout. This re-occurred when I tried to search for directions to an address. I have verified that GPS is enabled... I was easily able to do run these apps without Wi-Fi on my old Droid 1...
    Does anyone have any ideas why this may be happening?

    Thanks for your contribution, Wildman.
    Hello Snunners,
    I know how frustrating it is experiencing difficulties with applications you use on a daily basis. I ask that you clear the cache on these applications by going to Settings> Applications> Manage Applications> All> Select the application and Clear Cache. Please make sure you have the latest software update installed on your device. Let us know if you continue to experience difficulties.
    DaisyP_VZW
    Follow us on Twitter @VZWSupport

Maybe you are looking for

  • JDBC Receiver Select issue

    Hi, in the scnario soap to jdbc i am selecting records from oracle database from the soap request and response as to be sent back to soap. here i am getting this error as com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error pro

  • How to read a tiff file that has more than one page?

    Hi, I use JAI to read TIFF image and get the pixels from a raster object. A TIFF file can have more than one image in itself. The JAI doc from SUN only mentioned that we can get the number of IFD (image file directory) by using getNumDirectories() fu

  • I cannot make a group call any more

    As of a couple weeks ago, when I select someone to call, the video icon is fine and I can call them.  When I add a second person (same people I have been calling before), the icon is greyed out and I cannot initiate a call.  Both of these people I ca

  • Forms and reports on Application Express

    Hi: Is it possible to import regular forms and reports( .fmb and .rdf) into the application express and run in the database xe/application express environment?

  • Mneumonics in Swing? How to enable them?

    I'm looking at my buttons and would like to add mneumonics to them in order to use the Alt+<key> to select them. In other languages (VB and C for instance) you can use the '~' or '&' to accomplish this (i.e. E~nter would print "Enter" w/ the 'n' unde