Variables that persist throughout the application

As usual I show my naivety Flex with my questions.  So what's another...

Is it possible to have variables that I put in a pop-up window (think connection), persist and be accessible even when popup is closed?

For example, I have an application that uses a pop-up login window to control access to the application. The user provides the user name, password, and role. When the user is authenticated, the pop-up closes and a viewstack is displayed after the results of the role selected in the pop-up window.

Everything works very well. Now, I want to display the user ID in the viewstack are the components. For example, I want to display a welcome message based on the user ID.  In ColdFusion, I would just use a session variable.  However, in my view, there is a way to call any variable in the application as long as the film is still running.

I can't find a way to do it. Any help would be appreciated.

You can set a variable in the application.

The code on the shortcut menu:

private var app:Object = mx.core.Application.application;

app.myVar = myPopUpVarValue;

Or you can send a custom event that contains the data as a property that you define in the custom event. This is the best way to do (app coupled lloosely) but in this case you must add the event listener to systemManager, not to the application, as popups are from a list of different display under systemManager.

Here is my Flex cookbook post on custom events:

http://www.Adobe.com/cfusion/CommunityEngine/index.cfm?event=ShowDetails&ProductID=2&postI d = 11246

It's more work, so you can go with option 1 above (mx.core.Application.application), but long term you want to use custom events.

If this post has answered your question or helped, please mark it as such.

Tags: Flex

