"Best practice" to access a class for a custom component?

My application uses a simple class to contain global properties such as the user name, session data, and similar data. The class is initialized at the start of the application through code similar to: appGlobals:myGlobals = new myGlobals.

Many custom MXML components and as classes need access to these data. I was able to work with it using Application.application.appGlobals.propertyname.

This method, the best way to connect classes and components to a class initiated on demand isn't level, or should I learn something new until I build a lot of code on this method?

Thank you.

Paul

The best practice in this case is to use custom events to pass around data, for a loosely coupled application.

Here is my Flex cookbook post on custom events:

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

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

Tags: Flex

Similar Questions

  • Need to include classes in the custom component

    Dear Experts,

    I have created custom components, for custom components, I used some different classes and jars and libs and now I want to include these pots, the lib and classes in the generation of custom component file.

    Please advise me how can I add these files in the component so that when I create the zip file included in the zip file.

    Please send me a link where I can get this information.

    Any help will be really appreciated.

    Kind regards

    Elena

    See the tutorial Services Intradoc

  • Pass a parameter for the custom component - get null

    Main MXML (part of the code):

    < s:Application

    "" xmlns:ns1 = "*".

    creationComplete = "init (); >

    import MyComponent;

    private function init (): void {}

    var myArray:Array is ["FFF", "TT", "RRR"];.

    myComp.width = 200;

    myComp.height = 200;

    myComp.getArray = myArray;

    myContainer.rawChildren.addChild (myComp);

    }

    < fx:Declarations >

    < ns1:MyComponent id = "myComp" x = "0" y = "0" / >

    < / fx:Declarations >

    custom component:

    package 
    {
              public var getArray:Array;
    public class MyComponent extends Sprite { } trace (getArray); trace null
    }
    }

    What is myContainer?

    I have a working version with my container as UICOmponent inside the hand.

    SerializableAttribute public class MyComp extends Sprite

    {

    private var _getArray:Array;

    public void MyComp()

    {

    }

    public function get getArray (): Array

    {

    Return _getArray;

    }

    public function set getArray(value:Array):void

    {

    trace ("setter", value);

    _getArray = value;

    }

    }

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx".

    "" xmlns:NS1 = "*".

    minWidth = "955" = "600" minHeight

    creationComplete = "init (); » >

    private function init (): void {}

    var myArray:Array is ["FFF", "TT", "RRR"];.

    myComp.width = 200;

    myComp.height = 200;

    myComp.getArray = myArray;

    myContainer.addChild (myComp);

    }

    ]]>

    Not sure whether what you are after but it traces:

    Setter FFF TTT, RRR

    Why do you add to rawChildren?

    C

  • Best practices in preparing a picture for printing or Web site?

    I use Photoshop for more than 15 years, but my knowledge is limited to a few tools I needed: color correction, contrast and density correction, cropping and occasional sharpening. While working with the photo editing software in the newspaper where I work (I don't use Photoshop, just at home), I noticed that its preparing images for printing always achieved results beyond what I've accomplished. I asked him what was his procedure Basic, but for some reason, he did not. I heard once him using channels in the inhancement of the image, which I do not know anything for another photographer. His images also have a freshness which does not resemble the typical photo where the blur has been applied. In other words I don't see this halo effect where a light area meets a dark area.

    Yes, I found tons of tutorials general Photoshop on the Web, but have not found one that guides me through the actual steps to prepare a photo for printing. Same problem with the preparation of photos for use on the Web. Can someone point me in the right direction?

    Something common to improve journal crispy is getting black contrast and sharpness. You can change the black channel of a CMYK image or go to the lab and ramp to the top of sharpness and contrast on the L channel.

    http://www.libraw.org/articles/displaying_L_channel_in_Photoshop.html

    http://photo.NET/learn/digital-photography-workflow/advanced-Photoshop-tutorials/sharpenin g-in-lab-color.

    http://www.Dgrin.com/showthread.php?t=26724

  • Access analytical DPS for the customer only

    Hello

    My internal clients wish to access Analytics DPS, but the thing is that I'm not comfortable to give this password and access to several people and also, fear some would access the producer Folio and delete or cancel the publication/publish content (change the name of my folio etc.). Well, you understood me that I don't want to give them access to the Folio producer

    Is it in any case to create access to all analytics or create a parallel account?

    Only an Adobe ID account that is configured with the application role to view the Analytics page.

    Laxman

  • I can define a constructor for a custom component?

    I have a component custom that I instantiated via ActionScript.  In order to clean code, I wish I could assign variables via the constructor as any other class:

    var myComp:CustomComponent = new CustomComponent (arg1, arg2,...);

    However, when I try to write a constructor in the Script block for the component, it gives me a compilation error telling me that I have several manufacturers:

    In the Script tag.

    public void CustomeComponent(arg1,_arg2...):void {...}

    Are we not capable of defining custom components manufacturers?

    If it's an ActionScript component, you should have no problem creating and editing a constructor.

    For MXML components, you cannot add your Builder won because she would be in conflict with what the compiler creates.

  • to access the QML attached objects in C++ and best practices for the handling of the user interface in classes

    Hello

    I have in fact 2 queries

    (1) how can we access attachedobjects defined in QML in C++?

    (2) I'm loving development on Blackberry 10 C++ is one of my favorites. But I'm a bit lost when it comes to managing the user interface in classes. For example when we create the project through momentics we have a class called ApplicationUI. It manages all the (default) user interface commands, we in C++. as for example creating the document qml and setting as root user interface, etc. I am now working on an app that have NavigationPane as root, and then I continue to push pages (like the screens). But now the code for all pages is inside my ApplicationUI. What is the best practice to keep the UI for each page logic in a separte C++ class?

    I also develop for Android that a separate class for each activity, this code does not mingle for each activity. Please guide me how can I keep logic of user interface of each Page into a separate class of C++?

    regarding your second question:
    I think this is the simplest approach to keep all things in the UI in QML. You can easily put things into separate files.

    If you want to use c ++ to the user interface: can be done, too. just put it in separate classes and include those in your application class.

  • Best practices for the configuration of VMotion

    Hi guys,.

    I need to try VMware Vmotion. What are the steps to configure Setup for VMotion. Could someone help me with this?

    I had tried to do VMotion, but have not seen the result.

    I currently have two boxes of ESX (ESX 3.5 U3) with VI U4. Primary ESX with Guest OS WIN2K3 and WINXP.

    I am also wanting to know the best practices that can be followed for configuration of VMotion.

    Concerning

    MRM

    http://www.VMware.com/PDF/vi3_35/esx_3/R35/vi3_35_25_3_server_config.PDF

    The link above is a complete in pdf format on the configuration of ESX, including the VMkernel you need for VMotion.

    Duncan

    VMware communities user moderator

    -

  • Best practices for controlling Remote Sites ESX servers

    Hi all

    I was wondering what the best practices or the options are for the management of the ESX servers in remote offices or branch.  I know that you can always use the VI to control on the site server, but what happens if you want to use some of the functions of the virtual Center?  How remotely manage and leverage capacity of Virutal Center in remote sites or branch offices, since you can't have Virutal Center installed in a domain.

    Other then a VPN dedicated to all remote offices or a branch is there another way to use Virtual Center to remotely manage the ESX servers in remote offices or branch?

    What are your current plans DR if the main site is going to host VC?

    You can run your VC in a VM and have power clone on a remote site or both incase of total failure.

    Then with the help of RCL etc. under the texiwill recommend and/or vMotion VM VC to other sites if necessary.

    Andy, VMware Certified Professional (VCP), http://www.vmadmin.co.uk/

    If you have found this information useful please give points by using the buttons at the top of the page accordingly.

  • Best practices of the controller auto-Anchor

    Hi all

    I got confused with this configuration. I have 2 of Wlc. One is the internal controller and another set for the controller of the anchor (different subnet-DMZ area) for traffic comments. Where can I configure DHCP assignment for users of this... ? Must deal with to intervine Production controller in this dhcp or will I directly anchor to take care of everything... ? What is recommended?

    And any best practice doc is also available for this... ?

    Help, please...

    Thanks in advance.

    I usually use the WLC anchor for dhcp or the client will in fact have a dhcp server in the DMZ. I don't like to dig holes through the FW to dhcp unless I have to.

    Sent by Cisco Support technique iPhone App

  • Best practices MD3000i

    Hi group.

    I expect to get an idea of what would be the best practices for a MD3000i.  Here is a little history on our purchase.

    MD3000i with two controllers, 15-600 GB SAS 15 k RPM

    3 servers Dell R710 with built in 4 network cards, all the iscsi capable unloading.  Each server is dual core quad, 24 GB of ram each.

    We will only be endearing vsphere esx 4.0 to the San.

    We will moderate a general mix of virtual machines windows.  One of these virtual machines will be sql 2008 which should be light to medium capacity.  Two virtual servers will be citrix xen application servers.  The rest will be your garden variety domain controllers, point sharing, web servers, print servers.

    Basically, I think I know what I want to do, but am looking for validation or advice on what I could not have thougth.  I've never used the MD3000i before and besides, iscsi.  We have always been EMC fiber channel.

    So, I thought that a disk is a hot spare, leaving 14 left.  This is where I need a little advice.

    Is it wise to scratch the other disks in raid 10 for better overall performance?  Is - this 1 raid group or should I think about maybe 2 raid groups (disk 6 and 8 disk)?  RAID 10 will leave us with 4.2 TB of usable space, and it's more than enough for our needs.

    Then the next question is the lun size matter?  I see no valid reason to carve up LUN more than are really necessary.  On our EMC clarions we LUNS in all directions, but it is useful, as migrate us them and resize them all the time.  That was before provisioning and we also have no vmware servers attached to EMC for general sql clustering.

    The only other thing that I think would be good is to have a piece of storage dedicated to backups.  We investigate vizioncore for vm backups and I'd like to store backups here as well.

    Any notice or advice appreciated!

    Thanks in advance.

    To see LUN sizing:

    Best practices in designing LUN

    For the number of virtual disk on the storage, I suggest you keep at least 2 different RAID group with the other fixed disk.

    This because I assume that you have 2 controllers and MD3000i each VD can be 'active' on a single controller.

    So at least 2 different VD you can improve the performance by simpe together different controllers as a preferred owner.

    For more information on the MD3000i, see also:

    http://www.delltechcenter.com/page/VMware ESX4.0andPowerVault MD3000i

    André

  • New to ColdFusion - Question about best practices

    Hello.

    I've been programming in Java / c# / PHP for the past two years or so, and as of late have really taken taste to ColdFusion.

    The question I have is around the effective separation of the code, and if there are any best practices that are preached by using this language. While I was learning Java, I was taught that it is better to have several layers in your code; example: Front end (JSP or ASP)-> Business Objects-> support-> database. All the code I've written using these three languages followed this simple structure, most of the time.

    As I dive deeper into ColdFusion, most of the examples I've seen of vetrans of this language really does incorporate a lot of separation. And I don't mean the simple ' here's what this function only "type of online examples where most of the code is written in a single file. I was able to see the projects that were created with this language.

    I work with a few developers who have written in ColdFusion for a few years and put the question to them as well. Their response was something to the effect, ' I don't know if there is any recommended for this, but it really doesn't seem like there is really a problem, make calls like that. "

    I searched online for any type of best practices or discussions around that and have not seen much.

    I still consider myself a bit of a noobling when it comes to programming, but best practice is important to me for any language that I learn more about.

    Thanks for the help.

    You might want to take a look at a number of major frameworks available for

    ColdFusion.

    FW/1 II, model glue, CFWheels, ColdBox and Mach.  They do a great job of

    giving you a path for the separation of code, best practices, etc.

    http://www.carehart.org/cf411/#cffw

  • Question: Custom Classes vs. Custom components?

    I notice that I can do many things same using a custom class or a Custom Component.  Can anyone share their experience about the advantages and disadvantages of each?

    Thank you.

    Ultimately, a component is a class...

    C

  • Best practices to configure NLB for Secure Gateway and Web access

    Hi team,

    I'm vworksapce the facility and looking for guidance on best practices on NLB with webaccess and secure gateway. My hosted environment is Hyper-v 2012R2

    My first request is it must be configure NLB, firstly that the role of set up or vice versa.

    do we not have any document of best practice to configure NLB with 2 node web access server.

    Hello

    This video series has been created for 7.5 and 2008r2 but must still be valid for what you are doing today:

    https://support.software.Dell.com/vWorkspace/KB/87780

    Thank you, Andrew.

  • What is the best way or best practices for access to the session defined in servelt pipeline component?

    Hi Experts,

    What is the best way or best practices for access to the session defined in servelt pipeline component?

    Please, share your ideas.

    Thank you

    ankV

    As performance is concerned, a lot would depend on as to how your design & logic is implemented and you presented search operations to support the specific performance problems. In fact the operation itself can be not expensive than in-house it is somewhat like a search for key/value of the objects in session/application context name. But having said that, Yes, a potential performance problem could be because it's a synchronized operation. So to avoid searches to be performed during each request, caching the results of a search of a component. And in the majority of cases to solve a 'A' component within your component, you must configure a property reference 'A' in the file properties for your component.

Maybe you are looking for

  • Black screen on startup with a Satellite U200-115

    I have a U200-115, I downloaded an upgrade for the BIOS of toshiba and installed in accordance with their instructions. Since upgrading my laptop does not start, all I get is a black sreen with a sound signal and a flashing light orange. Any ideas?

  • Qosmio F10 - DVD RAM mast * a UJ - 830 s firmware 1.0

    Hi all. My work takes me to travel regularly in several countries and therefore, my DVD drive is running out of parts.I thought the point of having a laptop to use it everywhere.Well well, not in this case.The irony is that it affects only DVD legal

  • Types of complex data in CVI2015

    Hello... The CVI2013 compiler (not the variable view) supported the use of complex data types, see, e.g., here. CVI2015 now gives an error: complex types are not supported - if the build fails. What should I do? (the compilation that compilation with

  • Seagate Goflex desktop hard disk... error 10...

    My 1 year old Seagate Go flex desk hard drive can be more recognized by my device manager. Right click and following the guests either reinstall the driver or update driver has failed. After this title, a code 10 error message states that the driver

  • Replace the MBR from Windows XP Pro

    How to replace or repair the MBR from Windows XP Pro? An ASR replaces the MBR? Out of curiosity, I tried sysint.no mbrfix.exe using examples.  I know ran fixmbr mbrfix application.  How to bring back the original Windows XP Pro MBR? In addition, the