Global Access to Listener Function

Hello All --
I am using a third-party Flash add-on tool that will let me
get a device's battery level (among other things) via listeners.
The following code is in my first actionscript frame:
import ssp.device.*;
var statusListener:Object = new Object();
// set-up status listener to get battery level
statusListener.getBatteryLevel = function(e)
_global.batteryLevel = e;
Status.addEventListener(statusListener);
Status.getBatteryLevel();
The final line in the preceding script successfully sets
_global.batteryLevel. The problem is that the script is run only
once, when the application starts. What I need to be able to do is
to call Status.getBatteryLevel() from a battery monitoring
movieclip within my main movie. The movieclip runs constantly to
update a display of remaining battery charge.
Unfortunately, whenever I try to execute
Status.getBatteryLevel() from any frame other than the one where
the listener is set-up, the function does not work. Is there
something that I need to do to make the function call available
globally?
Regards,
-- Phil

It seems unusual that the Status object only dispatches
events when you request them... but perhaps its just a model I'm
not used to. Anyhow...
Where is your monitoring clip relative to the timeline that
holds Status?
If its also in the same timeline then you should be able to
get to Status from its timeline by using
_parent.Status.getBatteryLevel();
I never really use the _global object, but I guess you could
do that too.
Status.addEventListener(statusListener);
Status.getBatteryLevel();
_global.getBatteryLevel = Status.getBatteryLevel;
then just use
_global.getBatteryLevel();
I think that would work.

