Table/complex objects in the Datagrid

Hello

I'm a complete noob to all of this, but I have a table a little complex... and I know that my paintings will get more complex.


I can get a single line by putting it as the data provider: {dataProvider [0] ['time']}
Or this: {dataProvider [1] ['time']}

BUT... I want several rows in my DataGrid. I can't find a way to do this.

Simply by putting {dataProvider} returns [object Object]... put in {dataProvider [1]} will return also [object Object]... This is provided for my dataFields are specified correctly of course for every level.

Flash and visible in the form of objects, he barks at me to try to convert into ArrayCollection collection or anything else.

I'm trying to make a new array even of just the dataProvider [0] ['Time'] entries by specifying newArray [0] = dataProvider [0] ['time']... etc or trying to newArray.push(dataProvider[0]['Article'])... but it is inside a function (for my remote connection) and I can't get the matrix to the public space for use in my DataGrid... or I'll get an error of not being able to make an object in a table.

Clues? It sounds like such a simple thing... and of course, I've learned that you can't just put a loop statement inside the dataprovider... that would make super easy... so what's up?

Thank you.

Here is the structure of my table by the way (returned with amfphp)... which will probably not be indented, sorry.

Table
(
[0] = > array
(
[Time] = > Array
(
[id] = > 1
[created] = > 2007 - 02 - 25
[time] = > 10
[notes] = > hours (10)
[project] = > 1
[user_id] = > 1
)
[Project] = > Array
(
[id] = > 1
[name] = > Test Project #1
[created] = > 2007 - 02 - 25
[reason] = > 2007 - 02 - 28
)
[User] = > Array
(
[id] = > 1
[username] = > admin
)
)

[1] = > array
(
[Time] = > Array
(
[id] = > 2
[created] = > 2007 - 03 - 04
[time] = > 4
[notes] = > initial Setup page layout
[project] = > 1
[user_id] = > 1
)

[Project] = > Array
(
[id] = > 1
[name] = > Test Project #1
[created] = > 2007 - 02 - 25
[reason] = > 2007 - 02 - 28
)

[User] = > Array
(
[id] = > 2
[username] = > tom
)
)
)

I thought about it.
I posted my research here: http://www.concepthue.com/how-to/cake_flex/

Basically, I had to simplify the data coming out of CakePHP. I followed the tutorial from Mike Potter for a good bit of it.

In my view, it is not 100% optimal, but in my view, it follows good practices on the end of CakePHP and Flex. Potentially more calls to the database can be made even if.

I'm still not satisfied that there is no way (apparently) to format the data for use in the DataGrid inside Flex.

Basically, I have to call data in order to create 'special' for the DataGrid control arrays. Now there is nothing special to their topic, only they are different than the charts that I will use for the rest. In fact, berries for the DataGrid are pretty useless for anything else and they are not enough descriptive - bad organization of information.

In any case, it works. So mission accomplished, yay.

Tags: Flex

