Passage of variables to javascript in flex mxml mobile

Hi all

I'm developing a flex app where I load a file (located in my assets in srcfolder) javascript using phase in Web mode. I am able to display the page but I'm not able to understand how to pass variables to the mxml file that contains the web scene view towards the javascript file and vice versa.

var file:File = File.applicationDirectory.resolvePath("assets/demo.html");

                webView.stage = this.stage;
                webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight);
                webView.loadURL("file://" + file.nativePath);

That's how I'm the loading html file... I need change in a variable inside the demo.html file when running... e i. I need to move from a selected item in a list contained in the main.mxml file and a value inside demo.html avriable...

Help, please!

http://Voisen.org/blog/2010/10/making-the-most-of-stagewebview/

Tags: BlackBerry Developers

Similar Questions

  • How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?

    I have the simple mxml code

    <mx:DataGrid id="DGG"
                
    editable="true">
       
    <mx:dataProvider>
           
    <mx:Object scheduledDate="4/1/2006"/>
       
    </mx:dataProvider>
    </mx:DataGrid>
    <mx:Button id="SetBut"
              
    label="Set Array as Data Provider"
              
    click="SetDP(); AddBut.visible = true;"
              
    x="100.5"
              
    y="164"
              
    width="211"/>
    <mx:Button id="AddBut"
              
    label="Add a column!"
              
    click="AddCol();"
              
    x="100.5"
              
    y="194"
              
    width="211"
              
    visible="false"/>
    <mx:Script>
        <![CDATA[
            import mx.controls.dataGridClasses.DataGridColumn;
            import mx.collections.ArrayCollection;

            [Bindable]
            public var MyAC:ArrayCollection=new ArrayCollection([{scheduledDate: "4/1/2006", homeTeam: "Chester Bucks"}]);

            public function SetDP():void
            {
                DGG.dataProvider=MyAC
            }

            public function AddCol():void
            {
                MyAC.addItem({scheduledDate: "4/5/2007", homeTeam: "Long Valley Hitters", Umpire: "Amanda Hugenkis"});
                DGG.columns.push(new DataGridColumn("Umpire"));
            }
        ]]>
    </mx:Script>

    I want to add lines to my datagrid table how do such thing?

    How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?

    (You can place this code in a Flash or AIR application - it compiles without error, but will not add any columns =)

    Change this:

    public void SetDP (): void
    {
    DGG.dataProvider = MyAC
    MyAC.addItem ({scheduledDate: "05/04/2007", homeTeam: "long hitters Valley", umpire: "Amanda Hugenkis"});
    }
               
    public void AddCol (): void
    {
    var dgc:DataGridColumn = new DataGridColumn ("Umpire");
    var ca:Array = DGG.columns;
    CA.push (DGC);
    DGG.columns = ca;
    }

    Dany

  • Definition of variables in Javascript

    Hi all
    We try to set a variable in javascript as follows:

    var myFish = $v('P22_EPSB_SGF_GROUP').value;

    does not work. However, the statement
    If ($v ('P22_EPSB_SGF_GROUP') == '2')

    can be evaluated.

    Any help would be appreciated.

    Thank you

    lilhelp,

    The $v function returns the value, you don't need the "value".

    The $x function returns the element so you need the 'value '.

    Kind regards
    Dan

    http://danielmcghan.us
    http://sourceforge.NET/projects/tapigen

  • Load an external Php variable in Actionscript in flex.

    Hello

    I have be trying to load an external variable from a php file in an actionscript variable.i know how to bind the php mysql data to datagrid but not what I'm looking for, example say a php variable has a value = 5, this value will be passed to a variable limit actionscript, so now limit will have the value 5.

    I use flex 3 and I have tried many examples listed on google, I went through all the tutorials, codes, etc... all of them were made using cs3 or cs4. And when I ran get them I have strength any output at all. Either I myself am thatproperty charger was not defined or nothing in my textarea.

    If possible please guide me on the next or even want to give a small sample that works on flex3.i am also unsure of what I shud write in my php file.

    I added the code to my mxml file for what does not work and shows me a blank text box.

    Any help would be appreciated... Thanks in advance

    <? XML version = "1.0" encoding = "utf-8"? >
    < mx:Application xmlns:mx = "httw://www.adobe.com/2006/mxml" xmlns:custom = "" test.external. * "layout ="absolute"initialize =" load() ">"
    < mx:Script >
    <! [CDATA]

    private function load(): void {}
    var loader: URLLoader = new URLLoader();
    loader.addEventListener (Event.COMPLETE, onComplete);
    Loader.Load (new URLRequest (https://localhost/external.php));
    }

    private void onComplete(e:Event):void {}
    Ext. Text = URLLoader (e.target) .data;
    }



    []] >
    < / mx:Script >
    < mx:TextArea id = "ext" x = "296" y = "199" >


    < / mx:TextArea >
    < mx:Button click = "load()" x = "343,5" y = "274" > "

    < / mx:Button >
    < / mx:Application >


    Your service works when she is called in the browser?

    C

  • How can I add javascript to my mxml?

    I try to add the following on my page of flex 3 mxml javascript code:

    < script type = text/javascript language = Javascript src = http://gwbanner.com/gwbanner?siteCode=1534-Admin > < / script >

    I tried the following code, but the tags < script > does not seem to be understood (the output is actually javascript code, as if the script tag is ignored).

    < mx:Text

    " width = ' 100% "color =" " Blue "fontStyle =" " italic "fontSize =" " 14 " >

    < mx:htmlText >

    <! [CDATA]

    < script type = text/javascript language = Javascript src = http://gwbanner.com/gwbanner?siteCode=1534-Admin > < / script >

    []] >

    < / mx:htmlText >

    < / mx:Text >

    I can add the javascript directly in the html, I guess, but there should be a better way not?

    Thank you

    JavaScript is supported only in the HTML wrapper, not in the components.

  • Passing variable pageflowScope JavaScript on page load event


    Hello

    I'm attempting to pass pageflowScope value of the variable in the javaScript on the page Load method.

    < af:resource type = "javascript" >

    getTitle (evt) {} function

    var titleString = document.title;

    Alert ("Welcome1");

    Var manual = evt.getSource () .getProperty ('rowKey');

    Alert (Manual);

    }

    < / af:resource >

    < af:form id = "f1" >

    < af:clientAttribute = name value = "#{pageFlowScope.readOnlyParam}" / "rowKey" >

    < af:clientListener method = "getTitle ()" type = "load" / > "

    < / af:form >

    First alert got printed but I don't get the value of the variable pageFlowScope in Javascript...

    Any help will be appriciable.

    Kind regards

    Krishan

    ,.


    Hello

    Add after the code inside

    tag

    function onPageLoad (evt) {}

    Alert (evt. GetSource(). GetProperty ('vattr'));

    }

    and it does not work for me

  • Passing variables to Javascript

    Does anyone know how to pass a variable javascript in As2? Thank you!

    JavaScript / Flash Communication
    --------------------------------

    Here is a link that provides information on this...

    http://kb2.Adobe.com/CPS/156/tn_15683.html

  • AS3 SWF is not updated to the variables through javascript

    Do not find this one: I have a C4 project with 2 slides.  First slide has a button that executes a Javascript call:

    SetStringVariable("myVar");
    

    Where myVar is an internal variable of the user of C4 with a default value of "Hello World".

    The second slide a myVar is displayed in a text caption.

    I publish the SWF (AS3) and add this javascript function in the .htm file:

    function SetStringVariable(n)
    {
         document.getElementById('Captivate').SetVariable(n, "I set my variable!");
         alert("my var: " + document.getElementById('Captivate').GetVariable(n));
         
    }
    

    When you run the project on the web, the alert comes up with 'I put my variable!', but the legend of slide 2 still says 'Hello World '.  Not sure why this happens since I just did a round trip with the variable.  It is as if the C4 assigns the variable behind the scenes, but is not updated in the user interface.  This will not occur if the C4 project is published in AS2.

    All this experience?  No work around?  I would like to be able to use the SetVariable function in AS3 projects.

    TIA,

    Jim Leichliter

    Sweet - I think I need this thing... :-)  Thank you!

  • Passage of Variables

    Very well... simple, but not for me it's a matter of AS2.

    I have a Flash document and herein, I have an empty clip that I use a placeholder load another Flash animation. When I insert the second swf document in the main swf document, I have buttons that generate values from 1 to 9 (depending on which button the user clicks)... the variable is defined as pageNumber.

    I then return to the main timeline in the film using "_root.gotoAndPlay". According to the value of the variable, the timeline has a specific function.

    Here's my problem... the variable pageNumber sets properly; However, when I run the _root command to return to the main timeline, the value always resets to 1.

    Why resets the value to 1?

    Thanks for the reply... actually the problem was more with the passage of the variable; However, I did some research and solved the problem... maybe I should have dug a little more before this forum.

    In any case... Thanks again.

  • Assign the value to the Application Variable via javascript

    Hello

    How can I assign value to an element of the application (not the page element) through javascript.

    I tried to assign the value as follows:

    $s ('F150_REGION_TEMP', region);

    where F150_REGION_TEMP is the application variable and 'region' is populated value in javascript.

    Kind regards
    Benz

    Hello

    Try

    
    

    BR, Jari

    Published by: jarola on March 1st, 2010 14:47

  • URL popup and passage JS variables or?

    Hello...

    The following JS script opens a new window and that window is a model called "viewer.cfm". The pictures are shown in this model (viewer.cfm)... for example: HPIM0877. JPG, HPIM1009. JPG

    I need to pass variables from all the pages that have the following link (below) to "viewer.cfm".

    I have maybe 40 images to deal with, but I'm stuck on a universal #variable # to display the images and their transmission.

    I did not understand any code on the model of receiver "viewer.cfm" as I am a bit stuck.

    Thank you...

    EXAMPLE OF

    < cfoutput > < A HREF = "javascript:void (0)" "
    onclick = "Window.Open ('viewer.cfm? #HPIM0877.)" JPG # ', 'Welcome',' width = 580, height = 440, menubar = no, status = no') ">"
    course < /A > < / cfoutput >

    I have it

    Thank you for those who have given me feedback.

  • Pass Variables from JavaScript CS3 ActionScript

    Hello

    I can't understand what I'm doing wrong and I need help . Who better to ask than legal experts?

    I have everything works fine so far except for this actionscript. I use CS3 Flash with ActionScript, CS3.

    I have 5 buttons in flash.
    I try to perform the following tasks
    1. ensure buttons with effects in flash - done
    2 put the button in the down position based on the Web page that the user is on.
    To perform this dynamic, I apparently have to use 3 different languages, PHP, JavaScript, ActionScript.

    I've been playing with this during a week and can not understand. I have the rest of the scripts tested and verified to work.

    Here is the link to my test page
    http://www.spectacularstuff.com/PHP-test/inProgress/php-URL-detection.php

    Here is my code for the test. (This does not include the buttons. It is simply to test to see if I'm passing variable.)

    PHP code to detect the file name.
    <? PHP
    function curPageName() {}
    Return substr ($_SERVER ["SCRIPT_NAME"], strrpos($_SERVER["SCRIPT_NAME"],"/") + 1);
    }
    ECHO "is the current name of the page detected by PHP". curPageName();
    ? >

    The JavaScript Code to pass variables to the Flash
    < script language = "javascript" src = "swfobject.js" >
    var so = new SWFObject ("php - url - detection.swf", "php-url-detection", "550", "400", "9", "#FFFFFF");
    so. AddVariable ("currentpage","<? php echo curPageName();? >" ")
    < /script >

    ActionScript Code to get the JavaScript Variables and display them in flash.
    Dynamically create text fields
    var tf:TextField = new TextField();
    tf.autoSize = TextFieldAutoSize.LEFT;
    TF. Border = false;
    addChild (tf);

    var tf2:TextField = new TextField();
    TF2. AutoSize = TextFieldAutoSize.LEFT;
    TF2. Border = false;
    addChild (tf2);

    Create the variable to write to the page
    var myStr2:String;

    first attempt to put the variable on the page.
    This LoaderInfo must be capitlized. An error occurs if not.
    var paramObj:Object is LoaderInfo (this.root.loaderInfo).parameters.currentpage;.

    second attempt to put the variable on the page
    var myStr:String = this.root.loaderInfo.parameters.currentpage;
    trace (paramObj);
    trace (myStr);

    If (myStr is nothing)
    {
    myStr = "Flash is not reading JavaScript variables.:(";).
    myStr2 = "";
    }
    on the other
    myStr2 = "" Flash read the JavaScript variables! :)) ' "

    TF. Text = myStr; Display the URL on the page
    TF2. Text = myStr2 //Display Flash is happy

    [- End of Code-]


    Help, please.

    Thank you in advance.

    Wayne

    I found an answer to this for someone looking for an answer. I wrote the answer in another forum:
    http://Board.flashkit.com/Board/ShowPost.php?p=3946455&postcount=31

  • Passage of Variables in TestStand through LabView

    I have an error, I am developing a crush on the recall of database Options. I say TestStand what database to write. I am in him passing a variable and I get an error. Here is a description of the error.

    Here is the statement I use:

    DatabaseOptions recall that I use a statement that change the data of databases is stored.

    I have a VI that passes a string that represents the location of my data file, I want to use. I stored it as a variable in database called StationGlobals (it's currently a string but I tried the executable file and the way too with the same error).

    Parameters.DatabaseOptions.ConnectionString = StationGlobals.Database

    StationGlobals.Database has the value

    "\"Provider=Microsoft.Jet.OLEDB.4.0; Persist Security Info = False; Data Source = C:\\Users\\Public\\Documents\\\National Instruments\\\TestStand 4.2.1\\Components\\Models\\\TestStand Results.mdb;. » »

    There must be a problem with variables, because when I copy and paste what StationGlobals.Database in and use the following statement it works perfectly fine.

    Parameters.DatabaseOptions.ConnectionString = '\"Provider=Microsoft.Jet.OLEDB.4.0; Persist Security Info = False; Data Source = C:\\Users\\Public\\Documents\\\National Instruments\\\TestStand 4.2.1\\Components\\Models\\\TestStand Results.mdb;. » »

    Here is the error I get:

    Details:

    An error occurred calling "LogResults" in "ITSDBLog" of "ZNIUGOL TestStand database logging"

    An error occurred initializing a connection to a data binding.

    Connection string: "Provider = Microsoft.Jet.OLEDB.4.0; Persist Security Info = False; Data Source = C:\Users\Public\Documents\\National Instruments\\TestStand 4.2.1\Components\Models\\TestStand Results.mdb. »

    Description: [Microsoft] [ODBC Driver Manager] data too long name source

    Number:-2147467259

    NativeError: 0

    SQLState: IM010

    Reported by: Microsoft OLE DB provider for ODBC drivers

    Source: TSDBLog

    Error code:

    -2147467259; User-defined error code.

    Possible system error: unspecified error

    Geographical area:

    Step 'Results of the log to the database' sequence "Log to database" in "Database.seq".

    Please help I can not find a solution to this issue.

    Thanks a lot for any help

    Once more, the channels of Expression, stumbled to another programmer!

    Parameters.DatabaseOptions.ConnectionString is not a string but an Expression string and your assignment of an StationGlobals.Database (just a string) causes this error.

    Here's what I did to solve your problem:

    1.) StationGlobals (start and remove the leading "------"------"' chain of database") must contain NO beginning or end quote

    StationGlobals.Database = Provider is Microsoft.Jet.OLEDB.4.0;. Persist Security Info = False; Data Source = C:\\Users\\Public\\Documents\\National Instruments\\TestStand 4.2.1\\Components\\Models\\TestStand Results.mdb.

    2.) rappel Database Options use the following expression to define the Data Source

    Parameters.DatabaseOptions.ConnectionString = "StationGlobals.Database".

    There are other alternatives as stated in this link.

    http://zone.NI.com/DevZone/CDA/tut/p/ID/4793

    Good luck

    PH

  • ODI scenario failure during the passage of variables as parameters in the scenarios of the child

    I have defined a script in such a way that the variables in this scenario will pull data from other tables of configuration and pass those values as parameters to another this scenario in the first scenario of parent. I tested in DEV and DEV, test environments that are shared with the same topology with repositories different works. It has worked well. But when I moved the code to the QA environment, then I get the following error message. While attemption to run the scenario with the following command,

    Execution code:

    OdiStartScen '-SCEN_NAME = XXXXX ""-SCEN_VERSION =-1 ""-LOG_LEVEL = 5 ""-PROJECT_NAME. "" "" PASS = # PROJECT NAME. V_PASS""-PROJECT_NAME.» DB_URL = #PROJECT_NAME. V_DB_URL""-PROJECT_NAME.» DB_SCHEMA = #PROJECT_NAME. V_DB_SCHEMA""-PROJECT_NAME.» DB_LINK = # PROJECT NAME. V_DB_LINK""-PROJECT_NAME.» DB_USER = # PROJECT NAME. V_DB_USER ".

    Error message:

    oracle.odi.oditools.OdiToolInvalidParameterException: error when setting the parameters on the tool

    at com.sunopsis.dwg.function.SnpsFunctionBase.getCoreOdiTool(SnpsFunctionBase.java:618)

    at com.sunopsis.dwg.function.SnpsFunctionBase.getSunopsisApi(SnpsFunctionBase.java:494)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeOdiCommand(SnpSessTaskSql.java:1431)

    at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:44)

    at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:1)

    at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)

    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)

    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1889)

    to oracle.odi.runtime.agent.processor.impl.StartScenRequestProcessor$ 2.doAction(StartScenRequestProcessor.java:580)

    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)

    at oracle.odi.runtime.agent.processor.impl.StartScenRequestProcessor.doProcessStartScenTask(StartScenRequestProcessor.java:513)

    to oracle.odi.runtime.agent.processor.impl.StartScenRequestProcessor$ StartScenTask.doExecute (StartScenRequestProcessor.java:1066)

    at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)

    to oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$ 2.run(DefaultAgentTaskExecutor.java:82)

    at java.lang.Thread.run(Thread.java:662)

    Caused by: java.lang.Exception: disagreement quote...!

    at com.sunopsis.core.SnpsObject.extractParametersLine(SnpsObject.java:174)

    at com.sunopsis.dwg.function.SnpsFunctionBase.getCoreOdiTool(SnpsFunctionBase.java:580)

    ... 18 more

    The variable values for this new environment a probably double-quotes ("") or a special character which is to 'break' the command line. Use this trick ODI to understand all the variables values used in this step and use the values of the test in a procedure separate with just values, not variables:

    http://devepm.com/2014/02/28/execution-variables-trick-for-old-versions-of-ODI/

    It will be useful.

  • passage of variables in rtf

    Hi all, I have parent child sets of data in a data model. While displaying the result. I want to pass the ID of the parent to the child set while there will be the largest in void / lines. Here NAME, ID is part of the parent fields and TYPE, DR is part of the fields of the child and they have all two common IDS. I have problems to display the levels of the child. I tried to create the variable and pass the ID of the group to the child and it does not work. <? xdoxslt:set_variable($_XDOCTX,'ID',ID)? > and in the Group <?-foreach: / / R [_ID=.//node () [local-name () = ID]? > ]

    If I can show the data model is maybe things will be clear. Are there documents where I can change the value using the variable for the group.

    NAME                                       ID                            TYPE

    Dr. John barns SMA ORDR001 PA001 CR

    RV001 CR

    .                                                                                  STA TR

    LOMBARD TRUMAN ADM ORDR004 INCT CR

    AR PA001

    SI001 BR

    Thanks, Sushil

    I sent you a model modified by your email. Take a peek inside.

    Thank you

    Bipuser

Maybe you are looking for

  • Can I update my iPhone 4s to ios instead of ios 8 9?

    My 4S is running ios 7 and I want to upgrade to ios 8. In the settings there is invites me to upgrade to ios 9. Then I, and if I do how I update to ios instead of ios 8 9?

  • Satellite C660 / 03C does not start after upgrading RAM

    Has decided to upgrade my lappy missed at 4 GB and bought 2 x legend 2 GB L256483J - 16 (2 x 2 GB DDR3 - 1333) chip and will not go beyond bios. Put the dirty old standard 2 GB Samsung PC3 - 10600 S-09-10-222 back in and works fine. Then put 1 legend

  • Transform TF101 does not start

    My ASUS Transformer TF101 eee Pad will not start. When I have it turn on the start screen comes on and turns off in about 5 seconds. Once I do the power button has no effect and the start screen continues to do so until the battery dies. I tried the

  • EA6700 Cup internet high speed two

    Hello I just sign up for Time Warner internet Turbo, which promises speeds of up to 20MBPS down and 2 Mbps upward.  I use a Motorola SB6141 modem and a Linksys EA6700 router. When I test the speed using Speednet or Speakeasy speed test clean of TW, m

  • How can I find out what operating system I had on my laptop.

    queary code of Vista? How can I know what o/s I had on my laptop I have the code just cannot read what is on the sticker and had to put the new h/d in there please help