Similar Messages

  • I have just sought  to update my lightroom and am now unable to access the develop function and get a note stating that I have reduced functionality what it this about and how do I get my product back

    I have just sought  to update my lightroom and am now unable to access the develop function and get a note stating that I have reduced functionality what it this about and how do I get my product back

    Hi there
    I have version 5.7 and every time I opened it I was told that updates are available and to click on the icon to access these.  Instead it just took me to the
    adobe page with nowhere visible to update.  I then  sought to download lightroom cc and this is when I could not access the 'develop' section due to reduced
    functionality  It was apparent that my photos had been put in cc but no way to access them unless I wanted to subscribe. 
    I have since remedied the problem as  my original lightroom 5.7 icon is still available on the desktop and have gone back to that.  I do feel that this is a bit
    of a rip off and an unnecessary waste of my time though.
    Thank you for your prompt reply by the way.
    Carlo
    Message Received: May 04 2015, 04:52 PM
    From: "dj_paige" <[email protected]>
    To: "Carlo Bragagnolo" <[email protected]>
    Cc:
    Subject:  I have just sought  to update my lightroom and am now unable to access the develop function and get a note stating that I have
    reduced functionality what it this about and how do I get my product back
    dj_paige  created the discussion
    "I have just sought  to update my lightroom and am now unable to access the develop function and get a note stating that I have reduced functionality what it
    this about and how do I get my product back"
    To view the discussion, visit: https://forums.adobe.com/message/7510559#7510559
    >

  • HT5055 Just updated to lion and my cctv access has stopped functioning all I get is a white screen in the middle of the control panel where the camera shots should be.  I think it is caused by JAVA but am confused as when i view on snow leopard it works 

    Just updated to lion and my cctv access has stopped functioning all I get is a white screen in the middle of the control panel where the camera shots should be.  I think it is caused by JAVA but am confused as when i view on snow leopard it works  can you help

    Open "Java Preferences" either from spotlight or your utilities folder...it's probably going to say you need to install a java runtime. Then just click install!

  • I am moving to Alice Springs, Australia, this summer from the U.S. I would like to get the new iPad. How can I found out if I will be able to access all the functionality in Alice? Will I need to purchase a local plan of some sort?

    I am moving to Alice Springs, Australia, this summer from the U.S. I would like to get the new iPad to use while traveling back and forth from the U.S. to Australia, and within Australia. How can I found out if I will be able to access all the functionality of the iPad in Alice? Will I need to purchase a local plan of some sort? I have never owned an Apple product before -- I'm a newby!

    Aside form the limitation of LTE to the 700MHz and 2.1GHz bands (which rules out LTE in Europe I gather, at least as it stands now) the new iPad should let you use a GSM 3g/2g/edge network anywhere.  The CDMA Verizon model will only be able to use it's native CDMA radio band in the USA (that radio will be locked to Verizon), but it's international GSM radio is the same as the AT&T model.
    Keep in mind though that by far the cheapest option when abroad is to take advantage of free wifi as much as possible (well, that is always the cheapest option, since it is free).  I know several people who have taken their wifi-only iPads and iPad2s to Europe and said they did not find the lack of 3G really inconvenient at all as most towns had plenty of free or cheap wifi access all over the place.
    And in 3 years, your iPad will be at least 2-3 generations behind, LTE will have already been replaced by 5G or whatever the next new generation of cellular ends up being named (and the "young" kids will be wondering what the heck 3G even means or meant - dang that stuff was from the olden days!), and you can pitch that ancient piece of technology and start things all over again 

  • I used to able to access and listen to my itunes library from my ipad using the remote app but this no longer works.  I am connected but sound thru ipad.  Is this because of they want us to use itunes match

    I used to able to access and listen to my itunes library on my ipad  using the remote app but this no longer works.  I am connected but sound thru ipad- just controls my library on iMac.  Is this because of they want us to use itunes match

    That has nothing to do with iTunes match. The Remote app on iPad can control the computer's iTunes but not play content from iTunes on your iPad.
    To play for example iTunes imusic on iPad
    You need to have Home Sharing On.
    Check Settings > Music > Home Sharing (key in your Apple ID & password here, must be the same on computer's iTunes)
    Start iPad's Music app, tap the ... More (bottom right), tap Shared.
    Choose your iTunes' library and have fun.

  • [Bash] How to `declare` a global variable inside a function?

    #!/bin/bash
    # Not using declare -A, array will be treated as indexed array rather than an associative array
    seta()
    for ((n=0;n<$1;n++)); do
    printf -v a_$n[k] %s k$n
    printf -v a_$n[j] %s j$n
    eval echo inside seta: a_$n[k] = \$\{a_$n\[k\]\}
    done
    seta 3
    echo outside: a_0[k] = ${a_0[k]}
    echo outside: a_0[j] = ${a_0[j]}
    echo
    # Use declare -A inside function, array will be undefined outside
    setb()
    for ((n=0;n<$1;n++)); do
    declare -A b_$n # Note here
    printf -v b_$n[k] %s k$n
    printf -v b_$n[j] %s j$n
    eval echo inside setb: b_$n[k] = \$\{b_$n\[k\]\}
    done
    setb 3
    echo outside: b_0[k] = ${b_0[k]}
    echo outside: b_0[j] = ${b_0[j]}
    echo
    # The bad solution, only works if we know beforehand how many c_? arrays will be assigned inside setc()
    for ((n=0;n<3;n++)); do
    declare -A c_$n
    done
    setc()
    for ((n=0;n<$1;n++)); do
    printf -v c_$n[k] %s k$n
    printf -v c_$n[j] %s j$n
    eval echo inside setc: c_$n[k] = \$\{c_$n\[k\]\}
    done
    setc 3
    echo outside: c_0[k] = ${c_0[k]}
    echo outside: c_0[j] = ${c_0[j]}
    My original code does the declare -A as in setb(). I was surprised when I saw all blank output... Now the problem is illustrated clearly by the setb() example.
    The setc() example works, but a bit ugly: look at the two 3's...
    My ideal solution would be, something like `declare_global -A b_$n` in setb()
    Any ideas?

    with current bash versions, i don't think it is possible to declare global associative arrays in functions.
    what you are after is the "-g" option of typeset which is available in zsh.
    i think i read somewhere that something similar may be planned for bash 4.2.

  • How to access Call Back Functions using *.dll in the Labview?

    Hai,
    I am Pavan Ram Kumar Somu.
    I am new to Labview, currently I am working on MVB Interface.
    I need to access the API functions from *.dll file in Labview, as of now , I am doing this with Call function Library node in Labview but it does not support the following data types like
        1. Pointer Arguments(To which memory it points in Labview)
        2. function pointers Arguments
        3 .pointers in structures and pointer structures in structures and many other data types.
    Please Answer the below queries also:
    1. How to pass pointer arguments to API functions in DLL and how to collect pointer  
        return types from API functions in DLL
    2. How to pass structure arguments to API functions in DLL and how to collect structure
        return types from API functions in DLL
    3. How to use callback functions(nothing but function pointers) in Labview and how to
        collect callback fuctions return types from API functions in DLL
    I need your help while passing these datatypes to API functions in DLL from labview.
    Suggest me if there is any other alternative for implementing this task.
    I am referencing some examples here:
    Examples:
    I)
    Unsigned short int gf_open_device(void *p_device_config, unsigned long int client_life_sign_timeout, unsigned short int *device_error)
    void *p_device_config: How to access/pass these arguments in LabView and to which memory location it points in LabView.
    II) #include <windows.h>
         #include <process.h>
         HANDLE rcvEvent0, rcvEvent1;
    /* Function call*/
    CanGetReceiveEvent(handle[0], &rcvEvent0);
    Above is a piece of C code, Now I want to use HANDLE datatype which is windows based, how to use these type in the LABVIEW.
    With regards
    Pavan Ramu Samu

    "Somu" <[email protected]> wrote in message news:[email protected]...
    Hai,
    I am Pavan Ram Kumar Somu.
    &nbsp;
    I am new to Labview, currently I am working on MVB Interface.
    &nbsp;
    I need to access the API functions from *.dll file in Labview, as of now , I am doing this with Call function Library node in Labview but it does not support the following data types like
    &nbsp;&nbsp;&nbsp; 1. Pointer Arguments(To which memory it points in Labview)
    &nbsp;&nbsp;&nbsp; 2. function pointers Arguments
    &nbsp;&nbsp;&nbsp; 3 .pointers in structures and pointer structures in structures and many other data types.
    &nbsp;
    Please Answer the below queries also:
    &nbsp;
    1. How to pass pointer arguments to API functions in DLL and how to collect pointer&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; return types from API functions in DLL
    &nbsp;
    2. How to pass structure arguments to API functions in DLL and how to collect structure
    &nbsp;&nbsp;&nbsp; return types from API functions in DLL
    &nbsp;
    3. How to use callback functions(nothing but function pointers) in Labview and how to
    &nbsp;&nbsp;&nbsp; collect callback fuctions return types from API functions in DLL
    &nbsp;
    I need your help while passing these datatypes to API functions in DLL from labview.
    &nbsp;
    Suggest me if there is any other alternative for implementing this task.
    &nbsp;
    &nbsp;
    I am referencing some examples here:
    Examples:
    I)
    Unsigned short int gf_open_device(void *p_device_config, unsigned long int client_life_sign_timeout, unsigned short int *device_error)
    &nbsp;
    void *p_device_config: How to access/pass these arguments in LabView and to which memory location it points in LabView.
    &nbsp;
    II) #include &lt;windows.h&gt;
    &nbsp;&nbsp;&nbsp;&nbsp; #include &lt;process.h&gt;
    &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp; HANDLE rcvEvent0, rcvEvent1;
    &nbsp;
    /* Function call*/
    CanGetReceiveEvent(handle[0], &amp;rcvEvent0);
    &nbsp;
    Above is a piece of C code, Now I want to use HANDLE datatype which is windows based, how to use these type in the LABVIEW.
    &nbsp;
    With regardsPavan Ramu Samu
    Search the forum (forums.ni.com) for callback, pointer or handle, and you'll find that it is all possible, but not very easy.
    e.g.: http://forums.ni.com/ni/board/message?board.id=170&message.id=88974&requireLogin=False
    Regards,
    Wiebe.

  • Error Accessing an Oracle Function

    Hi There,
    I am trying to access an oracle function and getting an
    error.
    CREATE OR REPLACE FUNCTION simple RETURN VARCHAR2 IS
    BEGIN
    RETURN 'Simple Function';
    END simple;
    <cfstoredproc procedure="simple" datasource="MySource"
    returnCode ="no">
    <CFPROCRESULT name="simple_function">
    </cfstoredproc>
    Error:
    Error Executing Database Query. [Macromedia][SequeLink JDBC
    Driver][ODBC Socket][Oracle][ODBC]Syntax error or access violation.
    I do have access to this function. I tried it from SQL Plus
    and it works fine.
    any help in this will be highly appreciated.
    Regards,

    As per Adam Cameron advice, I changed my SQL function:
    CREATE OR REPLACE FUNCTION simple RETURN VARCHAR2 IS
    a varchar2(10) := '';
    BEGIN
    select 'Simple' into a from dual;
    Return a;
    END simple;
    As per paross1 advice, I changed my code to:
    <cfstoredproc procedure="simple" datasource="MySource"
    returnCode ="yes">
    <CFPROCRESULT name="simple_function">
    </cfstoredproc>
    I am still getting the following error:
    Error Executing Database Query. [Macromedia][SequeLink JDBC
    Driver][ODBC Socket][Oracle][ODBC]Syntax error or access violation.
    The error occurred on line 53.
    Any advice will be highly appreciated.

  • Read access to procedures,function,packages and triggers

    Hi,
    I created a user with CREATE SESSION,SELECT ANY TABLE privilege. My objective is to create a user with read only access to other schemas. But the newly created user is not able to read procedures,function,packages and triggers. The new user need read access to procedures,function,packages and triggers. What is the priviege required for this access? Please help me to resolve this issue.
    Regards,
    Mat.

    Hi,
    Grant select all will give select privileges to all schema level objects except procedures,function,packages and triggers. But I need to grant read privileges on these objects to newly created user.
    Regards,
    Mat.

  • Access another class function

    Hey,
    I am trying to access another class function. I have 2 Classes and my main menu features are in my Main Class and I want to call that function from my Level Class
    What is a good idea to approach this, some how I need to import it in a way but I don't know how I could do that.
    Thanks,
    McbainGames11

    Fixed it myself
    Answer:
                        public static var instance:Main;
                        public function Main()
                                  instance = this;
    And I called a function from Main Class in my Level Class using:
    Main.instance.function();

  • Access Report Custom Functions from code

    Post Author: leedo
    CA Forum: .NET
    Hello,
    I am using VS2005 (VB) and was able to change formula text from within code using the "FormulaFieldDefinitions" object. However, I am having problems finding out how I can do the same to Report Custom Functions.  The reason I am doing all this is that I noticed during my Windows app is running the source of my .rpt file is thrown in the user "Local Settings\Temp" folder and all code is revealed by simply opening that file. Please help. ThanksLeedo

    Post Author: MJ@BOBJ
    CA Forum: .NET
    It looks like it is not possible to access the custom functions within a report using the CR .NET SDK.  However, to address the potential security issue that you may be concerned about, is this a Windows or ASP.NET application?  If this is an ASP.NET application, then you shouldn't have to worry about the security as the end-user (client) will not be able to access that folder since the rest of the web server is typically unaccessible by the client. 
    Another way to secure your reports is to use what we call "managed reporting" solutions such as Crystal Report Server or Business Objects Enterprise, which manages reports securely and your users are only allowed to access/see what you allow them to.  These solutions also provide public SDKs so you could incorporate the system into your own applications.  For more information, go to www.businessobjects.com/products.

  • Custom event never reaching Listening function

    Hi all, I have been having a problem usign a custom event... I attached it to the the main class using "addEventListener" and fire it off with "dispatchEvent" in another class. I checked that it was attached to the main class using "hasEventListener" and it returned true, also "dispatchEvent" returns true... but it ever reaches the function that I attaced it to... is there any thing I am missing?
    Thanks a lot

    i assume by main class you mean document class.
    1.  is the listener function in your document class?
    2.  is the even listener added before the event is dispatched?
    if no to either (or both), you need to fix that.
    if yes and yes, you don't have a correct reference to your document class.

  • LoadVars and listener functions

    Hi all...I posted yesterday with some trouble getting
    loadvariables to work. I have since changes the code to use the
    LoadVars class instead but I am still have the same issue as
    before. The request for variables from the server does not complete
    and the values do not get set before the variables need to be used.
    I have a simple flash movie with 1 input text box (name_txt),
    1 button (Submit) and 1 dynamic text box (lblOutput).
    I have a simple script on the button:
    on (release) {
    //loadVariables("dev.aspx?foo=" + name_txt.text, "POST");
    newVars = new LoadVars();
    newVars.load("dev.aspx?foo="+_level0.name_txt.text);
    //This line just visually shows me that the script makes it
    this far
    _level0.lblOutput.text += "This is hard coded
    text.<br>";
    _level0.lblOutput.text += newVars.retVal;
    I have a very simple asp page that returns the value:
    'Format the response
    Response.ContentType = "application/x-www-form-urlencoded"
    'Create a string and
    Dim foo As String = "&retVal=" &
    Request.QueryString("foo") & " - This is from the ASP
    Page.<br>"
    Trace.Warn(foo.ToString)
    Response.Write(foo.ToString)
    Response.End()
    When I load the Flash movie and type the word "test" into the
    input field and click submit...I can see that Flash sends the
    variable to the asp page by checking the asp trace information. The
    value comes into asp just fine but, as I understand it, I need some
    sort of listener function to force Flash to wait for the
    transaction to complete before trying to load the use the variable
    values.
    Could someone please explain how I can add this listener
    functionality to the script above? Many thanks!!

    You need a stop() on the frame doing the load and onLoad.
    Then in the onLoad
    you move to the next frame. Other approaches include hiding
    the UI and in
    the onLoad, revealing the UI such as a MovieClip cover is
    made invisible.
    Declare the results LoadVars object on the timeline outside
    of a function
    and it is accessible for the entire movie at all levels.
    Lon Hosford
    www.lonhosford.com
    May many happy bits flow your way!
    "nagromme" <[email protected]> wrote in
    message
    news:e4fpvm$qmq$[email protected]..
    I'm using LoadVars in Frame 1, and I need to use the
    resulting variables in
    other scripts afterwards. (But all the examples I find online
    only use the
    variables right in the same script.)
    The problem I'm having is, the onLoad function doesn't
    actually make it
    wait.
    It goes ahead to the next frame whether fully loaded or not.
    It depends on
    the
    connection at the moment--if the vars haven't fully loaded,
    hilarity ensues.
    <b>My script in Frame 1:</b>
    _root.myloadvars = new LoadVars();
    _root.myloadvars.load("datapairs.txt");
    _root.myloadvars.onLoad = function(success) {
    if (success) {
    //trace("TXT RETRIEVED");
    gotoAndPlay(2);
    } else {
    trace("TXT NOT RETRIEVED");
    gotoAndPlay(1);
    <b>It's SUPPOSED to hold in Frame 1 until ready to
    proceed and make use of
    the
    variables in Farme 2.
    Things I have tried:</b>
    * Moving the above to Frame 2, so the "not retrieved" loop
    actually has two
    frames to cycle (back to 1, then forward to 2 where the
    script it).
    * Adding an additional gotoAndPlay(1) BELOW the above.
    But regardless, it never goes back to Frame 1, it always
    goes forward. It
    reports success, but half the time the variables (or some of
    them) are still
    Undefined.
    What's the RIGHT way to wait in a frame for LoadVars, and
    then let other
    scripts use the variables afterwards?
    <b>Many thanks for any advice!</b>
    (PS, this is Flash MX--I'm waiting for Universal Binary
    before I upgrade.)

  • How can I find out "Global Access Protocol Pass phrase" for OAM server ?

    I'm configuraing Access gate using configureAccessGate command to integrate OIF with OAM.
    The OAM is working in "simple" transport mode. since it was not me installed OAM, I do not know what "Global Access Protocol Pass phrase" is.
    I need this to answer question to configure access gate. How can I find out the "Global Access Protocol Pass phrase" set for OAM server?
    Thanks

    Hi ITBobbyP,
    SSIS has a built in FTP task, while this only works for the FTP protocol, it doesn’t support SFTP. But there are some free clients like WinSCP and
    SSIS SFTP Task Control Flow Component
    available in the CodePlex which can invoked from SSIS.
    References:
    SSIS SFTP Task Control Flow Component approach
    WinSCP approach
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Will adding global access change my domestic plan?

    Will adding global access to my phone now change my domestic calling plan and if so should I wait until I'm out of the country to change it?

        twodogsfourfish
    I completely understand how important it is to be clear about any changes to your plan and coverage before completing changes! I can definitely go over the details with you. With being on the Nationwide plan currently, what global access were you looking to add to your plan? If the $25/100MB data plan for global data access, this will only add the $25 charge itself. If the $4.99 Voice Value plan to lower per minute rates outside the country, again it will only add the $4.99 charge itself and will not change your domestic plan. Were you looking to move to a More Everything Canada/Mexico plan instead? This would change your calling plan depending on when it was made effective.
    As with any international trip, I definitely recommend reviewing our trip planner to make sure you're clear on all rates and dialing instructions before you go! The $25 and $4.99 features are not compatible in all countries. http://vz.to/1fb1kE8
    RuthW_VZW
    Follow us on twitter @VZWSupport

Maybe you are looking for

  • BT Broadband thinks it's connected when, to all in...

    Apologies for resurrecting an old topic, and one that is similiar to, but not the same as the next thread. BT Broadband is saying it’s connected, when it seemingly isn’t, so no webpages download. We have been experiencing this problem since our excha

  • CONFLICT BETWEEN FIREWIRE 400 & 800 BUSSES***

    Happy New Year all... My 1.67 Ghz Powerbook's external Firewire 800 drive will not mount if I have a device plugged into it's Firewire 400 port (in this case it's an EyeTV 500 box). Is the use of these ports supposed to be an "either-or" situation, w

  • PR/PO Quantity Aggregation

    Hello! Our MRP Run proposes Purchase Requisitions for materials, for most of the materials we have several PR's being generated. Now, when we convert these PR's into PO's, our purchase order has several line items for the same item with different qua

  • Mutable objects

    I am sorry if this isn't a right place for this question. I do not seam to find any information on how to make an object mutable. If anyone can point me in the right direction I appreciate it. Vitaly.

  • Source used and source type problems????

    please help.. i know i am being very thick here - i have a page with two text fields (say :P8_item1 and :P8_item2) which are not database columns, but which are populated by LOVs (displays descr, returns key value) from database columns. the first fi