Get and set data using the ActionScript class

Hello

I use the ActionScript class to store the user name and password when the user logs


com package
{
public class Login
{
public function Greeter (initialName:String = "")
{
}

public var uname:String;
password public var: String;

}
}

Inside the Componet Login form, I am creating the object of this class of connection and affecting the data as shown in it

var logincomp:Login = new login());

logincomp.uname = UnameTI.text;
logincomp. Password = PassTI.text;


I need these data within an another CustomComponent, is it possiblke to access these data within an another componnet.

Can I do this?


var logincomp:Login = new login());

var str:String = new String();

Str = logincomp.uname;


Please me tips


I know it's possible with recording and Dispatching Evenets
However, I'm not interested to use DEMONSTRATIONS. I'm using FLEX 3

Please advise me if this is possible.

THnaks in advance.

Thanks for helping me learn Flex quickly.

Hello

You use a Singleton class as (class ModelLocator) If Yes, then you can put a single instance of your connection class in this class so that you can access this instance in the world in any component (infact with the app).

Declare an instance of the connection object in the Singleton class like below

var logincomp:Login = new login());

Set the values in a single component, and you can access the values in the other component.

The sample class Singleton as shown below...

package com.model
{

[Bindable]
public class ModelLocator
{
private static var instance: ModelLocator;
 
public var logincomp:Login = new login());
 
public void ModelLocator()
{
If (instance! = null)
{
throw (new Error ("cannot only one instance of ModelLocator"));
}
}
Public Shared function getInstance (): ModelLocator
{
if(instance == null)
{
instance = new ModelLocator();
}
return instance;
}
}
}

If this post answers your question or assistance, please mark it as such.

Thank you

Jean Claude Chari

Tags: Flex

