Nifty tip:  How to get display container parent references to compile. (AS3)

Hello,
I appreciate the help I've received in this forum and wanted
to give back a little bit (am not familiar enough with AS3 yet to
answer questions).
Today I encountered a tricky problem in referencing a parent
container. The class structure was something like this:
class wrapper extends Sprite {
function wrapper() {
var displayChild = new displayChild();
addChild( displayChild );
function parentFunction() {
//Code here
class displayChild {
function childFunction() {
parent.parentFunction();
This code compiled and ran properly in standard mode. The
problem was that this type of structure wouldn't compile in strict
mode. It gave an error:
1061: Call to a possibly undefined method parentFunction
through a reference with static type
flash.display:DisplayObjectContainer.
The fix was to reference the parent like this:
function childFunction() {
var parentObj = parent;
parentObj.parentFunction();
However after putting this fix into three or four functions I
decided to make parentObj a global. Believe it or not, the
following wouldn't compile:
class displayChild {
var parentObj = parent;
In other words, the compiler would only accept the fix if the
parentObj reference was in a function.
Why would this be? Any takers?
It turns out that the parent object doesn't exist until the
constructor has completed running. We encountered this in Flash MX
when using embedded movie clips too. A movie clip or any display
object (in AS3) doesn't exist until it is completely loaded. If it
doesn't exist it doesn't have a parent. So the parent reference is
invalid at compile time. It is only valid at runtime. When we call
a function at runtime, the parent exists so we can assign it to
parentObj and use it to call the parent.
Luckily the compiler is forgiving enough to allow the
statement:
var parentObj = parent;
even though parent is undefined. But of course the compiler
has to allow this, otherwise it wouldn't allow us to assign any
undefined values to a variable.
Hope this is helpful to someone!
Cheers,
Mark

Hi,
   Try this:
RootUIElementContainer - GridLayout, colCount=1, width=500px.
Goup1 - FlowLayout, colSpan=1, width=100%.
Group2 - FlowLayout, colSpan=1, width=100%.
Regards,
Satyajit.
Message was edited by: Satyajit Chakraborty

Similar Messages

  • How to get display sale order in MB51

    Hi,
    How we can get display sale order in mb51 , at present only sale order with special stock "E" is been display .
    Thanks..

    HI,
    if you just want last / latest SALES ORDER for material then check table VBAP
    if last billing document then check table VBRP
    check MCBE
    Prese F6
    there you can select the columns
    Last consumptn.
    Last gds issue
    Last gds mvmt.
    Last Receipt
    VA05- Report for the sale with Material Vs Customer. or
    You can easily get that in VBAP by putting the material number for MATNR
    for more clarity please refer the below link...
    How to findout last sale transction date of perticular material
    Regards,
    Udaya.

  • How to get order type from reference  document

    Hi ABAP Gurus,
      I am working on pricing routines for return orders.
      in this return order i am getting reference docuemnt number .
      now i need to find that this reference document is sales order or invoice .
      how can i find  this .
      i know i need to use VBFA table . but i am confused in precedding and subsequent document.
    please guide me how can i find this.
    Thnaks,
    Neo

    > I am working on pricing routines for return
    >  orders.
    > in this return order i am getting reference docuemnt
    >  number .
    > now i need to find that this reference document is
    >  sales order or invoice .
    >  how can i find  this .
    > i know i need to use VBFA table . but i am confused
    >  in precedding and subsequent document.
    Since you mention the pricing routines, I guess you are working on a VOFM routine or a user exit. I think that Anji gave the best universal solution for finding the document type by using VBUK table. VBFA table should not be used for this purpose IMHO.
    Additionally, inside the VOFM routine or a user exit you might be able to use VBPA or XVBPA/YVBPA table - the field VGTYP will contain the reference document category for each line. C = order, M = invoice, there are several orders, which you can see in SE11.
    Just FYI "preceding document" in VBFA is the document that was created first. For example, a sales order is a "preceding document" and the corresponding outbound delivery is a "subsequent document".
    Hope this helps and good luck!

  • How to get rid of the reference lines on the front panel

    I forgot how I created a couple of horizontal and vertical reference lines on the front panel. It looks like the origin lines on the front panel. When I move my program to another monitor with different resolution, all the layout is messed up because of the reference lines can not change with the resolution. Did anybody meet this before? How to get rid of them?
    Attached are the 2 creen shot of front panels.
    Thanks in advanced.
    Solved!
    Go to Solution.
    Attachments:
    front panel.png ‏63 KB
    front panel2.png ‏42 KB

    You will have to click on the top menu and choose options see below
    when you do this window will pop up and you scroll down until you get to the front panel options. See below
    Tim
    Johnson Controls
    Holland Michigan

  • How to get an object's references through JVM

    Hi,
    I am performing some runtime program analysis and would like to know at exactly what point an object becomes "unreachable".
    For example, I have a Testing Program (TP) and a Program Under Test (PUT) containing a set of classes. For each object o created by the PUT, TP maintains an object reference to it. At some point later, if TP decides that the only reference to object o is from TP (i.e., o is pointed to by some object out of the scope of PUT), then object o is considered to be "dead" (although it is not real garbage from the GC's point of view).
    Hence, I am wondering if it is possible for any given object, to retrieve all the references that are pointing to it. If I am able to do this, maybe I can know whether the reference from TP is the only reference to an object in PUT.
    Thank you and have a nice weekend,
    -- Sunny

    This could be achieved with JVMTI. See http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#Heap
    There is no ready made function for achieving what you want, but all the building blocks are there, since you can iterate over the heap and you can get information about all reference relationships.
    Regards,
    Daniel

  • TableSorter + custom cell renderer: how to get DISPLAYED value?

    Hi!
    I have a JTable with a custom cell renderer. This renderer translates numerical codes, which are stored in the table model, into textual names. E.g. the table model stores country codes, the renderer displays the name of the country.
    Now, having a reference on the JTable, how can I get the DISPLAYED value, i.e. the country name? Is there some method like ....getRenderer().getText()?
    Thanx,
    Thilo

    Well, a renderer can be anything. It may be rendering an image not text so you can't assume a method like getText(). However, since you know the component being used to render the cell you should be able to do something like:
    TableCellRenderer renderer = table.getCellRenderer(row, column);
    Component component = table.prepareRenderer(renderer, row, column);
    Now you can cast the component and use get text.
    Another option would be to store a custom class on the table cell. This class would contain both the code and value. The toString() method would return the value. Whenever you want the code you would use the table.getValueAt(...) method and then use the classes getCode() method. Using this approach you would not need a custom renderer. This thread shows how you can use this approach using a JComboBox, but the concept is the same for JTable as well:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=417832

  • How to get/display  time with minutes in a test item

    Dear experts,
    Forms [32 Bit] Version 10.1.2.0.2 (Production)
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    Oracle Toolkit Version 10.1.2.0.2 (Production)
    PL/SQL Version 10.1.0.4.2 (Production)I've the following requirements.
    In my form, there are three text items and one save button.
    Text items named as
    No_of_days --> Number data type
    (user will enter number of days)
    hours_limit --> Char data type with format mask (HH:MI);
    (user will enter hours with minutes)
    Upto_date_time --> date data type;
    this field calculated as (No_of_days+hours_limit+sysdate)
    User will enter No_of_days or hours_limit:
    Based on the values I've to calculate Upto_date_time
    Here is the problem:
    1) If user doesn't enter hours_limit I want to show default time as " 04:00 PM"
    2) If user enter hours_limit field we should allow them to enter in the following format
    "HH24:MI" format;
    what whould be suitable data type for hours_limit field..
    I tried with char and i've set the format mask as ,
    set_item_property('BLOCK3.hours_limit',format_mask,'HH:MI');
    But I'm geeting the error
    "FRM-50027:Invalid format mask for given datatype"
    Please help to solve this problem,
    Regards,
    Karthi

    Hi vansul ,
    set_item_property('BLOCK3.hours_limit',format_mask,'HH:MI');
    Format mast is only allowed to date data type fields.If i set the hours_limit item's data type as date , I'm getting the error message "ORA-01843:Not a valid month"..
    How could i make this field only getting or display time with minutes?
    Regards,
    Karthi

  • How to get display name using PL/SQL

    Hello i whish to know if any one know how get the url and the display name of a page group, i ask this because i what to make a dinamic menu usgin dinamic pages.
    If any one know please let me know
    Best Regards
    Jose.

    Jose -
    Use the view WWSBR_ALL_CONTENT_AREAS.
    The Content views are documented here: http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1012/wwsbr_api_view.html
    Regards,
    Candace

  • How to get Top most parent Taskflow Id at runtime?

    Hi,
    I am working on a portal site and I need to get the parent Id of the current taskflow at runtime.
    Following is the code through which I get the current taskflow Id.
    ControllerContext cctx = ControllerContext.getInstance();
    ViewPortContext currentViewPort = cctx.getCurrentViewPort();
    TaskFlowContext taskFlowCtx = currentViewPort.getTaskFlowContext();
    TaskFlowId taskFlowId = taskFlowCtx.getTaskFlowId();
    String taskFlowName = taskFlowId.getFullyQualifiedName();
    But How can I get the parent Id if this taskflow is embedded within some taskflow(s). I want to get the top most parent Id.
    Your help is appreciated.
    Thanks,
    Jaykishan

    Hi, i tried this code but i'am getting ClassCastException.
    ControllerContext cctx = ControllerContext.getInstance();
    ViewPortContext currentViewPort = cctx.getCurrentViewPort();
    ChildViewPortContextImpl c = (ChildViewPortContextImpl)currentViewPort; (get error here oracle.adfinternal.controller.state.RootViewPortContextImpl cannot be cast to oracle.adfinternal.controller.state.ChildViewPortContextImpl)
    Object pViewPort = c.getParentViewPort();
    ViewPortContext parentViewPort = (ViewPortContext)pViewPort;
    String parentTaskFlowId = parentViewPort.getTaskFlowContext().getTaskFlowId().toString();
    how did you manage to make work ?

  • How to get label of Parent level nodes, when itemOpen() event of any node in AdvancedDataGrid in Flex?

    Hi all,
              This is the code, to get the label of every one parent level nodes, when we open the parent node item in AdvancedDataGrid in Flex.
    <?xml version="1.0"?><!-- dpcontrols/adg/SimpleGroupADGMXML.mxml --><mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert; 
    import mx.events.AdvancedDataGridEvent; 
    import mx.collections.ArrayCollection; [
    Bindable] 
    private var groupData:ArrayCollection = new ArrayCollection([{Computer:
    "HardWare Devices", Device:"Keyboard", Company:
    "Logitech", PriceInRupees:"500"}, {Computer:
    "HardWare Devices", Device:"Keyboard", Company:
    "Microsoft", PriceInRupees:"500"},{Computer:
    "HardWare Devices", Device:"Mouse", Company:
    "Logitech", PriceInRupees:"300"},{Computer:
    "HardWare Devices", Device:"Mouse", Company:
    "Microsoft", PriceInRupees:"300"},{Computer:
    "HardWare Devices", Device:"Monitor", Company:
    "LG", PriceInRupees:"5000"},{Computer:
    "HardWare Devices", Device:"Monitor", Company:
    "Microsoft", PriceInRupees:"5000"}]);
    //This method is used to get label of every parent lavel nodes, when we open any item 
    private function getLabel(e:AdvancedDataGridEvent):void{
    Alert.show(e.item[
    "GroupLabel"]);}
    ]]>
    </mx:Script>
    <mx:Label text="NOTE : Open the every parent level nodes here. We can get the label of every one parent level nodes."color="
    blue" fontWeight="bold"/>
    <mx:AdvancedDataGrid id="groupADG" width="
    100%" height="437" initialize="gc.refresh();" itemOpen="getLabel(event)"
    >  
    <mx:dataProvider>
    <mx:GroupingCollection id="gc" source="{groupData}">
    <mx:grouping>
    <mx:Grouping>
    <mx:GroupingField name="Computer"/>
    <mx:GroupingField name="Device"/>
    </mx:Grouping>
    </mx:grouping>
    </mx:GroupingCollection>
    </mx:dataProvider>  
    <mx:columns>  
    <mx:AdvancedDataGridColumn headerText="
    Computer"/>
    <mx:AdvancedDataGridColumn dataField="Company"headerText="
    Company"/>
    <mx:AdvancedDataGridColumn dataField="PriceInRupees" headerText="PriceInRupees"/>
    </mx:columns>
    </mx:AdvancedDataGrid>

    Dialog\ResponseTime 6585
    "The dialog response time consists of the period of time from the request of the dialog to the dispatcher through the processing, to the ending of the dialog in the dispatcher and the transfer of the data to the presentation layer"
    This is not buffered as far as I know is measured on demand
    Read,
    http://help.sap.com/saphelp_nw70/helpdata/en/31/d7843b43c8e937e10000000a11402f/content.htm
    Regards
    Juan

  • How to get path or parent folder

    Hello
    I'm overriding method extendedPreAddRelationship on class S_Relationship.
    My purpose is to check whether the document is being put in the correct path or not.
    I can get folder name and document name using following code:
    AttributeValue av;
    av = def.getAttribute(Relationship.LEFTOBJECT_ATTRIBUTE);
    S_PublicObject folder = (S_PublicObject) av.getPublicObject(this.getSession());
    av = def.getAttribute(Relationship.RIGHTOBJECT_ATTRIBUTE);
    S_PublicObject document = (S_PublicObject) av.getPublicObject(this.getSession());
    What I need is the whole path (or at least the parent folder). Can I get path somehow? Or should I try to search parent folders?
    Jaska

    My purpose is to check whether the document is being put in the correct path or not.Hi,
    I had a similar problem - I needed to compare the path of current folder with path from parameters. Because I wasn't be able to get the path of folder, I did it in reverse way, comparing the folders. To get folder from path I needed getRootFolder method, which wasn't in server-side classes, so I extend S_TieFolder class:
    * Analogy of LibrarySession.getRootFolder().
    public static S_Folder getRootFolder(S_LibrarySession session)
    throws IfsException
    S_Folder folder = null;
    try
    Collection c = session.getValueDefaultCollection();
    S_ValueDefault vd = (S_ValueDefault)c.getItems("RootFolder");
    AttributeValue av = vd.getPropertyValue();
    folder = (S_Folder)av.getPublicObject(session);
    catch(Exception e)
    throw new IfsException(21020, e, session);
    return folder;
    In extendedPreAddItem method of S_TieFolder:
    S_Folder paramFolder = (S_Folder)getRootFolder(session).findPublicObjectByPath(folderPath);
    if( this==paramFolder ) ...
    Radek
    [email protected]

  • How to get self-contained .mov files without FCE opening up?

    Hi all experts,
    I have fully rendered my first file, which is a simple text animation.
    I did Export > QuickTime Movie. I am sure I tick the MAKE MOVIE SELF CONTAINED box.
    When I quit FCE, I went to search for that .mov file. When I click at the file, FCE project file open up as well !!
    If I copy this file for my friends, when they click at it, will they be able to see it if they do not have FCE ?
    Thanks

    David Harbsmeier wrote:
    Sometimes it helps to change the 'opens with' info. Right-click on the file and choose 'Get Info.' In the "Opens With" box, change from FCE to QuikcTime Player.
    -DH
    Thanks David.
    I really didn't know that there is such a thing. But hey, thanks for teaching me !!
    Problem Solved.
    Thanks again
    Cheers

  • How to get Display to not "stretch" and therefore distort photos

    My wife has 20" Cinema Display hooked up to an IBM Thinkpad running Windows XP. Because the Display is "stretched" (extra wide), it distorts photos, making everything appear wider than it really is.
    Is there any way to get the display to not be stretched? This can be done on my Macbook in System Preferences, but the display settings in the PC do not have that option.

    You need to update the drivers on the Thinkpad to a version that supports widescreen resolutions. If you post the exact model of Thinkpad, someone will be able to point you in the right direction.

  • How to get servlet container name on which servlet is running

    I tried getServletInfo(),but I couldn't get the information. Please give me code to find the servlet container on which servlet is running.
    Is there any system property which will retrieve servlet container information such as its name and version
    Thanks & Regards,
    Nasrin.N

    getServerInfo() should work.
    What about getServerInfo() doesn't work for you?
    My standard solution is to this in a JSP page:
    <h2> Server Info </h2>
    Server info = <%= application.getServerInfo() %> <br>
    Servlet engine version = <%=  application.getMajorVersion() %>.<%= application.getMinorVersion() %><br>
    Java version = <%= System.getProperty("java.vm.version") %><br>Cheers,
    evnafets

  • How do get rid of parental controls on apple tv?

    I can't do anything without it asking for a pass code.  I don't know the passcode.
    How do I reset it.  I already tried unpluggineg the unit.  That didn't work.  Then I tried
    resetting it and that didn't work. 
    Someone please help.
    Thank you

    Welcome to the Apple Community.
    You'll need the code to turn of parental control, that's the purpose of it. If you can't remember it, you'll need to restore the Apple TV.

Maybe you are looking for

  • Everything I had on my IPOD touch before a restore was delted and wont go back on. Except my pictures.

    I've had my IPOD touch for about 2 months now and I've been experiencing alot of problems with it but this one by far is the biggest. Itunes told me that there was an error and i needed to Restore my IPOD. I did and when it finished i went to lsten t

  • Username creation using PAPI-WS code

    Hi all, I am testing the code in the online example for PAPI-WS i.e. BPM-PapiWs-JaxWs-Example.... I have my process running and PAPI Web Services started.. I have my username and password as test , test... I am getting errors in username password aut

  • Ipad mini/HDMI question?

    I want to buy the lightning to HDMI adapter for my ipad mini to use it to record video WHILE it's hooked to the monitor.  Does this keep the record screen ACTIVE while it mirrors the video, or is this not possible?

  • Account Postings in Third Party Purchase Orders

    Hi All Please explain  the Accounting Docs generation in Third Party Purchase Orders in the following scenerios. 1. Purchase Order created against Sales Order and goods to be delivered to Customer. 2. Goods to be To be delivered to another vendor 3.

  • Error 50: impossible to installa adobe creative cloude desktop. any suggest? thanks

    hi, in a first instance, i tried to do the upgrade of my adobe creative cloud destop, but i received the error number: A12E1. so, i see on the support site that i've to uninstall the cc, use the cleanup tool , reboot my desktop and download again the