Similar Questions

  • List of tables of objects or the user-defined type columns

    Hello

    SQL > select * from v version $;

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE Production 11.2.0.2.0
    AMT for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    I have n number of tables in my db, since I have several
    tables containing "user defined type columns.
    so, how can I get/list db objects that contains the user-defined type columns only.
    Please suggest me on this

    Kind regards
    Faiz

    Dear Sir

    I have n number of tables in my db,from that i have several
    tables which contains"user defined type columns"
    so how could i get/list the db objects which contains user defined type columns only.
    Kindly suggest me on this
    

    Use this

    select
          tab.table_name
        , tab.column_name
        , tab.data_type
    from
        user_tab_columns tab
      , user_types typ
    where
        tab.data_type = typ.type_name
    order by
        tab.table_name
        ;
    

    Best regards

    Mohamed Houri

  • Put the results of a remote object in the datagrid

    I'm on day 3, but not using CF I use PHP server-side. I installed amfphp and everything works fine.

    I retrieve the data from the server and I can see it clear at all like a Bell in the debug value window
    'responds.serverInfo.initialData '.

    But I can't get the data to display
    'results' get ready.
    This is my code someone at - it ideas?
    Your Mike

    The error this is how I was setting results, should have been done like this:

    results = new ArrayCollection (responds.serverInfo.initialData);

  • Setting cell values in the DataGrid control

    I have a request to a custom component called DataEntryDataGrid (which is a subclass of mx:DataGrid) I started on this blog: http://blogs.Adobe.com/aharui/2008/03/custom_arraycollections_adding.html

    The component works fine, but in this particular datagrid, I need special features.   After the first line of data is entered in the tabs of the user in the following line, I need the first and second columns to be filled based on the values of the previous row and then I need to automatically focus on the cell in the third column.  While the first and second columns must be always editable, they will be largely repetitive, and it would help if users did not have to enter the same numbers over and over again.  The first column of the new row should be the same value as the first column in the last row and the second column of the new row should be (value of the last row + 1). Example:

    DataGrid:
    
    | Slide No. | Specimen No. | Age | Weight | Length |
    |    1      |     1        |  5  |  65    |  40    |  <- This row is manually entered, just text inputs
    |    1*     |     2*       |  #  |        |        |
    
    * = values set programatically, these cells should still be focusable and editable
    # = this is where the focus should be
    

    The problem I have is that when I tab in the next line, the first value in the column don't prepare you.  The second column gets the value correct and properly displayed and emphasis is placed in the correct cell (the third column), but the first column remains empty.  I don't know why that is.  If I put a breakpoint in the code in the function focusNewRow() (which is called in the event of the dataGrid "itemFocusIn") (first column) "slideNo" value is set to the correct value, but after the 'focusNewRow' work finishes, a dataProvider trace [the current line] .slideNo shows the value is empty.  Non-null, just empty.  Traces of all other columns indicate the correct values.  Anyone have any ideas?  Here is the code for my main application:

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
             xmlns:s="library://ns.adobe.com/flex/spark" 
             xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:components="components.*">
      <fx:Script>
        <![CDATA[
          import mx.controls.DataGrid;
          import mx.events.DataGridEvent;
          
          public function traceSlideNo():void {
            var i:int;
            var g:Object = myDataGrid.dataProvider;
            for(i = 0; i < g.length -1; i++) {
              trace("sl: " + g[i].slideNo + ", sp: " + g[i].specimenNo + ", age: " + g[i].age);
            }
          }
          
          public function focusNewRow(e:DataGridEvent):void {
            if(e.currentTarget.dataProvider.length > 0 && e.rowIndex != 0 && e.columnIndex == 0) {
              var dg:DataGrid = e.currentTarget as DataGrid;
              var lastItem:Object = dg.dataProvider[e.rowIndex - 1];
              var targetItem:Object = dg.dataProvider[e.rowIndex];
              if(targetItem.specimenNo == "") {
                var focusCell:Object = new Object();
                focusCell.rowIndex = e.rowIndex;
                focusCell.columnIndex = 2;
                dg.editedItemPosition = focusCell;
                
                targetItem.slideNo = int(lastItem.slideNo);
                targetItem.specimenNo = int(lastItem.specimenNo) + 1;
                
                callLater(dg.dataProvider.refresh);
              }    
            }
          }
        ]]>
      </fx:Script>
      
      <components:DataEntryDataGrid x="10" y="10" width="450" id="myDataGrid" itemFocusIn="focusNewRow(event)"
                      editable="true" rowHeight="25" variableRowHeight="false">
        <components:columns>
          <mx:DataGridColumn headerText="Slide No." dataField="slideNo" editable="true"/>
          <mx:DataGridColumn headerText="Specimen No." dataField="specimenNo" editable="true"/>
          <mx:DataGridColumn headerText="Age" dataField="age" editable="true"/>
          <mx:DataGridColumn headerText="Weight" dataField="weight" editable="true"/>
          <mx:DataGridColumn headerText="Length" dataField="length" editable="true"/>
        </components:columns>
      </components:DataEntryDataGrid>
      <s:Button x="10" y="195" label="Trace Slide Numbers" click="traceSlideNo()"/>
    </s:Application>
    

    And here is the custom component, DataEntryDataGrid, just for reference (place in the "components" package in this example):

    <?xml version="1.0" encoding="utf-8"?>
    <mx:DataGrid xmlns:fx="http://ns.adobe.com/mxml/2009" 
           xmlns:s="library://ns.adobe.com/flex/spark" 
           xmlns:mx="library://ns.adobe.com/flex/mx" initialize="init(event)"
           editable="true" wordWrap="true" variableRowHeight="true">
      <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
      </fx:Declarations>
      
      
      
      <fx:Script>
        <![CDATA[
          import components.NewEntryArrayCollection;
          
          import mx.controls.Alert;
          import mx.controls.dataGridClasses.DataGridColumn;
          import mx.events.DataGridEvent;
          import mx.events.DataGridEventReason;
          import mx.events.FlexEvent;
          import mx.utils.ObjectUtil;
          
          private var arr:Array = [];
          private var ac:NewEntryArrayCollection;
          private var dg:DataGrid;
          
          public var enableDeleteColumn:Boolean;
          
          private function generateObject():Object
          {
            // Returns a new object to the datagrid with blank entries for all columns
            var obj:Object = new Object();
            for each(var item:Object in this.columns) {
              var df:String = item.dataField.toString();
              obj[df] = "";
            }
            return obj;
          }
          
          private function isObjectEmpty(obj:Object):Boolean
          {
            // Checks to see if the current row is empty
            var hits:int = 0;
            
            for each(var item:Object in this.columns) {
              var df:String = item.dataField.toString();
              if(obj[df] != "" || obj[df] !== null) {
                hits++;
              }
            }
            if(hits > 0) {
              return false;
            }
            return true;
          }      
          
          private function init(event:FlexEvent):void
          {
            dg = this;                // Reference to the DataEntryDataGrid
            ac = new NewEntryArrayCollection(arr);  // DataProvider for this DataEntryDataGrid
            ac.factoryFunction = generateObject;
            ac.emptyTestFunction = isObjectEmpty;        
            dg.dataProvider = ac;
            
            // Renderer for the DELETE column and Delete Button Item Renderer
            if(enableDeleteColumn == true){
              var cols:Array = dg.columns;
              var delColumn:DataGridColumn = new DataGridColumn("del");
              delColumn.editable = false;
              delColumn.width = 35;
              delColumn.headerText = "DEL";
              delColumn.dataField = "delete";
              delColumn.itemRenderer = new ClassFactory(DeleteButton);
              cols.push(delColumn);
              dg.columns = cols;
              dg.addEventListener("deleteRow",deleteClickAccept);
            }
          }
          
          private function deleteClickAccept(event:Event):void { // Handles deletion of rows based on event dispatched from DeleteButton.mxml
            dg = this;
            ac = dg.dataProvider as NewEntryArrayCollection;
            if(dg.selectedIndex != ac.length - 1) {
              ac.removeItemAt(dg.selectedIndex);
              ac.refresh();
            }
          }
    
        ]]>
      </fx:Script>
      
    </mx:DataGrid>
    

    In addition, the NewEntryArrayCollection.as file that is referenced by the component custom.  This is true also in the package "components":

    package components 
    {
      import mx.collections.ArrayCollection;
      
      public class NewEntryArrayCollection extends ArrayCollection
      {
        private var newEntry:Object;
        
        // callback to generate a new entry
        public var factoryFunction:Function;
        
        // callback to test if an entry is empty and should be deleted
        public var emptyTestFunction:Function;
        
        public function NewEntryArrayCollection(source:Array)
        {
          super(source);
        }
        
        override public function getItemAt(index:int, prefetch:int=0):Object
        {
          if (index < 0 || index >= length)
            throw new RangeError("invalid index", index);
          
          if (index < super.length)
            return super.getItemAt(index, prefetch);
          
          if (!newEntry)
            newEntry = factoryFunction();
          return newEntry;
        }
        
        override public function get length():int
        {
          return super.length + 1;
        }
        
        override public function itemUpdated(item:Object, property:Object = null, 
                           oldValue:Object = null, 
                           newValue:Object = null):void
        {
          super.itemUpdated(item, property, oldValue, newValue);
          if (item != newEntry)
          {
            if (emptyTestFunction != null)
            {
              if (emptyTestFunction(item))
              {
                removeItemAt(getItemIndex(item));
              }
            }
          }
          else
          {
            if (emptyTestFunction != null)
            {
              if (!emptyTestFunction(item))
              {
                newEntry = null;
                addItemAt(item, length - 1);
              }
            }
          }
        }
        
      }
    
    }
    

    Sorry for the length of this post, but I hate to see people post without including enough information to solve the problem.  If there is nothing, I have left out, made me know.

    I think that in the NewEntryArrayCollection, I would wire up to generate a

    populated point instead of where you are right now.

  • Name of the dynamic property of object in the table based on the value of a variable

    I have two paintings of custom class objects

    var obj1:Object1
    var obj2:Object2
    
    var array1:Array = [obj1[0], obj1[1], ...]
    var array2:Array = [obj2[0], obj2[1], ...]
    

    Object1 has a property named. Name while Object2 has a property named. Title.

    Now I have a common function including cab accepts an array (array1 or array2) and the name of property the object ("Name" or "Title") as input and needs to access this name of the property of the objects in the array:

    function myFunction(arr:Array, fieldName:String)
    {
        arr[0].fieldName  = "xxx";
    }
    

    the problem I have this achievement does not because the code in the function assumes that the property of that object in the table is actually a string "fieldName" while I want to dynamically determine the names of the fields based on the value of this variable, but cannot understand the syntax to do!

    Don't know if I'm clear - hope that makes sense... ;-) Thank you

    Hey p3pp3r,

    I think I understood you. Try the following and see if you get good results:

    function myFunction(arr:Array, fieldName:String)
    {
        arr[0][fieldName]  = "xxx";
    }
    

    Let me know how it turns out. Good luck!

  • What is the SQL to determine what are the table objects in the KEEP buffer pool?

    What is the SQL to determine what are the table objects in the KEEP buffer pool?

    Select owner, table_name

    from dba_tables

    where USER_TABLES = "KEEP."

    /

    David Fitzjarrell

  • How to find all the views or other objects in the database that contains the specific table (table Employee of exodus) in the oracle database?

    I want to find all objects in the DB which contain a perticular table in a specific schema.

    If there is a question about SQL Developer functionality is simple - click on the table in the connection browser and find the "Dependencies" tab on the right

    Philippe

  • Insert the object into the table

    Hi all

    I would insert my type of object in a table without specifying the name of the variable.

    That's my bad example:

    create or replace type MY_TYPE_OBJ as object 
    (
      val1 number,
      val2 number,
      val3 number
    );
    /
    
    CREATE TABLE MY_TABLE of MY_TYPE_OBJ;
    /
    
    declare 
        myType   MY_TYPE_OBJ;
    begin
    
      myType := new MY_TYPE_OBJ(1, 2, 3);
    
      insert into MY_TABLE values (myType.val1, myType.val2, myType.val3);
      
    end;
    /
    
    

    As you can see, on my last procedure, I had to use the insert into statement with val1, val2, val3 name filed.

    Is there a quicker way to insert an object into a table? In the production environment of the object type that almost 100 filed is not so friendly to write each one by one.

    Thank you

    Federico

    Example:

    SQL> create or replace type TFoo as object(
      2          attr1   integer,
      3          attr2   varchar2(10),
      4          attr3   date
      5  );
      6  /
    
    Type created.
    
    SQL>
    SQL> create table footab of TFoo(
      2          attr1 primary key,
      3          attr2 not null
      4  ) organization index
      5  /
    
    Table created.
    
    SQL>
    SQL> declare
      2          foo     TFoo;
      3  begin
      4          foo := new TFoo( 1, 'test1', trunc(sysdate) );
      5          insert into footab values foo;
      6  end;
      7  /
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select * from footab;
    
         ATTR1 ATTR2      ATTR3
    ---------- ---------- -------------------
             1 test1      2014/08/27 00:00:00
    
    SQL>
    

    I agree though - be careful with tables of objects and now their technical implementation and advantages and disadvantages.

  • OGG-01028 object with the number of the object 80673 is compressed. Compression of the table is not supported.

    (1) I received an email like this:

    Event_alert

    2013-09-17 22:00:16 ERROR OGG - 01028 Oracle GoldenGate Capture for Oracle, ext_1.prm: object with the number of the object 80673 is compressed. Compression of the table is not supported.

    2013-09-17 22:00:16 ERROR OGG - 01668 Oracle GoldenGate Capture for Oracle, ext_1.prm: PROCESS ABENDING.

    (2) I have not found the OBJ

    SQL > select OBJECT_ID, OBJECT_NAME from dba_objects where object_id = 80673;

    no selected line

    (3) change a few times the process EXT recover;

    (4) my excerpt settings

    Cat ext_1.prm

    EXTRACT ext_1

    Ogg, ogg PASSWORD USERID

    TRANLOGOPTIONS EXCLUDEUSER ogg

    SETENV (NLS_LANG = AMERICAN_AMERICA. ZHS16GBK)

    -SETENV (NLS_LANG = AMERICAN_AMERICA. AL32UTF8)

    EXTTRAIL ./dirdat/t1

    DYNAMICRESOLUTION

    TABLE YBK.*;

    This is a bug that has been fixed

    Excerpt from abending with Table of Compression is not supported, even if the database has no tables compressed. (Doc ID 1510691.1)

    event text: Oracle GoldenGate Capture for Oracle, ext_1.prm: object with the number of the object 86173 is compressed. Compression of the table is not supported.

    tableexclude *. DBMS_TABCOMP_TEMP *.

  • Model for PK not used on the tables of objects

    When uttering a primary key for a table of objects, the model for the primary key name is not used. SDDM (3.1.4 and earlier versions) is the addition of the string 'Oid_' before the name of the primary key table by default. So instead of "TABLE1_PK", the default name is "Oid_TABLE1_PK". It looks like the model is used by the object tables.

    ACE

    Hi Scott,.

    This should be fixed in version 3.3 of ai2 which is now available on OTN.

    David

  • Hidden Subtypeattributes in the table of object

    Hello

    Can someone clear this up for me?
    I had a supertype of tPerson, containing the attributes firstname, lastname, phonenr etc...

    I created a peopletable, based on the tPersonobjecttype.

    I created a subtype of tPerson, called tWebUserand added some attributes like emailaddress and password.

    Now, it is possible to insert instances of tPerson in the table, but it is (obviously) also possible to insert instances of the subtype tWebUser.

    Here's my question: where are the additional of the subtype attributes stored? If you do a describe table statement, you see just the columns store the attributes of supertype, if I do a select (normal) to the table, I see only the attributevalues, which belong to the supertype tPerson. But when I do a select using as tWebUser, I see all the attributes of the file tEpmloyee .

    Can anyone clear this up for me? I have created a few small business to become familiar with the Oracle objects and using tables to objects, but I have found no documentation about it.

    hereby the code to reproduce:
    -- Create the tPerson object
    create or replace type tPerson as object
    ( firstname    varchar2(50)
    , middle_name  varchar2(50)
    , lastname     varchar2(150)
    , phonenr      varchar2(15)
    , gender       varchar2(10)
    ) not final
    /
    
    -- Create the object table based on tPerson
    create table persons of tPerson;
    
    -- Create a subtype tWebUser
    create or replace type tWebUser under tPerson
    ( emailaddress   varchar2(150)
    , secretpassword varchar2(100)
    )
    /
    
    -- Insert a row the normal way
    insert into persons values(  'Peter', null, 'Boekelaar', '555 NETHERLANDS','M');
    
    -- Insert a row as an object
    insert into persons values(  tPerson('John', null, 'Doe', '555 ATHOME','M'));
    
    -- insert a row as an subtype
    insert into persons values( tWebUser('Jane', null, 'Doe', '555-ATWORK', 'F', '[email protected]', 'secretpassword' ) );
    
    select *
      from persons;
    
    FIRSTNAME  MIDDLE_NAME  LASTNAME   PHONENR          GENDER
    ---------  -----------  ---------  ---------------  ------
    Peter                   Boekelaar  555 NETHERLANDS  M
    John                    Doe        555 ATHOME       M
    Jane                    Doe        555-ATWORK       F
    
    
    select psn.*
         , treat(value(psn) as tWebUser).emailaddress   emailaddress
         , treat(value(psn) as tWebUser).secretpassword secretpassword
      from persons psn;
    
    FIRSTNAME  MIDDLE_NAME  LASTNAME   PHONENR          GENDER  EMAILADDRESS         SECRETPASSWORD
    ---------  -----------  ---------  ---------------  ------  -------------------  --------------
    Peter                   Boekelaar  555 NETHERLANDS  M
    John                    Doe        555 ATHOME       M
    Jane                    Doe        555-ATWORK       F       [email protected]  secretpassword
    Looking at the hidden using this statement columns
    select sys_nc_rowinfo$
      from persons;
    Returns only the content in the form of objects, but it is always presented as a tPerson object.

    See you soon,.
    Peter

    Subtype attributes are stored as columns hidden in your table of people.

    If you choose to user_tab_cols rather than describe, you can see:

    select
    column_name, data_type, data_length, hidden_column, qualified_col_name
    from user_tab_cols
    where table_name = 'PERSONS'
    ; 
    

    [url http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11822/adobjadv.htm#CHDCFBJI] Documentation tells you about the types of objects are stored.

  • Create the object on the table of the default user space only

    Hi all

    Is any way I can limit a user to create tables rather THAN on the system tablespace, not counting that change the quota 0 on system M user?

    Can I restrict a user to create objects only on its own default tablespace?
    change the quota user 0 M on < all other tablespaces except default user >?

    Thank you.

    Hello

    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> create user ann identified by "ann" account unlock;
    
    User created.
    
    SQL> grant CREATE SESSION to ann;
    
    Grant succeeded.
    
    SQL> grant CREATE TABLE to ann ;
    
    Grant succeeded.
    
    SQL> conn ann/ann
    Connected.
    SQL> create table t1 (col1 int);
    
    Table created.
    
    SQL> create table t2 (col1 int) tablespace system;
    
    Table created.
    
    SQL> select TABLE_NAME, TABLESPACE_NAME from user_tables;
    
    TABLE_NAME                     TABLESPACE_NAME
    ------------------------------ ------------------------------
    T1                             USERS
    T2                             SYSTEM
    
    SQL> select * from session_privs;
    
    PRIVILEGE
    ----------------------------------------
    CREATE SESSION
    CREATE TABLE
    
    SQL> show user
    USER is "ANN"
    SQL> insert into t1 values (1);
    insert into t1 values (1)
                *
    ERROR at line 1:
    ORA-01950: no privileges on tablespace 'USERS'
    
    SQL> insert into t2 values (1);
    insert into t2 values (1)
                *
    ERROR at line 1:
    ORA-01950: no privileges on tablespace 'SYSTEM'
    
    SQL> alter user ann quota 10m on users;
    
    User altered.
    
    SQL> select * from DBA_TS_QUOTAS
      2  where tablespace_name='USERS';
    
    TABLESPACE_NAME                USERNAME                            BYTES
    ------------------------------ ------------------------------ ----------
     MAX_BYTES     BLOCKS MAX_BLOCKS DRO
    ---------- ---------- ---------- ---
    USERS                          ANN                                     0
      10485760          0       1280 NO
    
    SQL> insert into t1 values (1);
    
    1 row created.
    
    SQL> insert into t2 values (1);
    insert into t2 values (1)
                *
    ERROR at line 1:
    ORA-01950: no privileges on tablespace 'SYSTEM'
    

    Oracle - possibility to create a segment, perhaps with option different option of creations of segment. You can not insert in the segment until you have the opportunity on the tablespace. I hope that you understood.

    Note: try to provide the version number of oracle's four-digit

    -Pavan Kumar N

    Published by: pounet on March 14, 2011 12:34

    Published by: pounet on March 14, 2011 12:36

  • Hit testing objects in the table problem

    Hey guys, thank you very much in advance for any comments.  These forums are a great help.

    I have a serious problem with a loop in a table. I'm trying to hitTestObject each MC in a table against all other MC in this table.   That part works.

    The problem is that in my statement of hitTestObject, so obviously examines only 2 items at a time.  When touch 2 MC, I put a property called 'Touch' to true.  The problem is they are moving MCs and at one point touching only 2 / 3.  What is happening is:

    The loop runs once as the test Array [0] and table [1].  Say that those who are affected.  She sets their properties 'Touch' true (it's what I want).  THEN it works again test Array [1] and table [2] and finds that they are NOT overlapping.  It this process it defines two of their properties 'Touch' to false, EVEN IF one of them may overlap a different array object.

    I want to individual, set the property to "Touch" for each object in the table.  Currently, these properties are getting crushed even if 2 / 3 objects are superimposed in fact.

    That makes sense?  Essentially the "else" statement is too often called because certain combinations of array objects are not touch, but others are.

    -----------------------CODE BELOW-----------------------

    stage.addEventListener (Event.ENTER_FRAME, hitTestBalls);

    function hitTestBalls(e:Event) {}

    for (var m1:int = 0; m1 < MonsterArray.length; m1 ++) {}

    for (var m2:int = m1 + 1; m2 < MonsterArray.length; m2 ++) {}

    {if (MonsterArray [M1] .hitTestObject (MonsterArray [m2]))}

    MonsterArray [m2]. Touch = true;

    MonsterArray [m1]. Touch = true;

    trace (MonsterArray [m1]. The touching, MonsterArray [m2]. Touch);

    trace (M1, m2);

    break?

    } else {}

    trace (M1, m2);

    trace ("NotTouching");

    MonsterArray [m1]. Touch = false; MonsterArray [m2]. Touch = false;

    }

    }

    }

    While waiting for a response, here's something to consider.  You don't want to affect the Touching false at any time after that you start the analysis, only front...

    function hitTestBalls(e:Event) {}

    first put all wrong

    for (var m0:int = 0; m0< monsterarray.length;="">

    MonsterArray [m0]. Touch = false;

    }

    now test for overlapping - this way you don't overwrite anything with fake

    for (var m1:int = 0; m1< monsterarray.length;="">

    for (var m2:int = m1 + 1; m2)< monsterarray.length;="" m2++)="">

    {if (MonsterArray [M1] .hitTestObject (MonsterArray [m2]))}

    MonsterArray [m2]. Touch = true;

    MonsterArray [m1]. Touch = true;

    }

    }

    }

    }

    And if there be oinky be a pair that overlap as you say, you can add a breakdown; orders to end a loop when a hit is detected.

  • Nested table of object type have only one record all the time

    Hi all

    I have a question regarding the storage of multiple records in a nested Table that is of type OBJECT.

    The program below that I wrote for the test and during the test, I was able to store only the last record in the nested Table.

    Please let me know what I did wrong here.

    Step 1:
    CREATE or REPLACE TYPE book_obj AS OBJECT (name varchar2 (25), author varchar2 (25), abstract varchar2 (4000));
    /

    Step 2:
    CREATE or REPLACE TYPE book_table IS TABLE OF THE book_obj;
    /

    Step 3: CREATE TABLE book (name, varchar2 (25), varchar2 (25) author, varchar2 (4000)) abstract;
    INSERT VALUES Accountants ('Harry Potter,' 'MK', 'It's magic');
    INSERT the book VALUES ("Ramayana', 'VK', 'It is mythiology'");
    COMMIT;

    Step 4:
    declare
    bookset book_table;
    ln_cnt pls_integer;
    Start
    bookset: = book_table (book_obj ('madhu', 'kongara', 'sudhan'));
    dbms_output.put_line (' the number is ' | bookset.) (Count); -> I see COUNT = 1
    bookset: = bookset_t(); -> Assignment to NULL.
    dbms_output.put_line (' the number is ' | bookset.) (Count); -> I see County 0
    for rec in (select * from book) loop-> now a loop twice.
    dbms_output.put_line (' name > ' |) Rec.Name);
    bookset: = bookset_t (book_t (rec.name, rec.author, rec.abstract));
    end loop;
    dbms_output.put_line (' the number is ' | bookset.) (Count); -> I can see COUNT = 1 (why?)
    END;

    I looped twice to fill two records in the TABLE IMBRIQUEE OF TYPE OBJECT. But when I see the Count I get only 1 and the data is also having the last record.

    Can you get it someone please let me know how to fill out the table nested with all records. Tell me where I am wrong.

    Very much appreciate your help here.

    Thank you and best regards,
    NKM

    Maldini says:
    dbms_output.put_line (' the number is ' | bookset.) (Count); -->, I can see COUNT = 1 (why?)

    Because instead of add to bookset collectionto set (ergo replacement) it a collection containing recovered book. Use:

    declare
        bookset book_table;
        ln_cnt pls_integer;
    begin
        bookset := book_table(book_obj('madhu','kongara','sudhan'));
        dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1
        bookset := book_table(); --> Assigning back to NULL.
        dbms_output.put_line('The count is '||bookset.count); --> I can see count as 0
        for rec in (select * from book) loop --> Now Looping two times.
          dbms_output.put_line(' name > '||rec.name);
          bookset.extend;
          bookset(bookset.count) := book_obj(rec.name, rec.author, rec.abstract);
        end loop;
        dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1 (why)
    end;
    /
    The count is 1
    The count is 0
    name > Harry Potter
    name > Ramayana
    The count is 2
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    Or better use bulk collect:

    declare
        bookset book_table;
        ln_cnt pls_integer;
    begin
        bookset := book_table(book_obj('madhu','kongara','sudhan'));
        dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1
        bookset := book_table(); --> Assigning back to NULL.
        dbms_output.put_line('The count is '||bookset.count); --> I can see count as 0
        select  book_obj(name,author,abstract)
          bulk collect
          into  bookset
          from  book;
        for i in 1..bookset.count loop --> Now Looping two times.
          dbms_output.put_line(' name > '||bookset(i).name);
        end loop;
        dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1 (why)
    end;
    /
    The count is 1
    The count is 0
    name > Harry Potter
    name > Ramayana
    The count is 2
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • Not possible to store several fileReference object to the same table?

    Hi all

    I'm trying to store several fileReference object in a table. But whenever I have a new object each time push() artefacts which is already in the table gets set on the object later.

    I let the user selecting an image. Then I push the fileReference object selected in a table like my_array.push (FileReference (event.target));

    If I then executes a loop on 'my_array' to check he's glad I get the most recent pushed fileReference for each index object in the table.

    With an object pushed:

    1 Image1.jpg

    With two objects pushed:

    1 Image2.jpg

    2 Image2.jpg

    Anyone has any ideas on this?

    Thank you very much

    Hello

    Sorry for the delay.  You've probably discovered the answer to that now, but in case you do not have or someone else runs into this issue here is the code that should fix this:

    // Local Files
    private var fileList:Array = new Array();
    private var localFiles:FileReference = null; 
    
    private function browse(event:MouseEvent):void {
         localFiles = new FileReference();
         trace("[Browse] Using local files");
         localFiles.addEventListener(Event.SELECT, onLocalFilesSelected);
         localFiles.browse();
    }
    

    The problem is you have had one instance of localFiles, and while that you stored more than once in the table, when the reference has changed it performs all of the table.  Instead, I'm newing up a FileReference browse() service, so that we get a new each time.  I hope that makes sense.

    Chris

Maybe you are looking for

  • Lost iTunes Library - CAN not rebuild. Help!

    Tonight I thought I had lost most of my iTunes library. It turns out that I didn't have that I can find the content itself, but iTunes can't see it. So, I followed the instructions here to try to resolve the problem: https://support.apple.com/en-gb/H

  • HOW TO TURN ON THE LIGHT KEBOARD

    How DO I SWITCH ON THE KEBOARD LIGHT ON THE computer PORTABLE HP PAVILION I press f5 and the space bar I tried everything but still know the joy she doin me?

  • Z6100 'off line '.

    Hi all I have a Z6100 which continued offline. I have to restart the service of spooling print to print. After that, it goes offline again. I can get the printer web page and I am able to ping. Do I have a hardware problem? Some say that I need a new

  • Paper jam in the printer hp photosmart c4480

    Paper jam in the printer hp photosmart c4480 How do you get the A6 envelope to remove it?

  • Check disk starts when you start Windows 7

    I just had to install a new hard drive and a message to run the disk check. But when he got to the verification of the empty space it was running at a pace that would have taken 3 hours.  I couldn't stop her, so I rebooted. When the computer starts u