Similar Questions

  • get and set methods: use or not

    Hello

    I am student upward throughout the atcionscript and happened to get and set methods.

    I can't see how they are used, but you can also make custom methods get and set as follows:

    public void getName)

    {

    return name;

    }

    setName (newName) of the public service

    {

    name = newName;

    }

    So my question is which is the best method to use - is there a difference at all.

    ALSO - they seemed very redundant for me at the time that they simply receive a variable, you can get much faster by going directly to a variable.

    Do they have any real use?

    In addition, some schools of coding very strictly apply accessors. This does not mean that this app is really convenient, but it has little reasonable basis.

    Theoretically, it is very safe to just anyone allow direct access to the property. Once again, in theory, we can do much harm to a bare ownership. Of course, most of us do not write shields of industrial strength that an application requires, but in environments where the code is released - it is important to protect the integrity of the code, its encapsulation and impose an extra layer of armor.

    Note that not a single property in full classes AS3 has direct access - all properties are getters/setters or one of them.

    This brings me to another advantage.

    Say, you want the variable value to be read, but not set. If you do the public variable - outside the object can BOTH set and get its value and there NO WAY to stop the value parameter. But, if you provide ONLY getter - nothing can set the value. It becomes read-ONLY.

  • acquire, analyze, and log data using the technique of the statemachine

    I'm technical state machine learning to develop code to acquisitoin of data and logging. I think I wrote the correct code for this purpose, but I couldn't have done the following:

    All the values(>0) of warning should appear on table 1 d on the façade. The code is written only the first value.

    All values must be recorded using to write to the palette of the spreadsheet and written on the excel sheet. Code is only writing first value.

    I wonder what is the error. The code I created is attached, I would be grateful if someone fix the code and post in response.

    Thank you in advance for help

    See you soon

    Hi kwaris,

    "What is the error": well, you use a lot of unnecessary conversions. Really a lot of...

    Why do you convert a dynamic scalar value, then convert to table, then index an element of the array? Why convert to dynamic when everything you needis a simple "build table" node?

    OK, I've included a shift register where you will store your table. It of just a simple 'how to', but not the best solution for all cases. But it should give you a clue...

  • How to manage the getter and setter in flex?

    I want to create getter and setter for a shared variable ways. How to create aid may be related?

    and how to call the accessor get and Set of a class of model?

    for ex:

    (1) in the IDMLEditor.mxml file

    [Bindable] public var currentDoc:IdmlDocument = null;

    private var _currentDoc:String;

    [Bindable]

    public function get currentDoc (): {IdmlDocument}

    return currentDoc;

    }

    public function set currentDoc (idmlDoc:IdmlDocument) {}

    this.currentDoc = idmlDoc;

    }

    (2) how to get from EditorModel.as?

    public class {EditorModel}

    [Bindable] public var currentDoc:IdmlDocument = null;

    You don't need to use underscore (_) to access the variable in the getter, setter class. You can immediately access the variable by using the name of the method

    myClass.currentDoc

    That's all

  • Acer asl3600 will not start only get option is F12 and no data on the recovery drive.

    Hi guys have Acer asl3600 will not start only option get is F12 and no data on the recovery as disc was in vista family 32-bit premium version devastated as being disabled and need for my community work & charity, thought best option would be a recovery disk.

    Concerning

    Dennis

    Hello

    Manufacturers recovery disks normally do not have Service Options; they are normally a relocation to the factory only settings option.

    Acer definiterly only reinstall to factory settings, new condition.

    Here is the guide to repair Options using a Vista DVD from Microsoft.

    If a friend or a work acquantance of yours has one, you can borrow and use it for repairs.

    http://www.bleepingcomputer.com/tutorials/repair-Windows-with-Windows-Startup-Repair/

    Table of contents

    1. Overview of Windows Vista repair options
    2. How to perform an automatic repair of Windows Vista using Startup Repair
    3. Advanced Tools Overview
    4. Conclusion

    If you do not or can not borrow a Microsoft DVD there is a download of a file ISO of Vista Startup Repair available that you can put on a Bootable floppy to make the above startup repair and that the method is recommended by a large number of posters in these Forums.

    Unfortunately, you have to buy it.

    Here is a link to it:

    http://NeoSmart.net/blog/2011/Windows-Recovery-discs-updated-reinstated/

    See you soon.

  • Get and set the value to allow selected rolling Shuffle and facing page

    Hello world

    I work with the page and spread,

    For now, I want to value page spead shuffle and type of document.

    but I just find the function to get and set the value for the Document Pages allow Shuffle using the

    InterfacePtr < IPageLayoutPrefs > iPageLayoutPrefs (static_cast < IPageLayoutPrefs * > (: QueryPreferences (IID_IPAGELAYOUTPREFERENCES, iDocument)))

    It has no function to set and get the value of enable selected rolling Shuffle and facing page

    No one knows about it?

    I thank in advance

    There is no code for this example in the SDK or internet. Just understand and apply the concept.

    Find the code for the shuffle spread and together following spread shuffle...

    // Get active spread
    UIDRef GetActiveSpread() {
        UIDRef spreadRef = UIDRef::gNull;
    
        InterfacePtr layoutData(Utils()->QueryFrontLayoutData());
        if(layoutData) {
      spreadRef = layoutData->GetSpreadRef();
      }
    
      return spreadRef;
    }
    
    // Get spread shuffle of passed in spread
    bool16 GetSpreadShuffle(UIDRef& spreadRef) {
        InterfacePtr spread(spreadRef, UseDefaultIID());
        if(!spread)
      return kFalse;
    
      InterfacePtr iBoolData(spread, IID_IISLANDSPREAD);
        if(iBoolData) {
            return iBoolData->GetBool();
        }
    
        return kFalse;
    }
    
    // Set spread shuffle of passed in spread
    // @param bValue: kTrue = no shuffle, kFalse = allow shuffle
    ErrorCode SetSpreadShuffle(UIDRef spreadRef, bool16 bValue) {
        ErrorCode status = kFailure;
    
        InterfacePtr spreadCmd(CmdUtils::CreateCommand(kSetIslandSpreadCmdBoss));
        if(!spreadCmd)
            return status;
    
        spreadCmd->SetItemList(UIDList(spreadRef));
    
        InterfacePtr iBoolData(spreadCmd, UseDefaultIID());
        if(iBoolData) {
            iBoolData->Set(bValue);
        }
    
        status = CmdUtils::ProcessCommand(spreadCmd);
        return status;
    }
    
  • How to get and set the length and the width of the content of the layer?

    How to get and set the length and the width of the content of the layer

    All layers are packed not equal. a layer as adjustment have no limits. Layer to smart object can have two different sizes. The size of the object and the size of the object may be transformed. All smart object layers have an associated transform. To transform a smart object layers you need to work with the size of the object the generated pixels fot the layer. Text layer can be resized with a transform or by changing the font size. Pixelated layers are resize via a transformation.  The script method is resize.  When you resize the number of pixelsits made by interpolation. You can specify what method to use or set Photoshop interpolation preferably by default.

    There is also a bug in Photoshop scripts if you pause the story said make a selection and use resize. Photoshop will properly support up to a State before where you suspended history. This bug seems to be in all versions of Photoshop.

    If you look ate the script in my bug report, you should get a good idea of how to resize a layer.

    Photoshop: Bug Script resize the rear paper folded to a history State

  • How to get back my data for the health and the watch Apps once I've restored my phone?

    How to get back my data for the health and the watch Apps once I've restored my phone?

    From the backup, you're going to be restoration.

    If you back up to iTunes, make sure that it is an encrypted backup.

  • I have a new macbook pro and want to install CS3 on it. I followed all the download links. Found my serial number for my Adobe account and get up to date through the whole &amp; get this message ' put in place has encountered an error and cannot continue,

    I have a new macbook pro and want to install CS3 on it. I followed all the download links. Found my serial number for my Adobe account and get up to date through the whole & get this message ' put in place has encountered an error and cannot continue, contact adobe customer support for assistance ' all I want is for CS3 to install on my new computer so I can continue to work and do not have to spend hours working it help Please. CC is not an option, because I work in a country with no reliable unlimited internet access

    New computer means new problems of system operating with the OLD software means

    Fix possible Mac 10.10.4 (at least for Premiere Pro) https://forums.adobe.com/thread/1891705

    10.10 mac. ? sometimes has problems, often related to the 'default' permissions that need to be changed

    -solution https://forums.adobe.com/thread/1689788 of a person

  • Using the file class - muse. by default on my computer and not the last used folder.

    Using the file class - muse by default to my computer and not to the last used folder.

    Hello Perri,

    I tested on my end, and it seems that the issue is ongoing because of Air Version 3.8 was last updated. If restore you the version of Air to 3.7 this problem would be fixed.

    Here is the link to the page for the available versions of Adobe Air: http://helpx.adobe.com/air/kb/archived-air-sdk-version.html and you can use this link to download Adobe Air version 3.7:
    http://download.Macromedia.com/air/Win/Download/3.7/AdobeAIRInstaller.exe (Windows)

    http://download.Macromedia.com/air/Mac/download/3.7/AdobeAIR.dmg (Mac)

    Hope this information helps.

    Kind regards

    Fox

  • How to get and set values a HSlider

    Hello

    I haven't used flex for a while and I'm a little slow today.  My question is simple: how to get and set my HSlider values in a class.  My HSlider lives in an mxml file and class lives in a separate actionscript file.  First of all, I want to get the value of the hslider.  I use property change in the hslider to call a method in my class called Update(. ) In my class, I have the function called Update() and Interior using the id of the cursor to get the value of it.  The compiler is complainiing of 1120: access of undefined property hslider. I gave an example of pseudocode below:

    MXML

    < mx:HSlider id = minimum "hslider" = "0" maximum = "100" value = "100" dataTipPlacement = 'top' tickColor = '0 x 323232 '.
    snapInterval = "1" tickInterval = '10' allowTrackClick = "true".
    liveDragging = "true" change = "aClass.Update ()" / > "

    as file

    public void Update (): void {}
    myVar = hslider.value / 100.0;
    }

    Think how and then set the value of the hslider?

    Maybe the update to this other file function must accept a parameter of the event and then you can probably get this value from the event

    or maybe give the function a parameter of the cursor

    change = "AClass.Update (hslider.value)" "

    public void Update(value:int):void {}
    myVar = value / 100.0;
    }

  • Smart way to save large amounts of data using the circular buffer

    Hello everyone,

    I am currently enter LabView that I develop a measurement of five-channel system. Each "channel" will provide up to two digital inputs, up to three analog inputs of CSR (sampling frequency will be around 4 k to 10 k each channel) and up to five analog inputs for thermocouple (sampling frequency will be lower than 100 s/s). According to the determined user events (such as sudden speed fall) the system should save a file of PDM that contains one row for each data channel, store values n seconds before the impact that happened and with a specified user (for example 10 seconds before the fall of rotation speed, then with a length of 10 minutes).

    My question is how to manage these rather huge amounts of data in an intelligent way and how to get the case of error on the hard disk without loss of samples and dumping of huge amounts of data on the disc when recording the signals when there is no impact. I thought about the following:

    -use a single producer to only acquire the constant and high speed data and write data in the queues

    -use consumers loop to process packets of signals when they become available and to identify impacts and save data on impact is triggered

    -use the third loop with the structure of the event to give the possibility to control the VI without having to interrogate the front panel controls each time

    -use some kind of memory circular buffer in the loop of consumer to store a certain number of data that can be written to the hard disk.

    I hope this is the right way to do it so far.

    Now, I thought about three ways to design the circular data buffer:

    -l' use of RAM as a buffer (files or waiting tables with a limited number of registrations), what is written on disk in one step when you are finished while the rest of the program and DAQ should always be active

    -broadcast directly to hard disk using the advanced features of PDM, and re-setting the Position to write of PDM markers go back to the first entry when a specific amount of data entry was written.

    -disseminate all data on hard drive using PDM streaming, file sharing at a certain time and deleting files TDMS containing no abnormalities later when running directly.

    Regarding the first possibility, I fear that there will be problems with a Crescent quickly the tables/queues, and especially when it comes to backup data from RAM to disk, my program would be stuck for once writes data only on the disk and thus losing the samples in the DAQ loop which I want to continue without interruption.

    Regarding the latter, I meet lot with PDM, data gets easily damaged and I certainly don't know if the PDM Set write next Position is adapted to my needs (I need to adjust the positions for (3analog + 2ctr + 5thermo) * 5channels = line of 50 data more timestamp in the worst case!). I'm afraid also the hard drive won't be able to write fast enough to stream all the data at the same time in the worst case... ?

    Regarding the third option, I fear that classify PDM and open a new TDMS file to continue recording will be fast enough to not lose data packets.

    What are your thoughts here? Is there anyone who has already dealt with similar tasks? Does anyone know some raw criteria on the amount of data may be tempted to spread at an average speed of disk at the same time?

    Thank you very much

    OK, I'm reaching back four years when I've implemented this system, so patient with me.

    We will look at has a trigger and wanting to capture samples before the trigger N and M samples after the outbreak.  The scheme is somewhat complicated, because the goal is not to "Miss" samples.  We came up with this several years ago and it seems to work - there may be an easier way to do it, but never mind.

    We have created two queues - one samples of "Pre-event" line of fixed length N and a queue for event of unlimited size.  We use a design of producer/consumer, with State Machines running each loop.  Without worrying about naming the States, let me describe how each of the works.

    The producer begins in its state of "Pre Trigger", using Lossy Enqueue to place data in the prior event queue.  If the trigger does not occur during this State, we're staying for the following example.  There are a few details I am forget how do ensure us that the prior event queue is full, but skip that for now.  At some point, relaxation tilt us the State. p - event.  Here we queue in the queue for event, count the number of items we enqueue.  When we get to M, we switch of States in the State of pre-event.

    On the consumer side we start in one State 'pending', where we just ignore the two queues.  At some point, the trigger occurs, and we pass the consumer as a pre-event.  It is responsible for the queue (and dealing with) N elements in the queue of pre-event, then manipulate the M the following in the event queue for.  [Hmm - I don't remember how we knew what had finished the event queue for - we count m, or did you we wait until the queue was empty and the producer was again in the State of pre-event?].

    There are a few 'holes' in this simple explanation, that which some, I think we filled.  For example, what happens when the triggers are too close together?  A way to handle this is to not allow a relaxation to be processed as long as the prior event queue is full.

    Bob Schor

  • How to get distinct records by using the ListAgg OBIEE report function?

    Hi all

    I get a correct result as mentioned below. But I don't see duplicates in my result here, in my example, I get duplicate for the name of the employee 'Pat '. So how to get Distinct values by using the LISTAGG function?

    Data set of sample with the Department and its employees

    Service employee

    ----------      ----------

    Marketing Michael

    Pat of marketing

    Pat of marketing

    Pat of marketing

    Purchase of Den

    Purchase of Alexander

    Purchase of Shelli

    Purchase of Sigal

    Guy of purchase

    Purchase of Karen

    Using the ListAgg function, we can convert it to:

    Employees of the Department

    -----------     -------------------------------------

    Marketing of Pat, Pat, Pat, Michael

    Purchase of Sigal, Shelli, Karen, Guy, Den, Alexander

    I tried a lot of things, but I'm not able to understand how exactly this can be achieved, if anyone has any idea or suggestions please do share, thanks in advance.

    After much research, I found the solution & I want to share what he finds very useful, we can create SQL logic in the Advanced tab, as below and after you click Rescan, and then you will get your desired results.

    SELECT saw_0, Evaluate_Aggr T1.dept ("ListAgg(%1,'' & '') intra group (about 1%)") ("as long as VarChar (1000), T1.emp) saw_1 FROM)

    SELECT 'emp_dept '. "the Department dept,

    'emp_dept '. "' employee ' emp

    IN THE "DOMAIN".

    GROUP BY dept, emp

    ) T1 GROUP FROM T1.dept ORDER BY saw_0

    Also note here that we have good anti-aliasing for columns parent (ex: saw_0, saw_1), another by mistake oracle bi server.

  • Hello. I bought Lightroom, paid license 1 year view, did not have serial. E number and then past the 30 day trial and may not use the product or work more hard. I paid has been deducted from my credit card. How I'm going to work now?

    Hello. I bought Lightroom, paid license 1 year view, did not have serial. And number and then past the 30 day trial and may not use the product or work more hard. I paid has been deducted from my credit card. How I'm going to work now?

    Hi Sergior96769872,

    I saw your Adobe ID (email address), you used to post on the forums, and I see an active subscription on it.

    Please see Help below links: { make sure you use the same Adobe ID (email address) that you used to purchase the subscription }

    Connect and disconnect activate Cloud Creative applications

    Adobe Creative Cloud apps back in test mode after 2015 set CC to update

    * NOTE: Make sure that your firewall of your computer or security software firewall does not block Adobe, if you are not sure of it can just disable the firewall for a while and then log off and log on creative application of cloud and check.

    If it still gives you an error of the trial, then please refer to the troubleshooting listed below:

    If you are using MAC:

    1-force Quit the sub process in the same sequence as shown below from Activity Monitor: see, use the monitor activity on your Mac - Apple Support

    • Creative cloud
    • Basic timing & sync to basic support
    • CC library & process CCX
    • Adobe Common Desktop
    • Adobe update daemon
    • Broker CIB Adobe
    • After that, everything that said adobe on it do a force quit for her

    2 - right click on the Finder icon, then select the "Go - To" folder. You will get a text box, type in the following command and then press the 'return '. ("Not to be missed ~ symbol")

    ~/Library (it will open the folder of the user's library.)

    3. browse to the Application Support > Adobe > trash OOBE folder and folder AAM Updater

    4 - CUT any installed security software with firewall system.

    5 - go to: Apple icon > system preferences > Security & Privacy > General > "allow applications downloaded on" change this anywhere (to make these changes click the padlock in the corner at the bottom left of this window and enter your computer password)

    These changes are temporary you can restore these changes back to normal once your creative cloud app is running *.

    6 - restart the cloud creative app and connect


    If you use the WINDOW:

    1 complete the process / Task Manager tasks in the same order, as mentioned below the Manager tasks. See, Open the Task Manager

    • Creative cloud
    • Basic timing & sync to basic support
    • CC library & process CCX
    • Adobe Common Desktop
    • Adobe update daemon
    • Broker CIB Adobe
    • After that, everything that said adobe on it do a force quit for her

    2 - C:\Users\\AppData\Local\Adobe\ MAA UPDATER and two OOBE (App data & Program Data is hidden folder please see, Show files and folders hidden in Windows 7, 8.x, 10, or Vista)

    3 - CUT any security software installed with firewall system, also if your having any browser Add On installed for blocking advertising that turn off too.

    These changes are temporary you can restore these changes back to normal once your creative cloud app is running *.

    4 - raise the cloud creative app and connect

    Let us know if that helps.

  • Primavera P6 API - start and end dates of the activity in the secondary reference scenario

    How to seek early and dates of activity in the secondary database or tertiary reference end? There are areas of activities and methods provided in planning extraction and primary base line project (active class getBaseline1StartDate(), getBaseline1FinishDate) but can't find any secondary data or tertiary basis even if we show them in details the activity in the Primavera. I use Primavera integration API version 8.2.

    Use the BaselineProjectHelper class to get a list of all the base lines for a given project.  Go through the list looking for basic lines you are interested in.

    Once you have basic interest projects, pull a list of ongoing project activities.

    Browse the list of activities tearing you start and end dates.

    Call the method on each of you loadBaselineActivity of reference projects for the departure of the referenced activity and end dates.

    For performance, seek assistance loadBaselineActivities to reduce database queries.

    V/r,

    Gene

Maybe you are looking for