Similar Questions

  • Re - open a connection throughout the application

    Reopenning/re-revalidation a connection during a request: I am aware of the implementation of transit, recycling, test-on-borrow queries etc.. However, I realize also that in a scope of the single application, a data source connection is opened only once and has not been tested throughout the application.

    The case I have is a report of sources based on two data, issuing a query on datasource1, then datasource2, and then back on datasource1. Datasource2 query takes a long time, whereby the datasource2 connection becomes invalid.

    The question is: is there a way to force the CF to re-open/re-borrow/re-validate connections even throughout the scope of the request?

    Shlomi Noach says:

    (I should add that I have indeed configured all the settings above and more)

    Indeed, it is apparent that you're an old hand at this.

    There is a problem with CF held a connection for a long time, then * assuming that * it's always very well without checking it again.

    You then deselect "maintain the connection.

    All these settings apply * cross-request *. The problem is not there. The problem is that in a single query, two calls to query on the same data source will use same connection * controls * and it's a somewhat naïve approach side CF.

    You can force Coldfusion to open a new connection for each request. For example, to add the attributes username and password to the cfquery tag will ensure that Coldfusion opens a new connection for each request of cfquery.

  • After downloading, I get a message that cannot open the application because it may be damaged or incomplete

    After downloading, I get a message that cannot open the application because it may be damaged or incomplete

    Please remove Adobe Application Manager to help cleaning tool and install Adobe Application Manager using this link: Windows | Macintosh

  • Open a PDF file that comes with the application

    I need to be able to include a handful of pdf with my application that can open the app, or Adobe call. Where should I store these PDF files in my project to be able to access it through adobe? I have to copy the files to the directory shared first? I don't want to do, but if I do, where to keep these PDF files at the start in my project structure to be able to find them in my code?

    You should be able to include them in the public / directory instead of native /, which will make them visible outside your application.

    To do this, when you specify a entry, you can include the public attribute = 'true' and need that to happen.

  • APEX5: How to use User(Logged In) Image throughout the application

    Hello

    We have images (BLOB) user stored in the custom table, now, when the user opens a session, we wanted to use his image on several pages in application as in reports, forms.

    Question is how we can use a single image across the application, without reloading or Access database again.

    I thought I ODP and hiding the image in the ODP. Then store the URL in the overall page element to access the image in any of the application but it seems that ODP is drawn for each page and giving the database image. Best way to do this?

    Any thoughts?

    Thank you

    Ankit

    Ankit-K-Oracle wrote:

    We have images (BLOB) user stored in the custom table, now, when the user opens a session, we wanted to use his image on several pages in application as in reports, forms.

    Question is how we can use a single image across the application, without reloading or Access database again.

    I thought I ODP and hiding the image in the ODP. Then store the URL in the overall page element to access the image in any of the application but it seems that ODP is drawn for each page and giving the database image.

    The ODP does not cache the image Explorer.

    • Have you implemented the ODP using a Cache-Control header, as described?
    • Did you check the cache settings in the browser?
    • Have you used a web inspector to determine if the browser is in charge of the image from cache or asking for each page view?
  • Define the time LOGO throughout the application

    Hello

    I have to use the same Logo (image file) I have all the pages across the entire application.

    I downloaded the image (say - logo1.jpg) on the shared component, and which is applicable to this application within that workspace. (basically, it's an IMAGE of the APPLICATION)

    Now, I want to call this the application definition logo

    Application definition Edit-> Type of Logo (Image)-> Logo [I need to know what is the syntex here to call the logo]
    Then, suppose I want to have a PICTURE of space, is the process will be the same.

    Also - I can use a link on the Logo... something like... in the definition...

    href = http://.../pls/apex/f?p= & APP_ID.page_no logo1.jpg

    Thank you
    Deepak

    Published by: Deepak_J on August 14, 2009 15:44

    For an image associated with an application file:

    #APP_IMAGES#myImageFile.jpg
    

    For an image file from the workspace to the scale:

    #WORKSPACE_IMAGES#myImageFile.jpg
    

    Really impossible to add a link on the image on the screen of Application definition - if you want to, you need to change your page templates and edit HTML around the placeholder #LOGO #.

    Published by: Tanjental on August 14, 2009 13:05

  • Creation of settings of variables / a module of code that persist when the sequence is complete

    I create parameters/variables programmatically in a module of code (c#) by passing the object to people of the country and calls the "NewSubProperty".

    I also tried SetValNumber with PropOption_InsertIfMissing.

    But it seems that they are only created in this instance of the sequence, because they left when the sequence is over. I really wanted to persist.

    I wanted to avoid creating the globals station dynamically like that, but maybe that's all I can do to make them last.

    Any ideas would be appreciated gratefully.

    Thank you

    Ronnie

    Hello

    Check out the links on this answer

    http://forums.NI.com/NI/board/message?board.ID=330&message.ID=11226&query.ID=267719#M11226

    It may be useful

    Concerning

    Ray Farmer

  • Person contact as after that fill us the application form.

    Hello.

    We fill form to Adobe Primetime but not a single contact us after 2 or 3 weeks.

    We try to call the Russian Office, but the phone does not work.

    How can we get access to Adobe Access DRM?

    Best regards

    Roman.

    Hello Roman,

    Sorry about that.

    You can send me your details (email, Tel No, company information, etc.) for me ( [email protected] ) directly?

    I will forward information to the businessman.

    Thank you

    Hiroshi

  • When I quit firefox gmail signature (or facebook, etc), I'm connected automatically the next time that I run the application - no stored passwords and I tried already clear all cookies.

    I want to continue to use Firefox, but it's a pretty big security problem if my laptop is stolen.

    See https://support.mozilla.com/en-US/questions/876494
    with the solution

  • Even if I have cookies recording enable when I restart the application in that I have to enter all of the newspapers in detail yet. How do use cookies stored?

    Have the ability to save cookies and all the other stuff already activated, I connect to several sites (e.g. gmail).

    When for some reason I restart the application, the site prompts me to fill again in my log in details. The strange thing is that on my desktop PC, it seems to have exactly the same parameters however save in this case, or by using saved cookies actually works.

    Which is maybe a problem of Ubuntu? I do not know. But some profile settings are reset any time that I opened the application.

    Any ideas?

    Thank you

    Try to clear your Cookies for the sites concerned.

    Tools > Options-> life privacy - Cookies = the button show Cookies

    Enter the domain name in the top search bar and all Cookies for this URL will be displayed. Unless you can figure out which is Cookie to "remember me", you will need to delete them all.

    Hold the {Ctrl} key while you click each Cookie in the small window. When this list is all highlighted, click the Cookie delete button at the bottom left.

    When you are finished click Close.

    If this problem persists, you may need to delete the __cookies.sqlite__ file in your profile folder.

    http://support.Mozilla.com/en-us/KB/profiles#How_to_find_your_profile

    You might need to view your "hidden files and folders" through Options of folders in the control panel

  • How to listen for events that hit the application?

    How to register an event listener in a subcomponent to listen to events that spread at the Application level?

    For example: Comp1 raises an event that is spreading to the hand. How to register Comp2 listening to this event?
    Main.MXML (Application)
    -Mgr1
    -Ordi1
    -Mgr2
    -Comp2

    The code that would be placed in the component and the hand would be greatly appreciated.
    Thank you.

    Try this:

    . AddEventListener (Application.application as Application)...

    from the inside of any component.

    Tim

  • Not able to initialize the application security... Tried to rename cert8.db and secmod.db. Profile has access r/w. Always get the message. Can be run as an administrator

    Could not initialize the safety component of the application. The most likely cause is problems with the files in the directory of the profile of your application. Please check that this directory has no restriction of read/write and your hard disk is not full or close to full. It is recommended that you exit the application and correct the problem. If you continue to use this session, you may see incorrect application behavior when you access security features.

    Above the messa4bite error occurs whenever I have stars Firefox without admin priv. Checked the directory of the profile listed to solve problems of information - is r/w for system, admin and homes tried to rename cert8 and secmod as suggested following a forum. Problem persists. \
    My computer is running Win 7 Home Premium 64-bit

    New profile worked! Thank you.

  • How to upgrade the application through Blackberry Desktop

    Hello.

    Situation of Stange. Could you please give me a hint, how do I overcome that?

    1. I've compiled and signed the application. Alx file created. Two files are created "bb_application.cod" and "bb_application.alx".
    2. I run Blackberry Desktop, ran the Application Loader and specified my project as the location of the files folder and installed the application.
    3. I decided to change something in my application. I changed the code java, recompiled and signed the application. And also alx-file created.
    4. I run Blackberry Desktop, ran the Application Loader and saw that my request is already shown in the window of the Application Loader that checked. When I clicked on the button "Add" and specified the location of the updated alx file I get the following error: "no additional applications designed for your device were found".

    How can question - I change application already installed without uninstalling? If I uninstall this application - all the information stored in the store persistent will be lost.

    Here is my point of view on what is happening here.

    You have added an alx for the application loader, so that he knows that cods you attempt to load on the device.  If you add an another alx with the same cod, he rejects this, by you saying "no additional demand.  In this case, it should probably say "cod application already added.

    Now the application loader is sometimes his own worst enemy, but he tries to be smart and it will remember, for every alx you added, the level of the alx.  So if you change that alx to a level later, the application loader will tell you, that you need to update.  If change you to a previous level (i.e. lower) it will tell you are without downgrading and then ignore the downgrade (which can be a bit annoying...).  Doing so, in my experience, it takes without notice of the date of compilation of the cod file - this only on the level in the alx details.

    So in your case, you simply update the alx that points to the application loader whenever you put cod involved level (and sign)...

  • The attention! "Could not initialize the component of the application security...". »

    I started receiving this alert after restart last Saturday (22/02/2014) and freezes before Thunderbird it is fully operational: (incorrect application behavior?)

    Could not initialize the safety component of the application. The most likely cause is problems with the files in the directory of the profile of your application. Please check that this directory has no restriction of read/write and your hard disk is not full or close to full. It is recommended that you exit the application and correct the problem. If you continue to use this session, you may see incorrect application behavior when you access security features.

    I have over 500 GB free on the hard drive and have checked the TTBOMA directory. As recently as this
    morning I still once uninstalled using TB TB uninstall utility, rebooted and reinstalled from the Mozilla Web site. Nada,.

    Toshiba Satellite L875D
    Windows 8

    Troubleshooting Info:

    Thunderbird
    Version 24.3.0
    User Agent Mozilla/5.0 (Windows NT 6.2; WOW64; RV:24.0) Gecko/20100101 Thunderbird/24.3.0

    Any help out there?

    Delete the file cert8.db in Thunderbird profiles folder.

    This will remove all the intermediate certificates Thunderbird has stored.

  • Firefox suddenly stop working and I get the following error message: could not initialize the safety component of the application. Most

    Error message: has not been initialized component of application security. The most likely cause is problems with the files in the directory of the profile of your application. Please check that this directory has no read/write
    restrictions and your hard disk is not full or close to full. It is recommended that you exit the application and correct the problem. If you continue to use this session, you may see an incorrect application
    behavior when you access security features.

    See:

Maybe you are looking for

  • E-mail

    After the ransacking of email on my iPad and you try to remove the trash it shows in my e-mail again. How can I stop this?

  • Question about memory upgrade and warranty - Qosmio G20

    I'm looking to upgrade the RAM in my Qosmio G20, but if I buy little ram in a store and fix myself (replacing the old RAM) void my warranty? (it is still covered by the extended warranty now)

  • Random number generator. Even and odd numbers

    I have a problem. I have a generator of random numbers, it goes from 0 to 20, I need to have two indicators, we show you how many numbers are pairs, and how much isn't. I tried to table D use the decimated 1, but as these numbers are random, it doesn

  • Whenever I leave Bitlocker services, less than two minutes the service state will be to stop early.

    Hello Are facing a problem with Bit locker whenever I'm bit locker services.msc. within two minutes the service status gets changed to prevent to boot. could not even start the drive encryption. Please help Concerning

  • Revert to the original uncropped?

    I have a cropped image with 'Delete the cropped Pixels' to the and saved as PSD Photoshop CC 2015 and closed. How to revert to the original uncut when I open the locked image? The path alone and awkward, I found is to manually reset the area cropped